|
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.orthogonal.OrthogonalLayouter
public class OrthogonalLayouter
This class provides a layout algorithm which produces orthogonal drawings.
OrthogonalLayouter 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 classesLabelLayoutData
, LabelLayoutConstants
LabelLayoutKeys
and LabelLayoutTranslator
on how
to setup the integrated edge label layout feature.
Here is an sample output of the layouter using the layout style NORMAL_STYLE
.
Field Summary | |
---|---|
static byte |
BOX_STYLE
Layout style specifier. |
static Object |
EDGE_LAYOUT_DESCRIPTOR_DPKEY
DataProvider key used to retrieve EdgeLayoutDescriptor
instances for each edge in the graph. |
static byte |
FIXED_BOX_STYLE
Layout style specifier. |
static byte |
FIXED_MIXED_STYLE
Layout style specifier. |
static byte |
MIXED_STYLE
Layout style specifier. |
static int |
NODEMODEL_UNCHANGED
Deprecated. use NORMAL_STYLE instead. |
static int |
NODEMODEL_UNIFORM
Deprecated. use UNIFORM_STYLE instead. |
static byte |
NORMAL_STYLE
Layout style specifier. |
static byte |
NORMAL_TREE_STYLE
Layout style specifier. |
static byte |
UNIFORM_STYLE
Layout style specifier. |
Fields inherited from interface y.layout.Layouter |
---|
EDGE_ID_DPKEY, NODE_ID_DPKEY, SELECTED_EDGES, SELECTED_NODES |
Constructor Summary | |
---|---|
OrthogonalLayouter()
Returns a new instance. |
Method Summary | |
---|---|
boolean |
canLayoutCore(LayoutGraph graph)
Returns always true . |
protected EdgeLayoutDescriptor |
createEdgeLayoutDescriptor()
Factory method that creates the default EdgeLayoutDescriptor. |
void |
doLayoutCore(LayoutGraph graph)
Assigns an orthogonal graph layout to the given layout graph. |
EdgeLayoutDescriptor |
getEdgeLayoutDescriptor()
Returns the EdgeLayoutDescriptor instance used for all those
edges, that do not have a specific layout descriptor assigned. |
int |
getGrid()
Returns the size of the grid on which the nodes and edges are placed. |
int |
getLayoutStyle()
Returns the layout style of this layouter. |
int |
getNodeModel()
Deprecated. use setLayoutStyle(int) instead. |
boolean |
getUseCrossingPostprocessing()
Returns if post-processing is used to reduce the number of crossings. |
boolean |
getUseFaceMaximization()
Returns if the layouter should try to maximize one face of the embedding. |
boolean |
getUseLengthReduction()
Returns if the algorithm optimizes over the length of the edges. |
boolean |
getUseRandomization()
Returns if a randomization strategy is used. |
boolean |
getUseSketchDrawing()
Returns if the existing drawing should be used as sketch. |
boolean |
getUseSpacePostprocessing()
Deprecated. |
boolean |
isConsiderNodeLabelsEnabled()
Returns whether or not node labels are taken into account when calculating node positions (thereby preventing possible node/node label or node label/node label overlaps). |
boolean |
isIntegratedEdgeLabelingEnabled()
Returns whether integrated edge labeling is enabled. |
boolean |
isPerceivedBendsOptimizationEnabled()
Returns whether the algorithm should perform a post processing algorithm to reduce perceived bends in the drawing. |
void |
setConsiderNodeLabelsEnabled(boolean enabled)
Specifies whether or not to consider node labels when calculating node positions (thereby preventing possible node/node label or node label/node label overlaps). |
void |
setEdgeLayoutDescriptor(EdgeLayoutDescriptor edgeLayoutDescriptor)
Sets the EdgeLayoutDescriptor instance used for all those
edges, that do not have a specific layout descriptor assigned. |
void |
setGrid(int value)
Sets the size of the grid on which the nodes and edges are placed. |
void |
setIntegratedEdgeLabelingEnabled(boolean enabled)
Specifies whether or not to use integrated edge labeling. |
void |
setLayoutStyle(int value)
Sets the layout style for this layouter. |
void |
setNodeModel(int value)
Deprecated. use setLayoutStyle(int) instead. |
void |
setPerceivedBendsOptimizationEnabled(boolean perceivedBendsOptimizationEnabled)
Determines whether the algorithm should perform a post processing algorithm to reduce perceived bends in the drawing. |
void |
setUseCrossingPostprocessing(boolean value)
Sets if post-processing is used to reduce the number of crossings. |
void |
setUseFaceMaximization(boolean value)
Sets if the layouter should try to maximize one face of the embedding. |
void |
setUseLengthReduction(boolean value)
Sets if the algorithm optimizes over the length of the edges. |
void |
setUseRandomization(boolean value)
Sets if a randomization strategy is used. |
void |
setUseSketchDrawing(boolean value)
Sets if the existing drawing should be used as sketch. |
void |
setUseSpacePostprocessing(boolean value)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Object EDGE_LAYOUT_DESCRIPTOR_DPKEY
DataProvider
key used to retrieve EdgeLayoutDescriptor
instances for each edge in the graph. Different settings will affect the routing of the edges during the layout.
Note: minimum edge length constraints are only considered for layout style NORMAL_STYLE
,
NORMAL_TREE_STYLE
and UNIFORM_STYLE
(see setLayoutStyle(int)
).
setLayoutStyle(int)
public static final byte NORMAL_STYLE
public static final byte UNIFORM_STYLE
public static final byte BOX_STYLE
public static final byte MIXED_STYLE
public static final byte NORMAL_TREE_STYLE
NORMAL_STYLE
but all directed subtree structures
of the graph will be laid out in an optimized way. All edges will be routed orthogonally.
The tree edges will be routed in a bus-like fashion.
public static final byte FIXED_MIXED_STYLE
public static final byte FIXED_BOX_STYLE
FIXED_MIXED_STYLE
but edges will be routed strictly orthogonally.
The size of nodes will not be altered.
public static final int NODEMODEL_UNCHANGED
NORMAL_STYLE
instead.public static final int NODEMODEL_UNIFORM
UNIFORM_STYLE
instead.Constructor Detail |
---|
public OrthogonalLayouter()
Method Detail |
---|
public void setNodeModel(int value)
setLayoutStyle(int)
instead.
protected EdgeLayoutDescriptor createEdgeLayoutDescriptor()
null
!
new EdgeLayoutDescriptor()
)public EdgeLayoutDescriptor getEdgeLayoutDescriptor()
EdgeLayoutDescriptor
instance used for all those
edges, that do not have a specific layout descriptor assigned.
EDGE_LAYOUT_DESCRIPTOR_DPKEY
,
createEdgeLayoutDescriptor()
public void setEdgeLayoutDescriptor(EdgeLayoutDescriptor edgeLayoutDescriptor)
EdgeLayoutDescriptor
instance used for all those
edges, that do not have a specific layout descriptor assigned.
NullPointerException
- if the argument is null
edgeLayoutDescriptor
- the new descriptorEDGE_LAYOUT_DESCRIPTOR_DPKEY
public void setConsiderNodeLabelsEnabled(boolean enabled)
CanonicMultiStageLayouter.getLabelLayouter()
label layouter is of type LabelLayoutTranslator
and LabelLayoutTranslator.setTranslateNodeLabelsEnabled(boolean)
is set to
true
.
Note that setting this option may overwrite the currently set label layouter. Hence, to combine this option with
a generic edge labeling algorithm, the generic labeling has to be applied in an additional step after calculating the layout.
Furthermore, node labels can only be considered if the layout style is set to NORMAL_STYLE
.
enabled
- whether to enable this featurepublic boolean isConsiderNodeLabelsEnabled()
label layouter
is of type LabelLayoutTranslator
and LabelLayoutTranslator.isTranslateNodeLabelsEnabled()
returns true
.
false
.
IllegalStateException
- if the current label layouter is not of type LabelLayoutTranslator
.
public void setIntegratedEdgeLabelingEnabled(boolean enabled)
label layouter
is of type LabelLayoutTranslator
and LabelLayoutTranslator.setTranslateEdgeLabelsEnabled(boolean)
is set to
true
NORMAL_STYLE
.
enabled
- whether to enable this featurepublic boolean isIntegratedEdgeLabelingEnabled()
label layouter
is of type LabelLayoutTranslator
and
LabelLayoutTranslator.isTranslateEdgeLabelsEnabled()
returns true
. false
.
IllegalStateException
- if the current label layouter is not of type LabelLayoutTranslator
.
public int getNodeModel()
setLayoutStyle(int)
instead.
public void setUseRandomization(boolean value)
true
.
value
- true
if randomization is used,
false
if randomization is not used.public boolean getUseRandomization()
true
.
true
if randomization is used,
false
if randomization is not used.setUseRandomization(boolean)
public void setUseFaceMaximization(boolean value)
false
.
value
- true
if a face of the embedding should be
maximized,
false
if no face of the embedding
should be maximized.getUseFaceMaximization()
public boolean getUseFaceMaximization()
false
.
true
if a face of the embedding should be
maximized,
false
if no face of the embedding
should be maximized.setUseFaceMaximization(boolean)
public void setUseCrossingPostprocessing(boolean value)
true
.
value
- true
if post-processing is used,
false
if post-processing is not used.public boolean getUseCrossingPostprocessing()
true
.
setUseCrossingPostprocessing(boolean)
public boolean isPerceivedBendsOptimizationEnabled()
true
.
public void setPerceivedBendsOptimizationEnabled(boolean perceivedBendsOptimizationEnabled)
true
.
public void setGrid(int value)
value
- a positive integerpublic int getGrid()
setGrid(int)
public void setLayoutStyle(int value)
NORMAL_STYLE
is set.
value
- one of NORMAL_STYLE
, UNIFORM_STYLE
,
BOX_STYLE
, MIXED_STYLE
, FIXED_BOX_STYLE
, FIXED_MIXED_STYLE
or NORMAL_TREE_STYLE
.public int getLayoutStyle()
setLayoutStyle(int)
public void setUseSpacePostprocessing(boolean value)
true
.
value
- true
if post-processing is used,
false
if post-processing is not used.public boolean getUseSpacePostprocessing()
true
.
true
if post-processing is used,
false
if post-processing is not used.setUseSpacePostprocessing(boolean)
public void setUseLengthReduction(boolean value)
true
.
value
- true
if length reduction is used,
false
if length reduction is not used.public boolean getUseLengthReduction()
true
if length reduction is used,
false
if length reduction is not used.setUseLengthReduction(boolean)
public boolean getUseSketchDrawing()
true
if the existing drawing is used as sketch
false
otherwise.public void setUseSketchDrawing(boolean value)
value
- true
if the existing drawing should be used
as sketch false
otherwise.public boolean canLayoutCore(LayoutGraph graph)
true
.
canLayoutCore
in class CanonicMultiStageLayouter
public void doLayoutCore(LayoutGraph graph)
doLayoutCore
in class CanonicMultiStageLayouter
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |