y.layout.orthogonal
Class OrthogonalLayouter

java.lang.Object
  |
  +--y.layout.CanonicMultiStageLayouter
        |
        +--y.layout.orthogonal.OrthogonalLayouter
All Implemented Interfaces:
Layouter

public class OrthogonalLayouter
extends CanonicMultiStageLayouter

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 classes LabelLayoutData, 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 OrthogonalLayouter.NORMAL_STYLE.


Field Summary
static short BOX_STYLE
          Layout style specifier.
static short MIXED_STYLE
          Layout style specifier.
static int NODEMODEL_UNCHANGED
          Deprecated. use OrthogonalLayouter.NORMAL_STYLE instead.
static int NODEMODEL_UNIFORM
          Deprecated. use OrthogonalLayouter.UNIFORM_STYLE instead.
static int NORMAL_STYLE
          Layout style specifier.
static int NORMAL_TREE_STYLE
          Layout style specifier.
static int 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.
 void doLayoutCore(LayoutGraph graph)
          Assigns an orthogonal graph layout to the given layout graph.
 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 OrthogonalLayouter.setLayoutStyle(int) instead.
 boolean getUseCrossingPostprocessing()
          Returns if postprocessing is used to reduce the number of crossings.
 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.  
 void setGrid(int value)
          Sets the size of the grid on which the nodes and edges are placed.
 void setLayoutStyle(int value)
          Sets the layout style for this layouter.
 void setNodeModel(int value)
          Deprecated. use OrthogonalLayouter.setLayoutStyle(int) instead.
 void setUseCrossingPostprocessing(boolean value)
          Sets if postprocessing is used to reduce the number of crossings.
 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 y.layout.CanonicMultiStageLayouter
appendStage, calcLayout, calcLayout, canLayout, doLayout, doLayout, enableOnlyCore, getComponentLayouter, getGroupNodeHider, getLabelLayouter, getLayoutOrientation, getOrientationLayouter, getParallelEdgeLayouter, getSelfLoopLayouter, getSubgraphLayouter, isComponentLayouterEnabled, isGroupNodeHidingEnabled, isLabelLayouterEnabled, isOrientationLayouterEnabled, isParallelEdgeLayouterEnabled, isSelfLoopLayouterEnabled, isSubgraphLayouterEnabled, prependStage, removeStage, setComponentLayouter, setComponentLayouterEnabled, setGroupNodeHider, setGroupNodeHidingEnabled, setLabelLayouter, setLabelLayouterEnabled, setLayoutOrientation, setOrientationLayouter, setOrientationLayouterEnabled, setParallelEdgeLayouter, setParallelEdgeLayouterEnabled, setSelfLoopLayouter, setSelfLoopLayouterEnabled, setSubgraphLayouter, setSubgraphLayouterEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORMAL_STYLE

public static final int NORMAL_STYLE
Layout style specifier. In this layout style the size of the nodes will not be changed by the algorithm. All edges will be routed orthogonally.

See Also:
Constant Field Values

UNIFORM_STYLE

public static final int UNIFORM_STYLE
Layout style specifier. In this layout style a uniform size will be assigned to all nodes. All edges will be routed orthogonally.

See Also:
Constant Field Values

BOX_STYLE

public static final short BOX_STYLE
Layout style specifier. In this layout style the size of the original nodes will be enlarged in order to save some bends. All edges will be routed orthogonally.

See Also:
Constant Field Values

MIXED_STYLE

public static final short MIXED_STYLE
Layout style specifier. In this layout style not all edges will be routed orthogonally. Edge segments that directly connect to a node may be routed non-vertically and non-horiyontally. A small uniform size will be assigned to all nodes.

See Also:
Constant Field Values

NORMAL_TREE_STYLE

public static final int NORMAL_TREE_STYLE
Layout style specifier. Like OrthogonalLayouter.NORMAL_STYLE but all directed subtree structures of the graph will be layouted in an optimized way. All edges will be routed orthogonally. The tree edges will be routed in a bus-like fashion.

See Also:
Constant Field Values

NODEMODEL_UNCHANGED

public static final int NODEMODEL_UNCHANGED
Deprecated. use OrthogonalLayouter.NORMAL_STYLE instead.

See Also:
Constant Field Values

NODEMODEL_UNIFORM

public static final int NODEMODEL_UNIFORM
Deprecated. use OrthogonalLayouter.UNIFORM_STYLE instead.

See Also:
Constant Field Values
Constructor Detail

OrthogonalLayouter

public OrthogonalLayouter()
Returns a new instance.

Method Detail

setNodeModel

public void setNodeModel(int value)
Deprecated. use OrthogonalLayouter.setLayoutStyle(int) instead.


getNodeModel

public int getNodeModel()
Deprecated. use OrthogonalLayouter.setLayoutStyle(int) instead.


setUseRandomization

public void setUseRandomization(boolean value)
Sets if a randomization strategy is used. The randomization usually improves the result but it may be disabled to get a deterministic behaviour of the algorithm.
Default is true.

Parameters:
value - true if randomization is used, false if randomization is not used.

getUseRandomization

public boolean getUseRandomization()
Returns if a randomization strategy is used. Default is true.

Returns:
true if randomization is used, false if randomization is not used.
See Also:
OrthogonalLayouter.setUseRandomization(boolean)

setUseCrossingPostprocessing

public void setUseCrossingPostprocessing(boolean value)
Sets if postprocessing is used to reduce the number of crossings. This postprocessing may decrease the number of crossings significantelly but it slows the algorithm down.
Default is true.

Parameters:
value - true if postprocessing is used, false if postprocessing is not used.

getUseCrossingPostprocessing

public boolean getUseCrossingPostprocessing()
Returns if postprocessing is used to reduce the number of crossings. Default is true.

See Also:
OrthogonalLayouter.setUseCrossingPostprocessing(boolean)

setGrid

public void setGrid(int value)
Sets the size of the grid on which the nodes and edges are placed.
Default is 20.

Parameters:
value - a positive integer

getGrid

public int getGrid()
Returns the size of the grid on which the nodes and edges are placed.
Default is 20.

Returns:
a positive integer
See Also:
OrthogonalLayouter.setGrid(int)

setLayoutStyle

public void setLayoutStyle(int value)
Sets the layout style for this layouter. By default the layout style OrthogonalLayouter.NORMAL_STYLE is set.

Parameters:
value - one of OrthogonalLayouter.NORMAL_STYLE, OrthogonalLayouter.UNIFORM_STYLE, OrthogonalLayouter.BOX_STYLE, OrthogonalLayouter.MIXED_STYLE or OrthogonalLayouter.NORMAL_TREE_STYLE.

getLayoutStyle

public int getLayoutStyle()
Returns the layout style of this layouter.

See Also:
OrthogonalLayouter.setLayoutStyle(int)

setUseSpacePostprocessing

public void setUseSpacePostprocessing(boolean value)
Deprecated.  

Sets if postprocessing is used to reduce the space used by the drawing. This postprocessing may decrease space significantelly but it slows the algorithm down.
Default is true.

Parameters:
value - true if postprocessing is used, false if postprocessing is not used.

getUseSpacePostprocessing

public boolean getUseSpacePostprocessing()
Deprecated.  

Returns if postprocessing is used to reduce the space used by the drawing. Default is true.

Returns:
value true if postprocessing is used, false if postprocessing is not used.
See Also:
OrthogonalLayouter.setUseSpacePostprocessing(boolean)

setUseLengthReduction

public void setUseLengthReduction(boolean value)
Sets if the algorithm optimizes over the length of the edges. This may decrease the length of some edges significantelly but it slows the algorithm down.
Default is true.

Parameters:
value - true if length reduction is used, false if length reduction is not used.

getUseLengthReduction

public boolean getUseLengthReduction()
Returns if the algorithm optimizes over the length of the edges.

Returns:
true if length reduction is used, false if length reduction is not used.
See Also:
OrthogonalLayouter.setUseLengthReduction(boolean)

getUseSketchDrawing

public boolean getUseSketchDrawing()
Returns if the existing drawing should be used as sketch.

Returns:
true if the existing drawing is used as sketch false otherwise.

setUseSketchDrawing

public void setUseSketchDrawing(boolean value)
Sets if the existing drawing should be used as sketch.

Parameters:
value - true if the existing drawing should be used as sketch false otherwise.

canLayoutCore

public boolean canLayoutCore(LayoutGraph graph)
Returns always true.

Specified by:
canLayoutCore in class CanonicMultiStageLayouter

doLayoutCore

public void doLayoutCore(LayoutGraph graph)
Assigns an orthogonal graph layout to the given layout graph.

Specified by:
doLayoutCore in class CanonicMultiStageLayouter

© Copyright 2000-2003,
yWorks GmbH.
All rights reserved.

2003