|
||||||||||
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 | +--y.layout.hierarchic.HierarchicGroupLayouter
This class is an extended variant of the HierarchicLayouter class. It is capable of layouting nested groups of nodes as well as the group nodes themselves. The grouping information is provided through DataProvider instances, which are registered with the LayoutGraph instance. The layout is being calculated recursively. The size of the group nodes is determined by the area occupied by the children of the group node.
Here is a sample output of the algorithm.
Field Summary |
Fields inherited from class y.layout.hierarchic.HierarchicLayouter |
LAYERING_BFS, LAYERING_FROM_SKETCH, LAYERING_HIERARCHICAL_DOWNSHIFT, LAYERING_HIERARCHICAL_OPTIMAL, LAYERING_HIERARCHICAL_TIGHT_TREE, LAYERING_HIERARCHICAL_TOPMOST, LAYERING_USER_DEFINED, LINEAR_SEGMENTS, MEDIAN_SIMPLEX, PENDULUM, POLYLINE, ROUTE_ORTHOGONAL, ROUTE_POLYLINE, SIMPLEX, TREE |
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 | |
HierarchicGroupLayouter()
Creates a new instance of HierarchicGroupLayouter |
Method Summary | |
boolean |
canLayoutCore(LayoutGraph graph)
Always returns true. |
void |
doLayout(LayoutGraph graph)
Calculates a layout for the given graph. |
void |
doLayoutCore(LayoutGraph g)
Layout the given graph. |
Drawer |
getDrawer()
Returns the drawer which is responsible for the third phase of the algorithm |
GroupBoundsCalculator |
getGroupBoundsCalculator()
Gets the current GroupBoundsCalculator instance. |
protected Grouping |
getGrouping()
Getter for property grouping. |
Layerer |
getLayerer()
Returns the currently set Layerer, which is responsible for the first phase of the algorithm. |
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. |
boolean |
isGlobalSequencingActive()
Returns the current strategy for the node sequencing. |
boolean |
isStrongPortsScalingActive()
Gets the property strongPortsScalingActive. |
protected Rectangle2D |
layoutLevel(Node root,
NodeList levelNodes,
boolean buildGraphsOnly)
Layouts the children of root recursively. |
void |
setDrawer(Drawer drawer)
Sets the drawer which is responsible for the third phase of the algorithm. |
void |
setGlobalSequencingActive(boolean globalSequencingActive)
Determines whether a global sequencing heuristic should be used. |
void |
setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
Sets the GroupBoundsCalculator instance. |
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 |
setStrongPortsScalingActive(boolean strongPortsScalingActive)
Sets the property strongPortsScalingActive. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HierarchicGroupLayouter()
Method Detail |
protected Grouping getGrouping()
public boolean canLayoutCore(LayoutGraph graph)
canLayoutCore
in class HierarchicLayouter
public void doLayoutCore(LayoutGraph g)
doLayoutCore
in class HierarchicLayouter
protected Rectangle2D layoutLevel(Node root, NodeList levelNodes, boolean buildGraphsOnly)
root
- The current root node (parent, invisible during layout)levelNodes
- The nodes to be laid out
public void doLayout(LayoutGraph graph)
CanonicMultiStageLayouter
doLayout
in interface Layouter
doLayout
in class CanonicMultiStageLayouter
public void setLayerSequencer(LayerSequencer sequencer)
HierarchicLayouter
setLayerSequencer
in class HierarchicLayouter
public void setLayerer(Layerer layerer)
HierarchicLayouter
setLayerer
in class HierarchicLayouter
public Layerer getLayerer()
HierarchicLayouter
getLayerer
in class HierarchicLayouter
public LayerSequencer getLayerSequencer()
HierarchicLayouter
getLayerSequencer
in class HierarchicLayouter
public GroupBoundsCalculator getGroupBoundsCalculator()
public void setGroupBoundsCalculator(GroupBoundsCalculator groupBoundsCalculator)
groupBoundsCalculator
- New GroupBoundsCalculator instance.public void setDrawer(Drawer drawer)
setDrawer
in class HierarchicLayouter
public Drawer getDrawer()
getDrawer
in class HierarchicLayouter
public void setLayoutStyle(byte style)
HierarchicLayouter
HierarchicLayouter.POLYLINE
, HierarchicLayouter.LINEAR_SEGMENTS
, HierarchicLayouter.MEDIAN_SIMPLEX
,
HierarchicLayouter.SIMPLEX
, HierarchicLayouter.PENDULUM
,
and HierarchicLayouter.TREE
.
The default is set to HierarchicLayouter.LINEAR_SEGMENTS
setLayoutStyle
in class HierarchicLayouter
public void setLayeringStrategy(byte strategy)
HierarchicLayouter
By default the layering strategy HierarchicLayouter.LAYERING_HIERARCHICAL_TIGHT_TREE
is set.
setLayeringStrategy
in class HierarchicLayouter
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 boolean isStrongPortsScalingActive()
true
.
public void setStrongPortsScalingActive(boolean strongPortsScalingActive)
true
.
strongPortsScalingActive
- the new value of the property.protected NodeList[] getLayerSequence(LayoutGraph g, NodeMap LAYER_KEY, int maxLayer)
HierarchicLayouter
getLayerSequence
in class HierarchicLayouter
public boolean isGlobalSequencingActive()
public void setGlobalSequencingActive(boolean globalSequencingActive)
globalSequencingActive
- the new value.
|
© 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 |