|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.NodeStateChangeEdgeRouter
public class NodeStateChangeEdgeRouter
Implementation of NodeStateChangeHandler
that adjusts the relative port offsets of edges to the state
before the open/close action.
In addition, this implementation can restore an orthogonal routing if the edge has been orthogonal before the group
action.
This implementation expects that the relative port offset of an edge that must be rerouted is not changed
between calls to preNodeStateChange(y.base.Node)
(y.base.Node)}/postNodeStateChange(y.base.Node)
.
isOrthogonalRouting(y.base.Edge,Graph2D)
Constructor Summary | |
---|---|
NodeStateChangeEdgeRouter()
|
Method Summary | |
---|---|
protected EdgeList |
getConvertableEdges(Node node)
Returns a list of edges that will be changed by this node state change. |
protected boolean |
hasChanged(Edge edge,
Node groupNode,
boolean atSource)
Checks whether the edge's source or target should be considered as changed through the state change. |
boolean |
isNodePortAware()
Returns true if this router resets source and target
NodePort s of inter edges and false otherwise. |
protected boolean |
isOrthogonalRouting(Edge e,
Graph2D g)
Determine whether an edge is orthogonal before the state change. |
protected void |
postEdgeStateChange(Edge edge,
Node groupNode)
Method to perform necessary actions after groupNode has changed its state. |
void |
postNodeStateChange(Node groupNode)
Performs actions before after the node state. |
protected void |
preEdgeStateChange(Edge edge,
Node groupNode)
Method to perform necessary actions before groupNode changes its state. |
void |
preNodeStateChange(Node groupNode)
Performs actions before changing the node state. |
void |
setNodePortAware(boolean aware)
Specifies whether or not this router may reset source and target NodePort s of inter edges. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NodeStateChangeEdgeRouter()
Method Detail |
---|
public boolean isNodePortAware()
true
if this router resets source and target
NodePort
s of inter edges and false
otherwise.
If this feature is enabled, the router stores the original source and
target NodePort
s of inter edges when closing group nodes
and resets the ports to the stored values when opening the corresponding
folder node.
This feature is enabled by default.
true
if this router resets source and target
NodePort
s of inter edges when closing group nodes or
opening folder nodes and false
otherwise.setNodePortAware(boolean)
,
HierarchyManager.isInterEdge(y.base.Edge)
public void setNodePortAware(boolean aware)
NodePort
s of inter edges.
If this feature is enabled, the router stores the original source and
target NodePort
s of inter edges when closing group nodes
and resets the ports to the stored values when opening the corresponding
folder node.
This feature is enabled by default.
aware
- if true
this router resets ports of inter edges.isNodePortAware()
,
HierarchyManager.isInterEdge(y.base.Edge)
public void preNodeStateChange(Node groupNode)
NodeStateChangeHandler
preNodeStateChange
in interface NodeStateChangeHandler
groupNode
- The group or folder node whose state is about to change.public void postNodeStateChange(Node groupNode)
NodeStateChangeHandler
NodeStateChangeHandler.preNodeStateChange(y.base.Node)
has been called
to change state related properties of the groupNode and/or its edges, as well as to clean up state that may have been
stored by NodeStateChangeHandler.preNodeStateChange(y.base.Node)
.
postNodeStateChange
in interface NodeStateChangeHandler
groupNode
- The group or folder node whose state has just changed.protected EdgeList getConvertableEdges(Node node)
node
- the node whose state will be changed.
protected void preEdgeStateChange(Edge edge, Node groupNode)
edge
- The edge to considergroupNode
- The node whose state is about to changeprotected void postEdgeStateChange(Edge edge, Node groupNode)
edge in relation to the group/folder
nodes bounds. In addition, the previous edge path is restored, and if this edge has been orthogonal before (as
determined by isOrthogonalRouting(y.base.Edge,Graph2D)
), orthogonality is restored.
- Parameters:
edge
- The edge to considergroupNode
- The node whose state has just changed
protected boolean isOrthogonalRouting(Edge e, Graph2D g)
postEdgeStateChange(y.base.Edge,y.base.Node)
to restore
orthogonality for e
.
e
- The edge to queryg
- The graph where this edge lives currently
true
iff this edge should be kept orthogonal.protected boolean hasChanged(Edge edge, Node groupNode, boolean atSource)
edge
- The edge to checkgroupNode
- The group or folder node whose state has been changedatSource
- specify whether to check the source or at the target.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |