|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface represents the functionality of any potential
Edge representation. By incorporating the
functionality of a Composite object, it becomes
possible to assign complex shapes and styles to an instance
of this class.
Edge and a VisualEdge. Thus the
getEdge() method called on an instance is capable of
returning the same reference as any other instance.
Constructing a VisualEdge is done by means of a
GraphViewFactory,
which will hide the particular implementation classes from client code.
Isolated and non-isolated VisualEdge instances require
individual handling, since no model counterparts exists for isolated
edges. The Graph simply does not
know about isolated edges. If you want to add a VisualEdge
to a VisualGraph or a
VisualSubgraph and it is not connected,
then no model object needs to exist. If the VisualEdge
is to be connected however, you must add the corresponding model
Edge to the associated
Graph or
Subgraph. The model object can be
obtained by invoking getEdge().
The distinction between isolated and connected VisualEdge
objects introduces extra overhead when dealing with
VisualGraphand
VisualSubgraph instances. If you come
from an academic background, it is often helpful not to consider isolated,
unconnected edges at all, since graph theory does not take them into account.
Strictly speaking, isolated edges do not exist. The model representation, as
provided by Graph or
Subgraph, is guaranteed not to contain any
non-connected edges and can be used with regular algorithms and graph
processing tools.
The two endpoints of a VisualEdge are called source and target
and they define the current state connection state of a VisualEdge.
The source and target can be connected to an instance of
VisualNode which can be retrieved by invoking
the methods getVisualSource() and getVisualTarget() respectively.
These methods return null if a connection is not registered. A connection
on one side of a VisualEdge to a VisualNode
requires the additional assignment of a VisualPort,
which must be part of the SAME VisualNode that the
connection is assigned to. In case the source-end of a VisualEdge
is currently not connected, it is a required invariant that both the methods
getVisualSource() and getVisualSourcePort() return
null. In the case the source end is connected, both methods
must return non-null references. The same is true for the methods
that deal with the target-end of a VisualEdge.
Edge,
VisualGraph,
VisualSubgraph,
VisualNode,
VisualPort,
Graph,
Subgraph,
Node,
Port,
VisualEdgeListener,
CompositeLine| Field Summary |
| Fields inherited from interface com.tensegrity.generic.attribute.AttributableOnSet |
TREE_SUBSET_POSTFIX |
| Fields inherited from interface com.tensegrity.graph.layout.LayoutableEdge |
EDGE_TYPE_CURVE, EDGE_TYPE_DYNAMIC, EDGE_TYPE_ORTHOGONAL, EDGE_TYPE_STRAIGHT, LABEL_POSITION_CENTER, LABEL_POSITION_CENTER_END, LABEL_POSITION_CENTER_START, LABEL_POSITION_FREE, LABEL_POSITION_HEAD, LABEL_POSITION_HEAD_END, LABEL_POSITION_HEAD_START, LABEL_POSITION_TAIL, LABEL_POSITION_TAIL_END, LABEL_POSITION_TAIL_START |
| Method Summary | |
void |
addVisualEdgeListener(VisualEdgeListener listener)
Adds a VisualEdgeListener to this
VisualEdge. |
VisualEdge |
deepCopy(Edge edge,
VisualNode visualsource,
VisualNode visualtarget,
VisualPort visualsourceport,
VisualPort visualtargetport)
Makes a deep independant copy of a VisualEdge. |
CompositeLine |
getComposite()
Returns the instance of the CompositeLine associated to the
VisualEdge instance. |
Edge |
getEdge()
Returns the reference to the Edge
this VisualEdge is associated with |
VisualEdgeInfo |
getVisualEdgeInfo()
Returns the VisualEdgeInfo associated with this
VisualEdge. |
VisualNode |
getVisualSource()
Gets the VisualNode at the source end of this
VisualEdge. |
VisualPort |
getVisualSourcePort()
Returns the VisualPort VisualPort at the source end of
this instance. |
VisualNode |
getVisualTarget()
Gets the VisualNode at the target end of this
VisualEdge. |
VisualPort |
getVisualTargetPort()
Returns the VisualPort VisualPort at the target-end of
this instance. |
boolean |
isDetached()
Returns true if this VisualEdge has been
manipulated so that it is detached. |
void |
removeVisualEdgeListener(VisualEdgeListener listener)
Removes a VisualEdgeListener from this
VisualEdge. |
void |
setVisualEdgeInfo(VisualEdgeInfo visualEdgeInfo)
Sets the VisualEdgeInfo associated with this
VisualEdge. |
void |
updatePosition()
This method updates the position of this VisualEdge
instance according to the ports it is connected to.
|
void |
updatePosition(boolean updatesource,
boolean updatetarget)
This method updates the position of this VisualEdge
instance according to the ports it is connected to.
|
| Methods inherited from interface com.tensegrity.graph.view.VisualGraphObject |
deepCopy, getBaseComposite, getGraphObject, getID, getParentContainer, getRootContainer, getRule, getRuleRegistry, getUniqueID, isPinned, registerVetoableVisualEventMediator, registerVisualEventMediator, setPinned, setRule, setRuleRegistry |
| Methods inherited from interface com.tensegrity.generic.attribute.AttributableOnSet |
addAttributableOnSetListener, areAttributableEventsEnabled, disableAttributableEvents, enableAttributableEvents, getAttributes, getAttributesTree, removeAttributableOnSetListener, setAttributes, setAttributesTree |
| Methods inherited from interface com.tensegrity.generic.attribute.Attributable |
getAttribute, getAttributeType, getAttributeValue, setAttribute, setAttributeValue |
| Methods inherited from interface com.tensegrity.graph.layout.Layoutable |
getEdgeLayoutContext, getLayoutAttributeSet, getLayoutContext, getNodeLayoutContext, setEdgeLayoutContext, setLayoutAttributes, setLayoutContext, setNodeLayoutContext |
| Method Detail |
public CompositeLine getComposite()
CompositeLine associated to the
VisualEdge instance.
CompositeLine instance.public Edge getEdge()
Edge
this VisualEdge is associated with.
(1:n relationship between edges and VisualEdges)
Edge
this VisualEdge is associated with.Edgepublic VisualEdgeInfo getVisualEdgeInfo()
VisualEdgeInfo associated with this
VisualEdge.
VisualEdgeInfo associated with this
VisualEdge. The returned value may be null if no
info is associated with this VisualEdge.public void setVisualEdgeInfo(VisualEdgeInfo visualEdgeInfo)
VisualEdgeInfo associated with this
VisualEdge.
visualEdgeInfo - the VisualEdgeInfo to associate with this
VisualEdge.public VisualNode getVisualSource()
VisualNode at the source end of this
VisualEdge.
VisualNode at the start of this
VisualEdge.VisualNodepublic VisualNode getVisualTarget()
VisualNode at the target end of this
VisualEdge.
VisualNode at the end of this
VisualEdge.VisualNodepublic VisualPort getVisualSourcePort()
VisualPort VisualPort at the source end of
this instance. The field may be null if the VisualEdge is
currently detached.
VisualPortpublic VisualPort getVisualTargetPort()
VisualPort VisualPort at the target-end of
this instance. The field may be null if the VisualEdge is
currently detached.
VisualPortpublic void addVisualEdgeListener(VisualEdgeListener listener)
VisualEdgeListener to this
VisualEdge.
listener - the VisualEdgeListener
to add to this VisualEdge.public void removeVisualEdgeListener(VisualEdgeListener listener)
VisualEdgeListener from this
VisualEdge.
listener - the VisualEdgeListener
to remove from this VisualEdge.
public void updatePosition(boolean updatesource,
boolean updatetarget)
VisualEdge
instance according to the ports it is connected to.
If this VisualEdge is not connected to a
VisualPort then invoking the method will not trigger
and action.
updatesource - flag about whether to update the source-end
of this VisualEdge.updatetarget - flag about whether to update the target-end
of this VisualEdge.public void updatePosition()
VisualEdge
instance according to the ports it is connected to.
If this VisualEdge is not connected to a
VisualPort then invoking the method will not trigger
and action.
public boolean isDetached()
true if this VisualEdge has been
manipulated so that it is detached. This condition is only true
if at least one end of the edge was previously connected and is
not connected right now anymore.
isDetached in interface LayoutableEdgetrue if this VisualEdge has been
manipulated so that it is detached.
public VisualEdge deepCopy(Edge edge,
VisualNode visualsource,
VisualNode visualtarget,
VisualPort visualsourceport,
VisualPort visualtargetport)
VisualEdge.
edge - model-edge to refer to.visualsource - the VisualNode that is the source of the
copied VisualEdge.visualtarget - the VisualNode that is the target of the
copied VisualEdge.visualsourceport - the source VisualPort of the
VisualEdge.visualtargetport - the target VisualPort of the
VisualEdge.
Edge,
VisualNode,
VisualPort
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||