|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.layout.CanonicMultiStageLayouter | +--y.layout.hierarchic.HierarchicLayouter
This class implements a layouter for drawing directed graphs in a hierarchic way.
This layouter places nodes in different horizontal layers, in such a way that most edges in the graph run from top to bottom.
Here is an sample output of the layouter using top to bottom
orientation and HierarchicLayouter.PENDULUM
layout style.
HierarchicLayouter is a layouter that can handle port constraints.
See classes PortConstraint
and PortConstraintKeys
on how
to setup port constraint information for this layouter.
HierarchicLayouter can consider edge label data when laying out a graph.
That means that the the layout of edge labels will be part of the resulting
layout and the layout of nodes and edges is chosen in such a way that the
edge labels do not conflict with the rest of the layout.
See classes LabelLayoutData
, LabelLayoutConstants
LabelLayoutKeys
and LabelLayoutTranslator
on how
to setup the integrated edge label layout feature.
Field Summary | |
static byte |
LAYERING_BFS
Layering strategy specifier. |
static byte |
LAYERING_FROM_SKETCH
Layering strategy specifier. |
static byte |
LAYERING_HIERARCHICAL_DOWNSHIFT
Layering strategy specifier. |
static byte |
LAYERING_HIERARCHICAL_OPTIMAL
Layering strategy specifier. |
static byte |
LAYERING_HIERARCHICAL_TIGHT_TREE
Layering strategy specifier. |
static byte |
LAYERING_HIERARCHICAL_TOPMOST
Layering strategy specifier. |
static byte |
LAYERING_USER_DEFINED
Layering strategy specifier. |
static byte |
LINEAR_SEGMENTS
Layout style specifier. |
static byte |
MEDIAN_SIMPLEX
Layout style specifier. |
static byte |
PENDULUM
Layout style specifier. |
static byte |
POLYLINE
Layout style specifier. |
static byte |
ROUTE_ORTHOGONAL
Edge routing style specifier. |
static byte |
ROUTE_POLYLINE
Edge routing style specifier. |
static byte |
SIMPLEX
Layout style specifier. |
static byte |
TREE
Layout style specifier. |
Fields inherited from interface y.layout.PortConstraintKeys |
SOURCE_GROUPID_KEY, SOURCE_PORT_CONSTRAINT_KEY, TARGET_GROUPID_KEY, TARGET_PORT_CONSTRAINT_KEY |
Fields inherited from interface y.layout.Layouter |
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
HierarchicLayouter()
Instantiates a new HierarchicLayouter. |
Method Summary | |
boolean |
canLayoutCore(LayoutGraph graph)
Always returns true. |
void |
disposeMementoSupport()
Disposes the memento support if it is existent, i.e. if it has been queried before by getMementoSupport() |
void |
doLayoutCore(LayoutGraph g)
Layout the given graph. |
int |
getBendReductionThreshold()
Returns the limit, when bends are removed and a straight line is drawn instead. |
Drawer |
getDrawer()
Returns the drawer which is responsible for the third phase of the algorithm |
Layerer |
getLayerer()
Returns the currently set Layerer, which is responsible for the first phase of the algorithm. |
byte |
getLayeringStrategy()
Returns the currently set layering strategy. |
protected NodeList[] |
getLayerSequence(LayoutGraph g,
NodeMap LAYER_KEY,
int maxLayer)
Determines the order of the nodes within their layers. |
LayerSequencer |
getLayerSequencer()
Returns the currently set LayerSequencer, which is responsible for the second phase of the algorithm. |
byte |
getLayoutStyle()
Returns the currently set layout style or -1
if the style cannot be
determined |
long |
getMaximalDuration()
Returns a time limit for the algorithm in milliseconds |
MementoSupport |
getMementoSupport()
Gets the cookie for the memento support of the hierarchich layout algorithm. |
double |
getMinimalEdgeDistance()
Returns the minimal distance between edges that run in parallel. |
double |
getMinimalFirstSegmentLength()
Returns the minimal length of first and last edge segments for edge routing. |
double |
getMinimalLayerDistance()
Returns the minimal distance between two layers. |
double |
getMinimalNodeDistance()
Returns the minimal distance between two nodes in the same layer. |
boolean |
getRemoveFalseCrossings()
Whether or not false crossings should be removed from the layout. |
byte |
getRoutingStyle()
Returns the routing style being used. |
void |
setBendReductionThreshold(int t)
Sets the limit, when bends are removed and a straight line is drawn instead. |
void |
setDrawer(Drawer drawer)
Sets the drawer which is responsible for the third phase of the algorithm. |
void |
setLayerer(Layerer layerer)
Sets the Layerer, which is responsible for the first phase of the algorithm. |
void |
setLayeringStrategy(byte strategy)
Sets a predefined layering strategy. |
void |
setLayerSequencer(LayerSequencer sequencer)
Sets the LayerSequencer, which is responsible for the second phase of the algorithm. |
void |
setLayoutStyle(byte style)
Sets the layout style for this layouter. |
void |
setMaximalDuration(long msec)
Sets a time limit for the algorithm in milliseconds |
void |
setMinimalEdgeDistance(double d)
Sets the minimal distance between edges that run in parallel. |
void |
setMinimalFirstSegmentLength(double minimalFirstSegmentLength)
Sets the minimal length of first and last edge segments for edge routing. |
void |
setMinimalLayerDistance(double d)
Sets the minimal distance between two layers. |
void |
setMinimalNodeDistance(double d)
Sets the minimal distance between two nodes in the same layer. |
void |
setRemoveFalseCrossings(boolean b)
Whether or not false crossings should be removed from the layout. |
void |
setRoutingStyle(byte style)
Sets the edge routing style. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte PENDULUM
Note that this layout style is more time consuming than the other ones.
public static final byte LINEAR_SEGMENTS
public static final byte POLYLINE
public static final byte TREE
public static final byte SIMPLEX
public static final byte MEDIAN_SIMPLEX
public static final byte ROUTE_POLYLINE
public static final byte ROUTE_ORTHOGONAL
public static final byte LAYERING_HIERARCHICAL_TOPMOST
HierarchicLayouter.setLayeringStrategy(byte)
,
Constant Field Valuespublic static final byte LAYERING_HIERARCHICAL_OPTIMAL
HierarchicLayouter.setLayeringStrategy(byte)
,
Constant Field Valuespublic static final byte LAYERING_HIERARCHICAL_TIGHT_TREE
HierarchicLayouter.LAYERING_HIERARCHICAL_OPTIMAL
.
HierarchicLayouter.setLayeringStrategy(byte)
,
Constant Field Valuespublic static final byte LAYERING_HIERARCHICAL_DOWNSHIFT
HierarchicLayouter.LAYERING_HIERARCHICAL_TOPMOST
by down shifting
some nodes in the layering. The quality is usually worse than the
one produced by Tight Tree Heuristic.
HierarchicLayouter.setLayeringStrategy(byte)
,
Constant Field Valuespublic static final byte LAYERING_BFS
BFSLayerer.CORE_NODES
.
If this dataprovider is not given, then nodes that have no incoming edges are placed
in the first layer.
HierarchicLayouter.setLayeringStrategy(byte)
,
Constant Field Valuespublic static final byte LAYERING_FROM_SKETCH
HierarchicLayouter.setLayeringStrategy(byte)
,
Constant Field Valuespublic static final byte LAYERING_USER_DEFINED
GivenLayersLayerer.LAYER_ID_KEY
. Like
HierarchicLayouter.LAYERING_FROM_SKETCH
this layering allows inner layer edges.
HierarchicLayouter.setLayeringStrategy(byte)
,
Constant Field ValuesConstructor Detail |
public HierarchicLayouter()
Method Detail |
public void setRoutingStyle(byte style)
HierarchicLayouter.ROUTE_POLYLINE
and HierarchicLayouter.ROUTE_ORTHOGONAL
.
By default HierarchicLayouter.ROUTE_POLYLINE
is set.
public byte getRoutingStyle()
HierarchicLayouter.setRoutingStyle(byte)
public void setLayoutStyle(byte style)
HierarchicLayouter.POLYLINE
, HierarchicLayouter.LINEAR_SEGMENTS
, HierarchicLayouter.MEDIAN_SIMPLEX
,
HierarchicLayouter.SIMPLEX
, HierarchicLayouter.PENDULUM
,
and HierarchicLayouter.TREE
.
The default is set to HierarchicLayouter.LINEAR_SEGMENTS
public byte getLayoutStyle()
-1
if the style cannot be
determined
public void setLayeringStrategy(byte strategy)
By default the layering strategy HierarchicLayouter.LAYERING_HIERARCHICAL_TIGHT_TREE
is set.
strategy
- one of
HierarchicLayouter.LAYERING_HIERARCHICAL_TOPMOST
, HierarchicLayouter.LAYERING_HIERARCHICAL_DOWNSHIFT
,
HierarchicLayouter.LAYERING_HIERARCHICAL_TIGHT_TREE
, HierarchicLayouter.LAYERING_HIERARCHICAL_OPTIMAL
,
HierarchicLayouter.LAYERING_FROM_SKETCH
, HierarchicLayouter.LAYERING_USER_DEFINED
or
HierarchicLayouter.LAYERING_BFS
.public byte getLayeringStrategy()
public void setLayerer(Layerer layerer)
public Layerer getLayerer()
public void setLayerSequencer(LayerSequencer sequencer)
public LayerSequencer getLayerSequencer()
public void setDrawer(Drawer drawer)
public Drawer getDrawer()
public void setMinimalNodeDistance(double d)
public double getMinimalNodeDistance()
public void setMinimalEdgeDistance(double d)
public double getMinimalEdgeDistance()
public void setMinimalLayerDistance(double d)
public double getMinimalLayerDistance()
public double getMinimalFirstSegmentLength()
public void setMinimalFirstSegmentLength(double minimalFirstSegmentLength)
minimalFirstSegmentLength
- the new minimal length of first and last
edge segmentspublic void setRemoveFalseCrossings(boolean b)
public boolean getRemoveFalseCrossings()
public void setMaximalDuration(long msec)
public long getMaximalDuration()
public void setBendReductionThreshold(int t)
public int getBendReductionThreshold()
public boolean canLayoutCore(LayoutGraph graph)
canLayoutCore
in class CanonicMultiStageLayouter
public void doLayoutCore(LayoutGraph g)
doLayoutCore
in class CanonicMultiStageLayouter
protected NodeList[] getLayerSequence(LayoutGraph g, NodeMap LAYER_KEY, int maxLayer)
public MementoSupport getMementoSupport()
public void disposeMementoSupport()
getMementoSupport()
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |