|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.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. |
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. |
| 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()
Gets 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 adjust the leading edge if the number of edges is even. |
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)
Enables automatic end joining. |
void |
setLeadingEdgeAdjustmentEnabled(boolean leadingEdgeAdjustmentEnabled)
Sets whether this layouter should 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. |
| 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 |
|---|
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 void setLineDistance(double distance)
public double getLineDistance()
public void doLayout(LayoutGraph graph)
Layouter
public boolean canLayout(LayoutGraph graph)
Layoutertrue iff the given graph can be laid
out by this algorithm. Calling doLayout with
the given graph as it's 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-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||