com.mindfusion.diagramming
Class SwimlaneLayout

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

public class SwimlaneLayout
extends AbstractLayout

Implements an algorithm which arranges nodes in lanes.


Constructor Summary
SwimlaneLayout()
          Initializes a new instance of the SwimlaneLayout 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 getCollapseEmptyLanes()
          Get or sets a value indicating whether lanes without associated nodes will shrink to zero size.
 boolean getCompactNodes()
          Gets a value indicating whether the nodes within individual lanes are compacted.
 int getDirection()
          Gets the direction of the arranged diagram.
 boolean getKeepLaneSizes()
          Gets a value indicating whether the layout will attempt to preserve the original sizes of the lanes in the supplied grid.
 float getLaneDistance()
          Gets the spacing between adjacent lanes in the final layout.
 float getNodeDistance()
          Gets the spacing between adjacent nodes within a lane in the final layout.
 int getOrientation()
          Gets a the orientation of the arranged graph.
 SwimlaneGrid getSwimlaneGrid()
          Gets the object through which the layout can manipulate the swimlane grid.
 void setCollapseEmptyLanes(boolean value)
          Set or sets a value indicating whether lanes without associated nodes will shrink to zero size.
 void setCompactNodes(boolean value)
          Sets a value indicating whether the nodes within individual lanes are compacted.
 void setDirection(int value)
          Sets the direction of the arranged diagram.
 void setKeepLaneSizes(boolean value)
          Sets a value indicating whether the layout will attempt to preserve the original sizes of the lanes in the supplied grid.
 void setLaneDistance(float value)
          Sets the spacing between adjacent lanes in the final layout.
 void setNodeDistance(float value)
          Sets the spacing between adjacent nodes within a lane in the final layout.
 void setOrientation(int value)
          Sets a the orientation of the arranged graph.
 void setSwimlaneGrid(SwimlaneGrid value)
          Sets the object through which the layout can manipulate the swimlane grid.
 
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

SwimlaneLayout

public SwimlaneLayout()
Initializes a new instance of the SwimlaneLayout 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:
This method always returns true.

getDirection

public int getDirection()
Gets the direction of the arranged diagram.


setDirection

public void setDirection(int value)
Sets the direction of the arranged diagram. If the orientation is set to Orientation.Horizontal, Direction.Straight stands for "left to right" and Direction.Reversed for "right to left". If the orientation is set to Orientation.Vertical, Direction.Straight stands for "top to bottom" and Direction.Reversed for "bottom to top".


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.

getSwimlaneGrid

public SwimlaneGrid getSwimlaneGrid()
Gets the object through which the layout can manipulate the swimlane grid.


setSwimlaneGrid

public void setSwimlaneGrid(SwimlaneGrid value)
Sets the object through which the layout can manipulate the swimlane grid. If this is null at the time of layout, the layout will operate on the diagram's lane grid.


getLaneDistance

public float getLaneDistance()
Gets the spacing between adjacent lanes in the final layout.


setLaneDistance

public void setLaneDistance(float value)
Sets the spacing between adjacent lanes in the final layout.


getNodeDistance

public float getNodeDistance()
Gets the spacing between adjacent nodes within a lane in the final layout.


setNodeDistance

public void setNodeDistance(float value)
Sets the spacing between adjacent nodes within a lane in the final layout.


getCollapseEmptyLanes

public boolean getCollapseEmptyLanes()
Get or sets a value indicating whether lanes without associated nodes will shrink to zero size. By default, empty lanes will have size equal to the value specified through setLaneDistance(float).


setCollapseEmptyLanes

public void setCollapseEmptyLanes(boolean value)
Set or sets a value indicating whether lanes without associated nodes will shrink to zero size. By default, empty lanes will have size equal to the value specified through setLaneDistance(float). To be able to shrink the lanes of a lane grid to zero size, the MinHeaderSize property of the lane grid must be set to an appropriate value.


getCompactNodes

public boolean getCompactNodes()
Gets a value indicating whether the nodes within individual lanes are compacted.


setCompactNodes

public void setCompactNodes(boolean value)
Sets a value indicating whether the nodes within individual lanes are compacted.


getKeepLaneSizes

public boolean getKeepLaneSizes()
Gets a value indicating whether the layout will attempt to preserve the original sizes of the lanes in the supplied grid.


setKeepLaneSizes

public void setKeepLaneSizes(boolean value)
Sets a value indicating whether the layout will attempt to preserve the original sizes of the lanes in the supplied grid.