In this section, you will learn how a NodeRule is
defined and structured inside a given rules.xml or
similarly named file.
There are various attributes that can be changed to customize the runtime
behavior of a VisualNode. Below we list a few of them.
You will eventually have to consult the Rules section of
the Elements chapter inside the
Framework Manual for more detailed explanations of all configuration
attributes available to you. Such a discussion is unfortunately beyond the scope
of this tutorial chapter and would undoubtedly duplicate information that is
likely to change in future software releases.
Example 6.2. NodeRule XML Fragment
... <list name="Rule"> <attribute name="Name" type="String" value="nrule1"/> <attribute name="Type" type="String" value="NodeRule"/> <list name="Properties"> <attribute name="Deletable" type="Boolean" value="false"/> <attribute name="Moveable" type="Boolean" value="true"/> <attribute name="Selectable" type="Boolean" value="true"/> <attribute name="Resizable" type="Boolean" value="false"/> ... </list> </list> ...
Notice that a Rule has a Name and a Type attribute.
“NodeRule” is the Type string required when defining rules that are
to be attached to VisualNode instances in your repository
or visual graphs.
The tag <Properties> contains child attribute elements that specify different behaviors of the rule. More times than not, the attribute name is intuitively comprehensible. In those rare cases where the name alone is not enough to convey meaning, you should reference the Elements chapter inside the Framework Manual that accompanies this tutorial.
© 2004, 2005 Tensegrity Software GmbH