com.mindfusion.diagramming
Class CircularLayout

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

public class CircularLayout
extends AbstractLayout

Implements a circular graph layout algorithm. Nodes are distributed evenly on the circumference of a circle at positions that result in as few link crossing as possible.


Constructor Summary
CircularLayout()
          Initializes a new instance of the CircularLayout class with the default settings.
 
Method Summary
 boolean arrange(Diagram diagram)
          Applies the layout on the specified Diagram instance.
 boolean arrange(Diagram diagram, DiagramItemList items)
          Applies the layout on the specified subset of items from the specified Diagram instance.
 float getRadius()
          Gets the radius of the layout circle.
 int getSiftingRounds()
          Gets the number of sifts to perform during the layout.
 void setRadius(float value)
          Sets the radius of the layout circle.
 void setSiftingRounds(int value)
          Sets the number of sifts to perform during the layout.
 
Methods inherited from class com.mindfusion.diagramming.AbstractLayout
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

CircularLayout

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

Method Detail

arrange

public boolean arrange(Diagram diagram)
Applies the layout on the specified Diagram instance.

Overrides:
arrange in class AbstractLayout
Parameters:
diagram - The Diagram that should be arranged.
Returns:
true if the diagram has been arranged successfully; otherwise, false.

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.

setRadius

public void setRadius(float value)
Sets the radius of the layout circle.

Parameters:
value -

getRadius

public float getRadius()
Gets the radius of the layout circle.

Returns:

setSiftingRounds

public void setSiftingRounds(int value)
Sets the number of sifts to perform during the layout.

Parameters:
value -

getSiftingRounds

public int getSiftingRounds()
Gets the number of sifts to perform during the layout.

Returns: