|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.view.DropSupport.EdgeSplitSupport
public static class DropSupport.EdgeSplitSupport
Handles edge splitting on node drops if
edge splitting is enabled
.
Constructor Summary | |
---|---|
DropSupport.EdgeSplitSupport()
Initializes a new EdgeSplitSupport instance. |
Method Summary | |
---|---|
protected void |
drawSplitEdgeIndicator(java.awt.Graphics2D gfx,
EdgeRealizer realizer,
YPoint split)
Paints the split edge indicator
during node drag operations. |
protected void |
edgeChanged(Graph2D graph,
Edge edge,
Node newNode)
Notifies interested parties that an edge has been changed as part of splitting an edge after a node drop. |
protected void |
edgeCreated(Graph2D graph,
Edge edge,
Node newNode)
Notifies interested parties that a new edge has been created as part of splitting an edge after a node drop. |
protected int |
findSplitEdgeSegment(EdgeRealizer er,
YPoint split)
Determines the edge segment that should be split when a new node is dropped at the specified split location. |
protected Edge |
getSplitEdge(Graph2DView view,
YPoint split)
Determines whether or not there is an edge that should be split on a node drop at the specified split location in the specified view. |
protected java.awt.Rectangle |
getSplitEdgeIndicatorBounds(EdgeRealizer realizer,
YPoint split)
Calculates the bounds of the split edge indicator during node drag
operations. |
boolean |
isIndicatingSplitEdge()
Determines whether or not edges that will be split on a node drop are highlighted during node drag operations. |
boolean |
isRemovingInnerBends()
Determines whether or not bends inside the new node that triggered edge splitting should be removed from the changed and the created edges. |
protected void |
removeInnerBends(Graph2D graph,
Edge edge,
Node newNode)
Removes bends that lie inside the specified new node from the specified edge. |
void |
setIndicatingSplitEdge(boolean enabled)
Specifies whether or not edges that will be split on a node drop are highlighted during node drag operations. |
void |
setRemovingInnerBends(boolean enabled)
Specifies whether or not bends inside the new node that triggered edge splitting should be removed from the changed and the created edges. |
protected boolean |
shouldRemoveInnerBends(Graph2D graph,
Edge edge,
Node newNode)
Determines whether or not bends inside the specified new node should be removed from the specified edge. |
protected void |
splitEdge(Graph2D graph,
Edge edge,
YPoint split,
Node newNode)
Splits the specified edge at the specified split location. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DropSupport.EdgeSplitSupport()
EdgeSplitSupport
instance.
Method Detail |
---|
protected void drawSplitEdgeIndicator(java.awt.Graphics2D gfx, EdgeRealizer realizer, YPoint split)
split edge indicator
during node drag operations.
Client code that overrides this method to draw a custom indicator should
also override getSplitEdgeIndicatorBounds(EdgeRealizer, YPoint)
accordingly.
gfx
- the graphics context to paint upon.realizer
- the realizer to highlight.split
- the location of the desired split point.protected java.awt.Rectangle getSplitEdgeIndicatorBounds(EdgeRealizer realizer, YPoint split)
split edge indicator
during node drag
operations.
Client code that overrides
drawSplitEdgeIndicator(java.awt.Graphics2D, EdgeRealizer, YPoint)
should also override this method accordingly.
realizer
- The realizer to highlight.split
- the location of the desired split point.
public boolean isIndicatingSplitEdge()
Defaults to true
.
true
if edges that will be split on a node drop are
highlighted during node drag operations; false
otherwise.setIndicatingSplitEdge(boolean)
,
drawSplitEdgeIndicator(java.awt.Graphics2D, EdgeRealizer, YPoint)
,
getSplitEdgeIndicatorBounds(EdgeRealizer, YPoint)
public void setIndicatingSplitEdge(boolean enabled)
Defaults to true
.
enabled
- if true
edges that will be split on a node
drop are highlighted during node drag operations.isIndicatingSplitEdge()
,
drawSplitEdgeIndicator(java.awt.Graphics2D, EdgeRealizer, YPoint)
,
getSplitEdgeIndicatorBounds(EdgeRealizer, YPoint)
protected Edge getSplitEdge(Graph2DView view, YPoint split)
view
- the over which a node is dragged.split
- the location of the desired split point.
Edge
instance to split or null
if there is
no edge to split at the specified coordinates.DropSupport.isEdgeSplittingEnabled()
,
DropSupport.setEdgeSplittingEnabled(boolean)
,
splitEdge(Graph2D, y.base.Edge, YPoint, y.base.Node)
protected void splitEdge(Graph2D graph, Edge edge, YPoint split, Node newNode)
graph
- the graph holding the specified edge and node.edge
- the edge that has to be split.split
- the location of the desired split point.newNode
- the node that should split the specified edge.DropSupport.isEdgeSplittingEnabled()
,
DropSupport.setEdgeSplittingEnabled(boolean)
,
getSplitEdge(Graph2DView, YPoint)
,
findSplitEdgeSegment(EdgeRealizer, YPoint)
protected int findSplitEdgeSegment(EdgeRealizer er, YPoint split)
splitEdge(Graph2D, y.base.Edge, YPoint, y.base.Node)
.
er
- the visual representation of the edge that is split.split
- the location of the desired split point.
0
-based index of the edge segment to be split or
-1
if no such segment could be determined.protected void edgeChanged(Graph2D graph, Edge edge, Node newNode)
splitEdge(Graph2D, y.base.Edge, YPoint, y.base.Node)
.
The default implementation removes inner bends if
bend removal is enabled
and
inner
bends should be removed
from the specified edge.
graph
- the graph holding the specified edge and node.edge
- the edge that has been changed.newNode
- the node that was created by the drop operation and has
replaced either the source or target node of the specified edge.shouldRemoveInnerBends(Graph2D, y.base.Edge, y.base.Node)
,
removeInnerBends(Graph2D, y.base.Edge, y.base.Node)
protected void edgeCreated(Graph2D graph, Edge edge, Node newNode)
splitEdge(Graph2D, y.base.Edge, YPoint, y.base.Node)
.
The default implementation removes inner bends if
bend removal is enabled
and
inner
bends should be removed
from the specified edge.
graph
- the graph holding the specified edge and node.edge
- the edge that has been created.newNode
- the node that was created by the drop operation and is
either the source or target node of the specified edge.shouldRemoveInnerBends(Graph2D, y.base.Edge, y.base.Node)
,
removeInnerBends(Graph2D, y.base.Edge, y.base.Node)
public boolean isRemovingInnerBends()
Defaults to false
.
true
if bends inside the new node should be removed;
false
otherwise.setRemovingInnerBends(boolean)
,
shouldRemoveInnerBends(Graph2D, y.base.Edge, y.base.Node)
,
removeInnerBends(Graph2D, y.base.Edge, y.base.Node)
public void setRemovingInnerBends(boolean enabled)
Defaults to false
.
enabled
- if true
bends inside the new node should are
removed.isRemovingInnerBends()
,
shouldRemoveInnerBends(Graph2D, y.base.Edge, y.base.Node)
,
removeInnerBends(Graph2D, y.base.Edge, y.base.Node)
protected boolean shouldRemoveInnerBends(Graph2D graph, Edge edge, Node newNode)
edgeChanged(Graph2D, y.base.Edge, y.base.Node)
and edgeCreated(Graph2D, y.base.Edge, y.base.Node)
.
The default implementation checks if the
given edge is visualized using either PolyLineEdgeRealizer
,
PolyLinePathCalculator
, or SmoothBendsPathCalculator
.
graph
- the graph holding the specified edge and node.edge
- the edge from which bends will be removed.newNode
- the node that was created by the drop operation.
true
if bends inside the specified new node should be
removed from the specified edge; false
otherwise.removeInnerBends(Graph2D, y.base.Edge, y.base.Node)
protected void removeInnerBends(Graph2D graph, Edge edge, Node newNode)
graph
- the graph holding the specified edge and node.edge
- the edge from which bends will be removed.newNode
- the node that was created by the drop operation.shouldRemoveInnerBends(Graph2D, y.base.Edge, y.base.Node)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |