com.mindfusion.diagramming
Class OrthogonalRouter

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

public class OrthogonalRouter
extends AbstractLayout

Implements an orthogonal graph layout algorithm.


Constructor Summary
OrthogonalRouter()
          Initializes a new instance of the OrthogonalLayout class.
 
Method Summary
 boolean arrange(Diagram diagram, DiagramItemList items)
          Applies the layout on the specified subset of items from the specified Diagram instance.
 int getBaseLayout()
          Gets a value indicating whether to arrange nodes or use their current configuration.
 float getBendDistance()
          Gets how far from its adjacent node a link should bend.
 int getDirection()
          Gets the direction of the arranged diagram when BaseLayout is set to Layered.
 int getEndOrientation()
          Gets the desired orientation of the last segments of routed links.
 float getGridSize()
          Gets the distance between adjacent grid points when BaseLayout is set to Grid.
 float getLayerDistance()
          Gets the desired distance between layer axis lines.
 float getNodeDistance()
          Gets the desired distance between adjacent nodes in a layer.
 int getOrientation()
          Gets the overall orientation of the arranged diagram when BaseLayout is set to Layered.
 boolean getPutEndPointsAtNodeBorders()
          Gets a value indicating whether the end points of a link should be placed at the outlines of the nodes connected by that link.
 int getRandomSeed()
          Gets the randomization seed to use for generating random node positions.
 DiagramNode getRoot()
          Gets a node indicating which subgraph of the diagram must be laid out.
 boolean getSplitGraph()
          Gets a value indicating whether unconnected subgraphs should be laid out independently from each other.
 int getStartOrientation()
          Gets the desired orientation of the first segments of routed links.
 void setBaseLayout(int value)
          Sets a value indicating whether to arrange nodes or use their current configuration.
 void setBendDistance(float value)
          Sets how far from its adjacent node a link should bend.
 void setDirection(int value)
          Sets the direction of the arranged diagram when BaseLayout is set to Layered.
 void setEndOrientation(int value)
          Sets the desired orientation of the last segments of routed links.
 void setGridSize(float value)
          Sets the distance between adjacent grid points when BaseLayout is set to Grid.
 void setLayerDistance(float value)
          Sets the desired distance between layer axis lines.
 void setNodeDistance(float value)
          Sets the desired distance between adjacent nodes in a layer.
 void setOrientation(int value)
          Sets the overall orientation of the arranged diagram when BaseLayout is set to Layered.
 void setPutEndPointsAtNodeBorders(boolean value)
          Sets a value indicating whether the end points of a link should be placed at the outlines of the nodes connected by that link.
 void setRandomSeed(int value)
          Sets the randomization seed to use for generating random node positions.
 void setRoot(DiagramNode value)
          Sets a node indicating which subgraph of the diagram must be laid out.
 void setSplitGraph(boolean value)
          Sets a value indicating whether unconnected subgraphs should be laid out independently from each other.
 void setStartOrientation(int value)
          Sets the desired orientation of the first segments of routed links.
 
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

OrthogonalRouter

public OrthogonalRouter()
Initializes a new instance of the OrthogonalLayout 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.

getBaseLayout

public int getBaseLayout()
Gets a value indicating whether to arrange nodes or use their current configuration.


setBaseLayout

public void setBaseLayout(int value)
Sets a value indicating whether to arrange nodes or use their current configuration.


getBendDistance

public float getBendDistance()
Gets how far from its adjacent node a link should bend. This should be a value between 0 and 1, specifying a distance proportional to the node size.


setBendDistance

public void setBendDistance(float value)
Sets how far from its adjacent node a link should bend. This should be a value between 0 and 1, specifying a distance proportional to the node size.


getGridSize

public float getGridSize()
Gets the distance between adjacent grid points when BaseLayout is set to Grid. This value is assigned to the GridSize property of the base GridLayout.


setGridSize

public void setGridSize(float value)
Sets the distance between adjacent grid points when BaseLayout is set to Grid. This value is assigned to the GridSize property of the base GridLayout.


getRandomSeed

public int getRandomSeed()
Gets the randomization seed to use for generating random node positions.


setRandomSeed

public void setRandomSeed(int value)
Sets the randomization seed to use for generating random node positions.


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. If a Root node is specified and SplitGraph is true, only the graph that contains the root node will be arranged.


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. If a Root node is specified and SplitGraph is true, only the graph that contains the root node will be arranged.


getRoot

public DiagramNode getRoot()
Gets a node indicating which subgraph of the diagram must be laid out. All links and nodes that can be reached from the root by following recursively its links form a graph. If the root is specified, only the graph which it defines is laid out by {#link arrange}.


setRoot

public void setRoot(DiagramNode value)
Sets a node indicating which subgraph of the diagram must be laid out. All links and nodes that can be reached from the root by following recursively its links form a graph. If the root is specified, only the graph which it defines is laid out by {#link arrange}.


getOrientation

public int getOrientation()
Gets the overall orientation of the arranged diagram when BaseLayout is set to Layered. This value is assigned to the Orientation property of the base LayeredLayout.


setOrientation

public void setOrientation(int value)
Sets the overall orientation of the arranged diagram when BaseLayout is set to Layered. This value is assigned to the Orientation property of the base LayeredLayout.


getDirection

public int getDirection()
Gets the direction of the arranged diagram when BaseLayout is set to Layered. This value is assigned to the Direction property of the base LayeredLayout.


setDirection

public void setDirection(int value)
Sets the direction of the arranged diagram when BaseLayout is set to Layered. This value is assigned to the Direction property of the base LayeredLayout.


getLayerDistance

public float getLayerDistance()
Gets the desired distance between layer axis lines. Specifies the distance between layers when BaseLayout is set to Layered or Cascading.


setLayerDistance

public void setLayerDistance(float value)
Sets the desired distance between layer axis lines. Specifies the distance between layers when BaseLayout is set to Layered or Cascading.


getNodeDistance

public float getNodeDistance()
Gets the desired distance between adjacent nodes in a layer. Specifies the distance between nodes in the same layer when BaseLayout is set to Layered or Cascading.


setNodeDistance

public void setNodeDistance(float value)
Sets the desired distance between adjacent nodes in a layer. Specifies the distance between nodes in the same layer when BaseLayout is set to Layered or Cascading.


getPutEndPointsAtNodeBorders

public boolean getPutEndPointsAtNodeBorders()
Gets a value indicating whether the end points of a link should be placed at the outlines of the nodes connected by that link.


setPutEndPointsAtNodeBorders

public void setPutEndPointsAtNodeBorders(boolean value)
Sets a value indicating whether the end points of a link should be placed at the outlines of the nodes connected by that link.


getStartOrientation

public int getStartOrientation()
Gets the desired orientation of the first segments of routed links.


setStartOrientation

public void setStartOrientation(int value)
Sets the desired orientation of the first segments of routed links.


getEndOrientation

public int getEndOrientation()
Gets the desired orientation of the last segments of routed links.


setEndOrientation

public void setEndOrientation(int value)
Sets the desired orientation of the last segments of routed links.