|
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.ParallelEdgeLayouter
public class ParallelEdgeLayouter
A layout algorithm that routes parallel edges (edges that connect the same pair of nodes) of a graph.
A core layout algorithm can be specified for this class. In that case the performed layout process of this class is subdivided into four stages:
Field Summary | |
---|---|
protected EdgeList |
hiddenEdges
Holds the list of parallel edges that are hidden from the core layouter. |
static Object |
LEADING_EDGE_DPKEY
A DataProvider key that can be used to specify which parallel edge should be used
as leading edge, i.e., as the edge whose layout is used to obtain the layout of the corresponding parallel edges. |
protected double |
lineDistance
Holds the line distance assigned between parallel edges. |
EdgeMap |
parallelEdges
EdgeMap that associates a hidden edge with the unique parallel edge not hidden from the core layouter. |
static Object |
SCOPE_DPKEY
A DataProvider key that can be used to tell the stage whether edges should be included in
or excluded from the calculation. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
ParallelEdgeLayouter()
Creates a new instance of ParallelEdgeLayouter with no core layouter assigned. |
|
ParallelEdgeLayouter(Layouter coreLayouter)
Creates a new instance of ParallelEdgeLayouter for the given core layouter. |
Method Summary | |
---|---|
boolean |
canLayout(LayoutGraph graph)
Returns true iff the given graph can be laid
out by this algorithm. |
void |
doLayout(LayoutGraph graph)
Main layout routine that assigns new layout information to the given graph. |
protected void |
findAndHideParallelEdges(Graph graph)
This method detects parallel edges of the given graph. |
double |
getAbsJoinEndDistance()
Gets the absolute distance from the end point of the lines to the first parallel segments if end joining is enabled. |
double |
getLineDistance()
Returns the distance between two adjacent paths that run in parallel. |
double |
getRelJoinEndDistance()
Returns the relative distance from the end point of the lines to the first parallel segments if end joining is enabled. |
boolean |
isDirectedModeEnabled()
Returns whether or not edges should be considered as directed. |
boolean |
isJoinEndsEnabled()
Returns the state of the automatic end joining mechanism, i.e. if all lines should end at the same point. |
boolean |
isLeadingEdgeAdjustmentEnabled()
Returns whether this layouter will adjust the leading edge if the number of edges is even. |
boolean |
isUsingAdaptiveLineDistances()
Whether or not the line distances between parallel edges should be determined according to the nodes' bounds. |
protected void |
layoutParallelEdges(LayoutGraph graph,
EdgeMap parallelEdges)
This method assigns a layout to parallel edges. |
void |
setAbsJoinEndDistance(double absJoinEndDistance)
Sets the absolute distance from the end point of the lines to the first parallel segments if end joining is enabled. |
void |
setDirectedModeEnabled(boolean directedModeEnabled)
Sets whether or not edges should be considered as directed. |
void |
setJoinEndsEnabled(boolean joinEndsEnabled)
Specifies whether or not to join end points of parallel edges. |
void |
setLeadingEdgeAdjustmentEnabled(boolean leadingEdgeAdjustmentEnabled)
Specifies whether this layouter will adjust the leading edge if the number of edges is even. |
void |
setLineDistance(double distance)
Sets the distance between two adjacent paths that run in parallel. |
void |
setRelJoinEndDistance(double relJoinEndDistance)
Sets the relative distance from the end point of the lines to the first parallel segments if end joining is enabled. |
void |
setUsingAdaptiveLineDistances(boolean usingAdaptiveLineDistances)
Whether or not the line distances between parallel edges should be determined according to the nodes' bounds. |
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 SCOPE_DPKEY
DataProvider
key that can be used to tell the stage whether edges should be included in
or excluded from the calculation. For every Edge
instance the provider
should yield boolean
values to indicate whether an
edge should be laid out.
If no data provider is registered for the given key, all edges wil be laid out.
public static final Object LEADING_EDGE_DPKEY
DataProvider
key that can be used to specify which parallel edge should be used
as leading edge, i.e., as the edge whose layout is used to obtain the layout of the corresponding parallel edges.
For every Edge
instance the provider should yield boolean
values
to indicate whether an edge is a leading edge.
protected EdgeList hiddenEdges
public EdgeMap parallelEdges
protected double lineDistance
Constructor Detail |
---|
public ParallelEdgeLayouter(Layouter coreLayouter)
AbstractLayoutStage.setCoreLayouter(Layouter)
public ParallelEdgeLayouter()
Method Detail |
---|
public boolean isDirectedModeEnabled()
setDirectedModeEnabled(boolean)
public void setDirectedModeEnabled(boolean directedModeEnabled)
public boolean isUsingAdaptiveLineDistances()
setUsingAdaptiveLineDistances(boolean)
public void setUsingAdaptiveLineDistances(boolean usingAdaptiveLineDistances)
usingAdaptiveLineDistances
- whether the line distance should be determined according to the nodes' bounds.public void setLineDistance(double distance)
setUsingAdaptiveLineDistances(boolean)
) the real distance may
be less than the given line distance.
public double getLineDistance()
public void doLayout(LayoutGraph graph)
Layouter
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
.
protected void layoutParallelEdges(LayoutGraph graph, EdgeMap parallelEdges)
protected void findAndHideParallelEdges(Graph graph)
public boolean isJoinEndsEnabled()
public void setJoinEndsEnabled(boolean joinEndsEnabled)
joinEndsEnabled
- if joining of the ends should be enabled.public double getAbsJoinEndDistance()
public void setAbsJoinEndDistance(double absJoinEndDistance)
absJoinEndDistance
- the new value.public double getRelJoinEndDistance()
public void setRelJoinEndDistance(double relJoinEndDistance)
relJoinEndDistance
- the new relative value.public boolean isLeadingEdgeAdjustmentEnabled()
public void setLeadingEdgeAdjustmentEnabled(boolean leadingEdgeAdjustmentEnabled)
leadingEdgeAdjustmentEnabled
- whether to enable the adjustment
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |