com.mindfusion.diagramming
Class TriangularLayout

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

public class TriangularLayout
extends AbstractLayout

Performs triangular layout on simple, connected graphs. The triangular layout places vertices on a virtual grid, such that if the source graph is planar is guaranteed that all links will have a single segment and will not intersect. If the graph is not planar, the intersecting links are optionally segmented and bended in order to improve readability.


Constructor Summary
TriangularLayout()
          Initializes a new instance of the TriangularLayout class.
 
Method Summary
 boolean arrange(Diagram diagram, DiagramItemList items)
          Applies the layout on the specified subset of items from the specified Diagram instance.
 boolean getBendNonplanarLinks()
          Gets a value indicating whether the intersecting links in a non-planar graphs will be segmented and bended to improve presentation.
 float getGridSize()
          Gets the size of the virtual grid the layout will place vertices on.
 void getGridSize(float value)
          Sets the size of the virtual grid the layout will place vertices on.
 int getOrientation()
          Gets a the orientation of the arranged graph.
 void setBendNonplanarLinks(boolean value)
          Sets a value indicating whether the intersecting links in a non-planar graphs will be segmented and bended to improve presentation.
 void setOrientation(int value)
          Sets a the orientation of the arranged graph.
 
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

TriangularLayout

public TriangularLayout()
Initializes a new instance of the TriangularLayout class.

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:
This method always returns true.

getOrientation

public int getOrientation()
Gets a the orientation of the arranged graph.

Returns:
One of the Orientation constants.

setOrientation

public void setOrientation(int value)
Sets a the orientation of the arranged graph.

Parameters:
value - One of the Orientation constants.

getBendNonplanarLinks

public boolean getBendNonplanarLinks()
Gets a value indicating whether the intersecting links in a non-planar graphs will be segmented and bended to improve presentation.


setBendNonplanarLinks

public void setBendNonplanarLinks(boolean value)
Sets a value indicating whether the intersecting links in a non-planar graphs will be segmented and bended to improve presentation.


getGridSize

public float getGridSize()
Gets the size of the virtual grid the layout will place vertices on.


getGridSize

public void getGridSize(float value)
Sets the size of the virtual grid the layout will place vertices on.