|
|||||||||||
| 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.GraphRule
Class GraphRule implements the rule template for
VisualGraph objects. Such a rule contains a set of
attributes whose combined values define the runtime behavior of
those VisualGraphs which are associated with the rule.
The attributes supported by the GraphRule are listed
below. You can find detailed information about each attribute afterwards.
The autospace-mode attribute specifies
whether or how to displace VisualNodes when
they are added to a VisualGraph so that overlap is avoided.
The following constants are supported:
| Value | Description |
|---|---|
AUTOSPACEMODE_NONE |
The autospace-mode is disabled. |
AUTOSPACEMODE_HORIZONTAL |
The VisualNodes are displaced to the left or to the right in
order to avoid overlapping.
|
AUTOSPACEMODE_VERTICAL |
The VisualNodes are displaced to the top or to the bottom in
order to avoid overlapping.
|
GraphRule to support the
autospace-mode attribute are listed below:
int getAutoSpaceMode()void setAutoSpaceMode(int)
The accept-loose-objects attribute refers to
VisualNodes as objects and it specifies
whether the VisualGraph, this rule is assigned to,
accepts loose VisualNode objects inside of it. Loose
VisualNode objects are those with an indegree and an outdegree
of zero.
In the case that a VisualNode is added and it is a loose
one but crosses a VisualEdge with enabled edge-insert-mode, the
VisualNode is not considered as a loose VisualNode.
This attribute is not only used with user interaction but
also for API calls.
GraphRule to support the
accept-loose-objects attribute are listed below:
boolean isAcceptLooseObjects()void setAcceptLooseObjects(boolean)
The edge-split-tolerance attribute specifies
the maximum distance of a VisualNode to a
VisualEdge to let the VisualNode split the
VisualEdge.
This attribute is used with user interaction only.
GraphRule to support the
edge-split-tolerance attribute are listed below:
The edge-insert-single-position attribute specifies
whether a multi selection of VisualNodes split a
VisualEdge at a certain position (e.g. the mouse cursor
position) or of they split those VisualEdges they might
geometrically overlay.
GraphRule to support the
edge-insert-single-position attribute are listed below:
The node-drop-handler attribute specifies
the name of the VisualNodeDropHandler instance to
invoke when a VisualNode is dropped on/added to the
VisualGraph this rule is assigned to.
This attribute is used with user interaction only.
For further information about node-drop-handlers please see
the documentation of
VisualNodeDropHandler
RuleRegistry,
Serialized Form| Field Summary | |
static int |
AUTOSPACEMODE_HORIZONTAL
Deprecated. use VisualGraphViewInteractionConfiguration displace modes instead |
static java.lang.String |
AUTOSPACEMODE_HORIZONTAL_DESCRIPTION
Deprecated. use VisualGraphViewInteractionConfiguration displace modes instead |
static int |
AUTOSPACEMODE_NONE
Deprecated. use VisualGraphViewInteractionConfiguration displace modes instead |
static java.lang.String |
AUTOSPACEMODE_NONE_DESCRIPTION
Deprecated. use VisualGraphViewInteractionConfiguration displace modes instead |
static int |
AUTOSPACEMODE_VERTICAL
Deprecated. use VisualGraphViewInteractionConfiguration displace modes instead |
static java.lang.String |
AUTOSPACEMODE_VERTICAL_DESCRIPTION
Deprecated. use VisualGraphViewInteractionConfiguration displace modes instead |
| Constructor Summary | |
GraphRule(GraphRule rule)
Copy-Constructs a new graph rule. |
|
GraphRule(java.lang.String name)
Constructs a new graph rule. |
|
| Method Summary | |
static java.lang.String |
autospaceMode2String(int autospacemode)
Deprecated. use VisualGraphViewInteractionConfiguration displace modes instead |
Rule |
deepCopy()
Returns a deepCopy of this rule. |
boolean |
equals(java.lang.Object obj)
|
int |
getAutoSpaceMode()
Deprecated. use VisualGraphViewInteractionConfiguration displace modes instead |
java.lang.String |
getDescription()
Returns a description of this rule. |
java.lang.String |
getDropHandlerName()
Returns the name that identifies the VisualNodeDropHandler for this GraphRule. |
int |
getEdgeSplitTolerance()
Returns the current tolerance for edge-splitting. |
java.util.Set |
getLegalCrossVisualSubgraphEdgeSplits()
Returns a set of rule names that identify VisualSubgraph
objects that should allow cross subgraph edgesplits. |
java.lang.String |
getLegalCrossVisualSubgraphEdgeSplitsAsString()
Returns the is-legal-subgraph list concatenated into a single string where tokens are delimited by a colon. |
java.lang.String |
getName()
Returns the name of the rule. |
int |
hashCode()
|
boolean |
isAcceptLooseObjects()
Returns the accept-loose-objects flag for this GraphRule. |
boolean |
isEdgeInsertSinglePosition()
Returns the edge single position flag for this GraphRule. |
void |
setAcceptLooseObjects(boolean acceptlooseobjects)
Sets the accept-loose-objects flag for this GraphRule. |
void |
setAutoSpaceMode(int autospacemode)
Deprecated. use VisualGraphViewInteractionConfiguration displace modes instead |
void |
setDropHandlerName(java.lang.String drophandlername)
Sets the name that identifies the VisualNodeDropHandler for this GraphRule. |
void |
setEdgeInsertSinglePosition(boolean edgeinsertsingleposition)
Sets the edge single position flag for this GraphRule. |
void |
setEdgeSplitTolerance(int edgeSplitTolerance)
Sets the tolerance for edge-splitting. |
void |
setLegalCrossVisualSubgraphEdgeSplits(java.util.Collection legalSubgraphRules)
Sets the is-legal-subgraph rule names (as Strings) for this GraphRule. |
static int |
string2autospaceMode(java.lang.String description)
Deprecated. use VisualGraphViewInteractionConfiguration displace modes instead |
java.lang.String |
toString()
Return a string representation of this rule. |
| 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 AUTOSPACEMODE_NONE
public static final int AUTOSPACEMODE_HORIZONTAL
public static final int AUTOSPACEMODE_VERTICAL
public static final java.lang.String AUTOSPACEMODE_NONE_DESCRIPTION
public static final java.lang.String AUTOSPACEMODE_HORIZONTAL_DESCRIPTION
public static final java.lang.String AUTOSPACEMODE_VERTICAL_DESCRIPTION
| Constructor Detail |
public GraphRule(java.lang.String name)
The default settings of the properties are as follows:
name - the name of the graphrule, must not be null.public GraphRule(GraphRule rule)
The reference of for the enclosing RuleRegistry is set to
null in the new instance.
rule - the GaphRule instance to copy from| Method Detail |
public int getAutoSpaceMode()
GraphRule.
public void setAutoSpaceMode(int autospacemode)
GraphRule.
autospacemode - the autospace mode to set.
Must be one of the AUTOSPACE_* fields defined in this class.
InvalidArgumentException - thrown if the value is not
one of the pre-defined autospace constants.public boolean isAcceptLooseObjects()
GraphRule.
public void setAcceptLooseObjects(boolean acceptlooseobjects)
GraphRule.
acceptlooseobjects - the accept-loose-objects flag for
this graphrule.public int getEdgeSplitTolerance()
public void setEdgeSplitTolerance(int edgeSplitTolerance)
edgeSplitTolerance - the tolerance to use for edge-splitting.public boolean isEdgeInsertSinglePosition()
GraphRule.
public void setEdgeInsertSinglePosition(boolean edgeinsertsingleposition)
GraphRule.
edgeinsertsingleposition - the edge single position flag for
this graphrule.public java.lang.String getDropHandlerName()
VisualNodeDropHandler for this GraphRule.
VisualNodeDropHandler for this GraphRule.public void setDropHandlerName(java.lang.String drophandlername)
VisualNodeDropHandler for this GraphRule.
drophandlername - the name that identities the
VisualNodeDropHandler for this GraphRule.public java.util.Set getLegalCrossVisualSubgraphEdgeSplits()
VisualSubgraph
objects that should allow cross subgraph edgesplits.
public java.lang.String getLegalCrossVisualSubgraphEdgeSplitsAsString()
public void setLegalCrossVisualSubgraphEdgeSplits(java.util.Collection legalSubgraphRules)
GraphRule.
legalSubgraphRules - collection of names of legal rules.
public java.lang.String getDescription()
getDescription in interface Rulepublic Rule deepCopy()
deepCopy in interface Rulepublic java.lang.String toString()
public boolean equals(java.lang.Object obj)
public int hashCode()
public static final java.lang.String autospaceMode2String(int autospacemode)
autospacemode - the autospace-mode to look up.
public static final int string2autospaceMode(java.lang.String description)
description - the string describing the autospace-mode.
public java.lang.String getName()
getName in interface Rule
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||