In this section, you will learn how an EdgeRule is
defined and structured inside a given rules.xml or
similarly named file. An EdgeRule definition has an
identical structure when compared to a NodeRule.
The only differences are the names and numbers of rule attributes.
Likewise, there are various attributes that can be changed to customize the runtime
behavior of a VisualEdge. 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.
Example 6.3. EdgeRule XML Fragment
<list name="Rule"> <attribute name="Name" type="String" value="erule1"/> <attribute name="Type" type="String" value="EdgeRule"/> <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"/> <attribute name="DetachableSource" type="Boolean" value="false"/> <attribute name="DetachableTarget" type="Boolean" value="false"/> <attribute name="EdgeInsertMode" value="edge insert disabled"/> <attribute name="SnapToPortDistance" value="5cm"/> </list> </list>
There are two EdgeRule attributes that take an enumerated
value. They are the following:
EdgeInsertMode
The edge insert mode can be one of the following constant strings:
“edge insert disabled”
“edge insert exact position”
“edge insert automatic center”
SnapToPortDistance
The “snap to port distance” denotes the maximum distance for an edge to automatically snap to the closest port. Setting the distance to 0 or less will effectively disable the automatic snapping of edges to the closest port.
© 2004, 2005 Tensegrity Software GmbH