|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.graph.rule.AbstractRule
com.tensegrity.graph.rule.AbstractGraphObjectRule
com.tensegrity.graph.rule.EdgeRule
Class EdgeRule implements the rule template for
VisualEdge objects. Such a rule contains a set of
attributes whose combined values, including those defined in
GraphObjectRule, define the runtime behavior of
those visual edges which are associated with the rule.
The attributes supported by the EdgeRule are listed
below. You can find detailed information about each attribute afterwards.
The detachable-source attribute specifies
whether the source end of a VisualEdge can be
detached.
It specifies the detachable source state of
the VisualEdge for user interaction only.
The methods provided by the EdgeRule to support the
detachable-source attribute are listed below:
boolean isDetachableSource()void setDetachableSource(boolean)
The detachable-target attribute specifies
whether the target end of a VisualEdge can be
detached.
It specifies the detachable target state of
the VisualEdge for user interaction only.
The methods provided by the EdgeRule to support the
detachable-target attribute are listed below:
boolean isDetachableTarget()void setDetachableTarget(boolean)
The edge-insert-mode attribute
refers to the edge-split operation.
The following String values are supported:
| Value | Description |
|---|---|
| edge insert disabled | The edge-split operation is disabled when the attributes value is set to 'edge insert disabled'. |
| edge insert exact position |
When the attributes value is set to 'edge insert exact position' the
VisualNode dropped onto the VisualEdge splits the
VisualEdge exactly the position where it has been dropped.
|
| edge insert automatic center |
When the attributes value is set to 'edge insert automatic center' the
VisualNode dropped onto the VisualEdge splits the
VisualEdge at its center position.
|
EdgeRule to support the
edge-insert-mode attribute are listed below:
The snap-to-port-distance attribute specifies
the distance which is used to let the source end or the target
end of a VisualEdge automatically snap to a
VisualPort when either the source end, the target end or the
whole VisualEdge is moved around.
A value less than zero it is automatically converted to zero.
This attribute is used only with user interaction.
The methods provided by the EdgeRule to support the
edge-insert-mode attribute are listed below:
RuleRegistry,
Serialized Form| Field Summary | |
static int |
EDGEINSERTMODE_AUTOCENTER
edge-insert-mode constants |
static int |
EDGEINSERTMODE_DISABLED
edge-insert-mode constants |
static int |
EDGEINSERTMODE_EXACT
edge-insert-mode constants |
| Constructor Summary | |
EdgeRule(EdgeRule rule)
Copy constructor for an edge rule. |
|
EdgeRule(java.lang.String name)
Constructs a new edge rule. |
|
| Method Summary | |
Rule |
deepCopy()
Returns a deepCopy of this rule. |
static java.lang.String |
edgeinsertMode2String(int edgeinsertmode)
Returns a descriptive string for the given edge insert mode. |
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getDescription()
Return a string description of this rule. |
int |
getEdgeInsertMode()
Returns the edge insert mode for this edge rule. |
int |
getSnapToPortDistance()
Returns the snap to port distance for this edge rule. |
int |
hashCode()
|
boolean |
isDetachableSource()
Returns the detachableSource flag for this rule. |
boolean |
isDetachableTarget()
Returns the detachableTarget flag for this rule. |
void |
setDetachableSource(boolean detachableSource)
Sets the detachableSource flag for this rule. |
void |
setDetachableTarget(boolean detachableTarget)
Sets the detachableTarget flag for this rule. |
void |
setEdgeInsertMode(int edgeinsertmode)
Sets the edge insert mode for this edge rule. |
void |
setSnapToPortDistance(int snapToPortDistance)
Sets the snap to port distance for this edge rule. |
java.lang.String |
toString()
Return a string representation of this rule. |
| Methods inherited from class com.tensegrity.graph.rule.AbstractGraphObjectRule |
getName, isCopyable, isCutable, isDeletable, isMovable, isResizable, isSelectable, setCopyable, setCutable, setDeletable, setMovable, setResizable, setSelectable |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.tensegrity.graph.rule.Rule |
getName |
| Field Detail |
public static final int EDGEINSERTMODE_DISABLED
public static final int EDGEINSERTMODE_EXACT
public static final int EDGEINSERTMODE_AUTOCENTER
| Constructor Detail |
public EdgeRule(java.lang.String name)
The properties are initialized with the following defaults:
name - name of the rule, must not be null.public EdgeRule(EdgeRule rule)
The reference to the parent RuleRegistry is set to null
in the copy.
rule - the source rule to copy from.| Method Detail |
public static final java.lang.String edgeinsertMode2String(int edgeinsertmode)
edgeinsertmode - the edge-insert-mode to look up.
public boolean isDetachableSource()
public void setDetachableSource(boolean detachableSource)
detachableSource - true if detaching is allowed, otherwise false.public boolean isDetachableTarget()
public void setDetachableTarget(boolean detachableTarget)
detachableTarget - true if detaching is allowed, otherwise false.public void setEdgeInsertMode(int edgeinsertmode)
edgeinsertmode - one of the EDGEINSERT_MODE flags from this class.
InvalidArgumentException - thrown if the edge insert mode is not
one of the valid constants defined in this class.public int getEdgeInsertMode()
public void setSnapToPortDistance(int snapToPortDistance)
snapToPortDistance - the distance when the edge snaps to the
closest port.public int getSnapToPortDistance()
public java.lang.String toString()
toString in class AbstractGraphObjectRulepublic java.lang.String getDescription()
getDescription in interface Rulepublic Rule deepCopy()
deepCopy in interface Rulepublic boolean equals(java.lang.Object obj)
equals in class AbstractGraphObjectRulepublic int hashCode()
hashCode in class AbstractGraphObjectRule
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||