com.mindfusion.diagramming
Class OrthogonalLayout

java.lang.Object
  extended by com.mindfusion.diagramming.AbstractLayout
      extended by com.mindfusion.diagramming.OrthogonalLayout

public class OrthogonalLayout
extends AbstractLayout

Implements an orthogonal graph layout algorithm. Each link is drawn as a chain of alternating horizontal and vertical segments. Nodes are placed in a way that facilitates few links bends and crossings.


Constructor Summary
OrthogonalLayout()
          Initializes a new instance of the OrthogonalLayout class with the default settings.
 
Method Summary
 boolean arrange(Diagram diagram, DiagramItemList items)
          Applies the layout on the specified subset of items from the specified Diagram instance.
 boolean getDirected()
          Gets a value indicating whether the graph being laid out is directed.
 boolean getMinimizeLinkBends()
           
 float getMinLaneSize()
          Gets a value indicating the minimum size of a lane.
 float getPadding()
          Gets a value indicating how much space to leave between nodes in adjacent lanes.
 boolean getRefine()
          Gets a value indicating whether to refine the layout.
 void setDirected(boolean directed)
          Sets a value indicating whether the graph being laid out is directed.
 void setMinimizeLinkBends(boolean value)
          Sets a value indicating whether the layout should attempt to minimize link bends.
 void setMinLaneSize(float value)
          Sets a value indicating the minimum size of a lane.
 void setPadding(float padding)
          Sets a value indicating how much space to leave between nodes in adjacent lanes.
 void setRefine(boolean refine)
          Sets a value indicating whether to refine the layout.
 
Methods inherited from class com.mindfusion.diagramming.AbstractLayout
arrange, getAnchoring, getKeepGroupLayout, getLayoutLink, getLayoutNode, getMargins, getMultipleGraphsPlacement, getProgress, removeMidleSegmentPoint, setAnchoring, setKeepGroupLayout, setLayoutLink, setLayoutNode, setMargins, setMultipleGraphsPlacement, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrthogonalLayout

public OrthogonalLayout()
Initializes a new instance of the OrthogonalLayout class with the default settings.

Method Detail

arrange

public boolean arrange(Diagram diagram,
                       DiagramItemList items)
Applies the layout on the specified subset of items from the specified Diagram instance.

Specified by:
arrange in class AbstractLayout
Parameters:
diagram - The Diagram that should be arranged.
items - A collection of nodes and links from diagram that define the subgraph to arrange.
Returns:
true if the diagram has been arranged successfully; otherwise, false.

getMinLaneSize

public float getMinLaneSize()
Gets a value indicating the minimum size of a lane.

Returns:
A float value specifying the minimum lane size; the default is 10.

setMinLaneSize

public void setMinLaneSize(float value)
Sets a value indicating the minimum size of a lane.

Parameters:
value - A float value specifying the minimum lane size; the default is 10.

getPadding

public float getPadding()
Gets a value indicating how much space to leave between nodes in adjacent lanes.

Returns:
A float value specifying the padding between lanes; the default is 15.

setPadding

public void setPadding(float padding)
Sets a value indicating how much space to leave between nodes in adjacent lanes.

Parameters:
padding - A float value specifying the padding between lanes; the default is 15.

getRefine

public boolean getRefine()
Gets a value indicating whether to refine the layout.

Returns:
true to make local refinements in the layout grid; otherwise false.

setRefine

public void setRefine(boolean refine)
Sets a value indicating whether to refine the layout.

Parameters:
refine - true to make local refinements in the layout grid; otherwise false.

getDirected

public boolean getDirected()
Gets a value indicating whether the graph being laid out is directed.

Returns:
true to treat the graph as directed, otherwise false.

setDirected

public void setDirected(boolean directed)
Sets a value indicating whether the graph being laid out is directed.

Parameters:
directed - true to treat the graph as directed, otherwise false.

getMinimizeLinkBends

public boolean getMinimizeLinkBends()
Returns:
Gets a value indicating whether the layout should attempt to minimize link bends.

setMinimizeLinkBends

public void setMinimizeLinkBends(boolean value)
Sets a value indicating whether the layout should attempt to minimize link bends.

Parameters:
value - true to minimize link bends, otherwise false. The default value is true.