|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.hierarchic.incremental.NodeLayoutDescriptor
public class NodeLayoutDescriptor
This class is used by HierarchicLayouter
during the various
phases to determine the drawing details of the graph's nodes.
Note: not all of these values will be used for all kinds of nodes and
any kind of algorithm used.
This class is designed as a class to allow for future additions of new getter
methods.
HierarchicLayouter.NODE_LAYOUT_DESCRIPTOR_DPKEY
,
EdgeLayoutDescriptor
Field Summary | |
---|---|
static byte |
NODE_LABEL_MODE_CONSIDER_FOR_DRAWING
Byte constant used by getNodeLabelMode() and
setNodeLabelMode(byte) . |
static byte |
NODE_LABEL_MODE_CONSIDER_FOR_ROUTING
Byte constant used by getNodeLabelMode() and
setNodeLabelMode(byte) . |
static byte |
NODE_LABEL_MODE_CONSIDER_FOR_SELF_LOOPS
Byte constant used by getNodeLabelMode() and
setNodeLabelMode(byte) . |
static byte |
NODE_LABEL_MODE_NEVER
Byte constant used by getNodeLabelMode() and
setNodeLabelMode(byte) . |
Constructor Summary | |
---|---|
NodeLayoutDescriptor()
Creates a new instance of a NodeLayoutDescriptor using the default values. |
Method Summary | |
---|---|
double |
getLayerAlignment()
Returns the alignment of the node within its layer Default is 0.5d which results in center-aligned nodes. |
double |
getMinimumDistance()
Returns the preferred minimum distance of the node to obstacles. |
double |
getMinimumLayerHeight()
Returns the minimum height of the layer this node will be assigned to. |
byte |
getNodeLabelMode()
Returns the mode that determines the consideration of node labels during the layout. |
double |
getPortBorderGapRatio(int side)
Returns the port border gap ratio for the port distribution at the given side. |
void |
setLayerAlignment(double alignment)
Sets the alignment of the node within its layer. |
void |
setMinimumDistance(double distance)
Sets the preferred minimum distance to obstacles. |
void |
setMinimumLayerHeight(double height)
Sets the minimum height of the layer this node will be assigned to. |
void |
setNodeLabelMode(byte mode)
Sets the mode that determines the consideration of node labels during the layout. |
void |
setPortBorderGapRatio(int side,
double ratio)
Sets the port border gap ratio for the port distribution at the given side. |
void |
setPortBorderGapRatios(double ratio)
Sets the port border gap ratio for the port distribution on all sides of the node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte NODE_LABEL_MODE_NEVER
getNodeLabelMode()
and
setNodeLabelMode(byte)
. This mode prevents node labels from being
considered during the layout at all.
public static final byte NODE_LABEL_MODE_CONSIDER_FOR_SELF_LOOPS
getNodeLabelMode()
and
setNodeLabelMode(byte)
. This mode makes the algorithm consider
node labels for self-loops, node placement, and routing.
public static final byte NODE_LABEL_MODE_CONSIDER_FOR_DRAWING
getNodeLabelMode()
and
setNodeLabelMode(byte)
. This mode makes the algorithm consider
node labels for node placement and routing but not for self loops.
public static final byte NODE_LABEL_MODE_CONSIDER_FOR_ROUTING
getNodeLabelMode()
and
setNodeLabelMode(byte)
. This mode makes the algorithm consider
node labels during routing only.
Constructor Detail |
---|
public NodeLayoutDescriptor()
Method Detail |
---|
public void setPortBorderGapRatio(int side, double ratio)
side
- the sideratio
- the new ratiopublic void setPortBorderGapRatios(double ratio)
ratio
- the new ratiosetPortBorderGapRatio(int, double)
public double getPortBorderGapRatio(int side)
0.5d
for all sides.
side
- the 0-based clockwise side index for top-to-bottom layouts
public void setLayerAlignment(double alignment)
0.0d
means nodes are aligned at the top of the layer
(for top-down drawing). A value of 0.5d
results in center-aligned nodes
and 1.0d
leads to bottom-aligned nodes.
IllegalArgumentException
- if the alignment is not within [0.0d .. 1.0d]alignment
- the vertical alignment [0.0d .. 1.0d]public double getLayerAlignment()
0.5d
which results in center-aligned nodes.
setLayerAlignment(double)
public void setNodeLabelMode(byte mode)
IncrementalHierarchicLayouter
is used for the layout
the IncrementalHierarchicLayouter.setConsiderNodeLabelsEnabled(boolean)
should be set to true
. Otherwise one has to assure that
e.g. via an instanceof LabelLayoutTranslator
the algorithm
receives the appropriate information.
The mode constant can be one of NODE_LABEL_MODE_NEVER
,
NODE_LABEL_MODE_CONSIDER_FOR_SELF_LOOPS
,
NODE_LABEL_MODE_CONSIDER_FOR_DRAWING
, or
NODE_LABEL_MODE_CONSIDER_FOR_ROUTING
.
IllegalArgumentException
- if the constant is unknown.mode
- the new mode constantIncrementalHierarchicLayouter.setConsiderNodeLabelsEnabled(boolean)
public byte getNodeLabelMode()
NODE_LABEL_MODE_NEVER
,
NODE_LABEL_MODE_CONSIDER_FOR_SELF_LOOPS
,
NODE_LABEL_MODE_CONSIDER_FOR_DRAWING
, or
NODE_LABEL_MODE_CONSIDER_FOR_ROUTING
. NODE_LABEL_MODE_CONSIDER_FOR_DRAWING
.
setNodeLabelMode(byte)
,
IncrementalHierarchicLayouter.setConsiderNodeLabelsEnabled(boolean)
public void setMinimumLayerHeight(double height)
layerAlignments
are present.
height
- the minimum height of the layer this node is in.public double getMinimumLayerHeight()
layerAlignments
are present.
public void setMinimumDistance(double distance)
distance
- the minimum distance to obstaclespublic double getMinimumDistance()
5.0d
.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |