com.mindfusion.diagramming
Class FlowchartLayout

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

public class FlowchartLayout
extends AbstractLayout

FlowchartLayout can be used to arrange flowcharts representing program source code. The algorithm recognizes program code -like patterns in the graph, such as loops, sequences and if/switch branchings, and arranges them recursively. FlowchartLayout could be used to arrange other types of graphs as well, though with some restrictions. For example it treats all back links as loops in the code, and expects that they are nested - loop links starting closer to the stop node should end closer to the start node. Another similar restriction is that there shouldn't be any cross-links that connect different branches of a decision sub-graph.


Constructor Summary
FlowchartLayout()
          Initializes a new instance of the FlowchartLayout class.
 
Method Summary
 boolean arrange(Diagram diagram, DiagramItemList items)
          Applies the layout on the specified subset of items from the specified Diagram instance.
 float getBranchPadding()
          Gets how much space to leave between adjacent decision branches in the flowchart.
 boolean getIgnoreRepeatingLinks()
          Gets a value indicating whether to ignore repeating links.
 float getLinkPadding()
          Gets how much space to leave between adjacent back links designating nested loops.
 float getNodeDistance()
          Gets the distance between consecutive nodes in the flowchart.
 int getOrientation()
          Gets the overall orientation of the arranged diagram.
 boolean getSplitGraph()
          Gets a value indicating whether unconnected subgraphs should be laid out independently from each other.
 void setBranchPadding(int value)
          Sets how much space to leave between adjacent decision branches in the flowchart.
 void setIgnoreRepeatingLinks(boolean value)
          Sets a value indicating whether to ignore repeating links.
 void setLinkPadding(float value)
          Sets how much space to leave between adjacent back links designating nested loops.
 void setNodeDistance(float value)
          Sets the distance between consecutive nodes in the flowchart.
 void setOrientation(int value)
          Sets the overall orientation of the arranged diagram.
 void setSplitGraph(boolean value)
          Sets a value indicating whether unconnected subgraphs should be laid out independently from each other.
 
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

FlowchartLayout

public FlowchartLayout()
Initializes a new instance of the FlowchartLayout 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 to arrange.
items - Specifies a subset of diagram items to arrange.
Returns:
true if the diagram has been arranged successfully; otherwise, false.

getSplitGraph

public boolean getSplitGraph()
Gets a value indicating whether unconnected subgraphs should be laid out independently from each other. If this property is set to true, each independent graph in the diagram is laid out in its own layout area. Otherwise all subgraphs are arranged in the same layout area.


setSplitGraph

public void setSplitGraph(boolean value)
Sets a value indicating whether unconnected subgraphs should be laid out independently from each other. If this property is set to true, each independent graph in the diagram is laid out in its own layout area. Otherwise all subgraphs are arranged in the same layout area.


getOrientation

public int getOrientation()
Gets the overall orientation of the arranged diagram.


setOrientation

public void setOrientation(int value)
Sets the overall orientation of the arranged diagram.


getBranchPadding

public float getBranchPadding()
Gets how much space to leave between adjacent decision branches in the flowchart.


setBranchPadding

public void setBranchPadding(int value)
Sets how much space to leave between adjacent decision branches in the flowchart.


getLinkPadding

public float getLinkPadding()
Gets how much space to leave between adjacent back links designating nested loops.


setLinkPadding

public void setLinkPadding(float value)
Sets how much space to leave between adjacent back links designating nested loops.


getNodeDistance

public float getNodeDistance()
Gets the distance between consecutive nodes in the flowchart.


setNodeDistance

public void setNodeDistance(float value)
Sets the distance between consecutive nodes in the flowchart.


getIgnoreRepeatingLinks

public boolean getIgnoreRepeatingLinks()
Gets a value indicating whether to ignore repeating links.


setIgnoreRepeatingLinks

public void setIgnoreRepeatingLinks(boolean value)
Sets a value indicating whether to ignore repeating links.