|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.AbstractLayoutStage y.layout.router.ChannelEdgeRouter
public class ChannelEdgeRouter
This class represents an edge router. It combines two strategic steps of edge routing and executes them after each
other. The first strategy is called path finder strategy and will route the edges, potentially with edge overlaps.
The second strategy will then split overlapping edge segments inside their channels and distribute them according to
the specific distribution strategy.
For path finding strategies you can for example use ChannelEdgeRouter.OrthogonalShortestPathPathFinder
or
OrthogonalPatternEdgeRouter
. By default the latter will be used.
One possible implementation of an edge distribution strategy is
OrthogonalSegmentDistributionStage
, which is also used by default.
Note: when exchanging only one of the strategies, make sure, that their algorithms will use the same (sub)set
of graph objects. The strategies bound to this router by default will use key AFFECTED_EDGES
to determine
the affected edges.
Nested Class Summary | |
---|---|
static class |
ChannelEdgeRouter.OrthogonalShortestPathPathFinder
This layouter is a s special version of OrthogonalEdgeRouter that can be used as a path
finding strategy in ChannelEdgeRouter . |
Field Summary | |
---|---|
static Object |
AFFECTED_EDGES
This field is used as the key to add a DataProvider to the graph, which specifies the edges, that are affected by the edge routing. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
ChannelEdgeRouter()
|
Method Summary | |
---|---|
boolean |
canLayout(LayoutGraph graph)
Returns true iff the given graph can be laid
out by this algorithm. |
protected void |
checkGroupNodeSize(GraphLayout layout,
Object node)
This method throws an IllegalArgumentException if the width/height of the given group node object is zero. |
protected void |
checkNodeSize(GraphLayout layout,
Object node)
This method throws an IllegalArgumentException if the width/height of the given node object is zero. |
void |
doLayout(LayoutGraph graph)
Main layout routine that assigns new layout information to the given graph. |
Layouter |
getEdgeDistributionStrategy()
Returns the currently used edge distribution strategy of this router. |
Layouter |
getPathFinderStrategy()
Returns the currently used path finder strategy of this router. |
void |
setEdgeDistributionStrategy(Layouter edgeDistributionStrategy)
Sets the strategy with which overlapping edge segments will be distributed in their provided channel. |
void |
setPathFinderStrategy(Layouter pathFinderStrategy)
Sets the strategy for path finding. |
Methods inherited from class y.layout.AbstractLayoutStage |
---|
canLayoutCore, doLayoutCore, getCoreLayouter, setCoreLayouter |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object AFFECTED_EDGES
Constructor Detail |
---|
public ChannelEdgeRouter()
Method Detail |
---|
public boolean canLayout(LayoutGraph graph)
Layouter
true
iff the given graph can be laid
out by this algorithm. Calling doLayout
with
the given graph as its argument will only success if
this method returns true
.
public void doLayout(LayoutGraph graph)
Layouter
protected void checkNodeSize(GraphLayout layout, Object node) throws IllegalArgumentException
IllegalArgumentException
if the width/height of the given node object is zero.
It is called by the doLayout(LayoutGraph)
method for each node object in the input graph.
IllegalArgumentException
- thrown if the width/height of the node object is zero.layout
- a graph layout object.node
- the node object to test.checkGroupNodeSize(GraphLayout,Object)
protected void checkGroupNodeSize(GraphLayout layout, Object node) throws IllegalArgumentException
IllegalArgumentException
if the width/height of the given group node object is zero.
It is called by the doLayout(LayoutGraph)
method for each group node object in the input graph.
IllegalArgumentException
- thrown if the width/height of the group node object is zero.layout
- a graph layout object.node
- the group node object to test.checkNodeSize(GraphLayout,Object)
public void setPathFinderStrategy(Layouter pathFinderStrategy)
AFFECTED_EDGES
to determine the
affected edges.
pathFinderStrategy
- the path finding strategy that should be set.public void setEdgeDistributionStrategy(Layouter edgeDistributionStrategy)
AFFECTED_EDGES
to determine the
affected edges.
edgeDistributionStrategy
- the distribution strategy to be set.public Layouter getPathFinderStrategy()
public Layouter getEdgeDistributionStrategy()
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |