|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.CanonicMultiStageLayouter y.layout.tree.TreeLayouter
public class TreeLayouter
Implementation of a layout algorithm for trees.
Here is an sample output of the layouter using left to right orientation andORTHOGONAL_STYLE
layout style.
Field Summary | |
---|---|
static int |
BORDER_CENTER_PORTS
Port style constant. |
static int |
BORDER_DISTRIBUTED_PORTS
Port style constant. |
static byte |
CHILD_PLACEMENT_POLICY_ALL_LEAVES_ON_SAME_LAYER
Symbolic child placement policy specifier. |
static byte |
CHILD_PLACEMENT_POLICY_LEAVES_STACKED
Symbolic child placement policy specifier. |
static byte |
CHILD_PLACEMENT_POLICY_LEAVES_STACKED_LEFT
Symbolic child placement policy specifier. |
static byte |
CHILD_PLACEMENT_POLICY_LEAVES_STACKED_LEFT_AND_RIGHT
Symbolic child placement policy specifier. |
static byte |
CHILD_PLACEMENT_POLICY_LEAVES_STACKED_RIGHT
Symbolic child placement policy specifier. |
static byte |
CHILD_PLACEMENT_POLICY_SIBLINGS_ON_SAME_LAYER
Symbolic child placement policy specifier. |
static int |
NODE_CENTER_PORTS
Port style constant. |
static int |
ORTHOGONAL_STYLE
Layout style constant. |
static int |
PLAIN_STYLE
Layout style constant. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
TreeLayouter()
Creates a new instance of TreeLayouter. |
Method Summary | |
---|---|
boolean |
canLayoutCore(LayoutGraph graph)
Returns true iff the core layouter can layout the given graph structure. |
void |
doLayoutCore(LayoutGraph graph)
Starts the tree layout process |
double |
getBusAlignment()
Returns the actual set bus alignment. |
byte |
getChildPlacementPolicy()
Returns the layout policy for leaf nodes. |
Comparator |
getComparator()
Returns the comparator for outgoing edges at a node This comparator defines the relative order of the child nodes in the layout to be calculated. |
int |
getLayoutStyle()
Returns the layout style of this layouter. |
double |
getMinimalLayerDistance()
Returns the minimal distance between adjacent layers for the layout. |
double |
getMinimalNodeDistance()
Returns the minimum horizontal distance between adjacent nodes for this layouter. |
AbstractRotatableNodePlacer.Matrix |
getModificationMatrix()
Return the modification matrix that is used to rotate / mirror the tree layout. |
int |
getPortStyle()
Gets the port assignment style. |
double |
getVerticalAlignment()
Returns the relative vertical alignment of nodes within their respective layers. |
boolean |
isEnforceGlobalLayering()
Returns whether or not global layering is enforced. |
boolean |
isGroupingSupported()
Returns true if grouping support is enabled. |
boolean |
isIntegratedEdgeLabelingEnabled()
Returns whether integrated edge labeling is enabled. |
boolean |
isIntegratedNodeLabelingEnabled()
Returns whether integrated node labeling is enabled. |
void |
setBusAlignment(double busAlignment)
Sets the vertical alignment of the bus |
void |
setChildPlacementPolicy(byte policy)
Sets the layout policy for leaf nodes. |
void |
setComparator(Comparator c)
Sets the comparator for outgoing edges at a node This comparator defines the relative order of the child nodes in the layout to be calculated. |
void |
setEnforceGlobalLayering(boolean enabled)
Specifies whether or not global layering is enforced. |
void |
setGroupingSupported(boolean groupingSupported)
Whether or not grouping support should be enabled. |
void |
setIntegratedEdgeLabelingEnabled(boolean integratedEdgeLabelingEnabled)
Sets whether integrated edge labeling is enabled |
void |
setIntegratedNodeLabelingEnabled(boolean integratedNodeLabelingEnabled)
Sets whether integrated node labeling is enabled |
void |
setLayoutStyle(int style)
Sets the layout style of this layouter. |
void |
setMinimalLayerDistance(double dist)
Sets the minimal distance between adjacent layers for the layout. |
void |
setMinimalNodeDistance(double dist)
Sets the minimum distance between adjacent nodes within a layer. |
void |
setModificationMatrix(AbstractRotatableNodePlacer.Matrix modificationMatrix)
Sets the modification matrix that is used to rotate / mirror the tree layout. |
void |
setPortStyle(int style)
Sets the port assignment style. |
void |
setVerticalAlignment(double verticalAlignment)
Sets the relative vertical alignment of nodes within their respective layers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NODE_CENTER_PORTS
setPortStyle(int)
,
Constant Field Valuespublic static final int BORDER_CENTER_PORTS
setPortStyle(int)
,
Constant Field Valuespublic static final int BORDER_DISTRIBUTED_PORTS
setPortStyle(int)
,
Constant Field Valuespublic static final int PLAIN_STYLE
getLayoutStyle()
,
setLayoutStyle(int)
,
Constant Field Valuespublic static final int ORTHOGONAL_STYLE
getLayoutStyle()
,
setLayoutStyle(int)
,
Constant Field Valuespublic static final byte CHILD_PLACEMENT_POLICY_LEAVES_STACKED
CHILD_PLACEMENT_POLICY_LEAVES_STACKED_RIGHT
or
CHILD_PLACEMENT_POLICY_LEAVES_STACKED_LEFT_AND_RIGHT
will be used
depending on the number of leaves in the subtree.
getChildPlacementPolicy()
,
setChildPlacementPolicy(byte)
,
Constant Field Valuespublic static final byte CHILD_PLACEMENT_POLICY_LEAVES_STACKED_LEFT
getChildPlacementPolicy()
,
setChildPlacementPolicy(byte)
,
Constant Field Valuespublic static final byte CHILD_PLACEMENT_POLICY_LEAVES_STACKED_RIGHT
getChildPlacementPolicy()
,
setChildPlacementPolicy(byte)
,
Constant Field Valuespublic static final byte CHILD_PLACEMENT_POLICY_LEAVES_STACKED_LEFT_AND_RIGHT
getChildPlacementPolicy()
,
setChildPlacementPolicy(byte)
,
Constant Field Valuespublic static final byte CHILD_PLACEMENT_POLICY_ALL_LEAVES_ON_SAME_LAYER
getChildPlacementPolicy()
,
setChildPlacementPolicy(byte)
,
Constant Field Valuespublic static final byte CHILD_PLACEMENT_POLICY_SIBLINGS_ON_SAME_LAYER
getChildPlacementPolicy()
,
setChildPlacementPolicy(byte)
,
Constant Field ValuesConstructor Detail |
---|
public TreeLayouter()
Method Detail |
---|
public boolean canLayoutCore(LayoutGraph graph)
canLayoutCore
in class CanonicMultiStageLayouter
public boolean isEnforceGlobalLayering()
Disabling this feature to generate more compact layouts will usually result in the algorithm ignoring the specified relative vertical alignment for nodes.
By default, this feature is enabled.
true
if global layering is enforced and
false
otherwise.setEnforceGlobalLayering(boolean)
public void setEnforceGlobalLayering(boolean enabled)
Disabling this feature to generate more compact layouts will usually result in the algorithm ignoring the specified relative vertical alignment for nodes.
By default, this feature is enabled.
enabled
- if true
global layering is enforced.isEnforceGlobalLayering()
,
getVerticalAlignment()
,
setVerticalAlignment(double)
public byte getChildPlacementPolicy()
Defaults to CHILD_PLACEMENT_POLICY_SIBLINGS_ON_SAME_LAYER
.
setChildPlacementPolicy(byte)
public void setChildPlacementPolicy(byte policy)
Defaults to CHILD_PLACEMENT_POLICY_SIBLINGS_ON_SAME_LAYER
.
IllegalArgumentException
- if the specified policy does not match one of the leaf layout policy constants.policy
- one of
getChildPlacementPolicy()
public boolean isGroupingSupported()
public void setGroupingSupported(boolean groupingSupported)
groupingSupported
- if true, grouping support is enabled.public void doLayoutCore(LayoutGraph graph)
doLayoutCore
in class CanonicMultiStageLayouter
public void setComparator(Comparator c)
XCoordComparator
is set.
public Comparator getComparator()
public void setPortStyle(int style)
style
- one of the constants
NODE_CENTER_PORTS
,
BORDER_CENTER_PORTS
, or
BORDER_DISTRIBUTED_PORTS
.public int getPortStyle()
setPortStyle(int)
public void setLayoutStyle(int style)
PLAIN_STYLE
,
ORTHOGONAL_STYLE
public int getLayoutStyle()
public void setMinimalNodeDistance(double dist)
public double getMinimalNodeDistance()
public void setMinimalLayerDistance(double dist)
public double getMinimalLayerDistance()
public boolean isIntegratedNodeLabelingEnabled()
public void setIntegratedNodeLabelingEnabled(boolean integratedNodeLabelingEnabled)
public boolean isIntegratedEdgeLabelingEnabled()
public void setIntegratedEdgeLabelingEnabled(boolean integratedEdgeLabelingEnabled)
public double getBusAlignment()
getMinimalLayerDistance()
). 0: the bus is a the top of the space between the layers
0.5: the bus is exactly in the middle 1: the bus is at the bottom
public void setBusAlignment(double busAlignment)
busAlignment
- (between 0 and 1). Default is 0.3.public double getVerticalAlignment()
0
means nodes are top aligned;
a value of 1
means nodes are bottom aligned.
If global layering is not enforced, the value of this property is usually ignored.
Defaults to 0.5
, i.e. nodes are center aligned.
setVerticalAlignment(double)
,
isEnforceGlobalLayering()
,
setEnforceGlobalLayering(boolean)
public void setVerticalAlignment(double verticalAlignment)
0
means nodes are top aligned;
a value of 1
means nodes are bottom aligned.
If global layering is not enforced, the value of this property is usually ignored.
Defaults to 0.5
, i.e. nodes are center aligned.
verticalAlignment
- a value in [0, 1]
.getVerticalAlignment()
,
isEnforceGlobalLayering()
,
setEnforceGlobalLayering(boolean)
public void setModificationMatrix(AbstractRotatableNodePlacer.Matrix modificationMatrix)
public AbstractRotatableNodePlacer.Matrix getModificationMatrix()
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |