JGraph
v5.13.0.4


com.jgraph.layout.tree
Class OrganizationalChart

java.lang.Object
  extended by com.jgraph.layout.tree.JGraphAbstractTreeLayout
      extended by com.jgraph.layout.tree.JGraphTreeLayout
          extended by com.jgraph.layout.tree.OrganizationalChart
All Implemented Interfaces:
JGraphLayout

public class OrganizationalChart
extends JGraphTreeLayout

A simple organisational chart. There are a number of switches that cause children cells to be drawn downwards from a vertex with the edges routed on one side. If any of the conditions are true, the vertical style is used for those vertices, regardless of whether the other conditions are true or false.


Nested Class Summary
protected  class OrganizationalChart.OrganizationalTreeNode
          An ADT representing a node in an organisational chart structure.
 
Nested classes/interfaces inherited from class com.jgraph.layout.tree.JGraphTreeLayout
JGraphTreeLayout.PolyLine, JGraphTreeLayout.StandardTreeNode
 
Nested classes/interfaces inherited from class com.jgraph.layout.tree.JGraphAbstractTreeLayout
JGraphAbstractTreeLayout.TreeNode
 
Nested classes/interfaces inherited from interface com.jgraph.layout.JGraphLayout
JGraphLayout.Stoppable
 
Field Summary
protected  int childrenLimitOrientationSwitch
          The minimum number of children a parent has before all children are drawn in the vertical orientation style
protected  java.util.Set horizontalParentsSet
          A set of cells whose children should be drawn in the vertical style
protected  int vertexDepthOrientationSwitch
          The level at which nodes in the tree are switched to be vertically oriented.
protected  int verticalEdgeLeftInset
          The inset from left hand side of parent vertices that descending vertical edges are placed
protected  int verticalEdgeRightInset
          The inset right from vertical edges that vertices in the vertical style are offset by
 
Fields inherited from class com.jgraph.layout.tree.JGraphTreeLayout
alignment, combineLevelNodes
 
Fields inherited from class com.jgraph.layout.tree.JGraphAbstractTreeLayout
graph, levelDistance, lowerLevelValues, nodeDistance, nodes, oldOrigin, orientation, positionMultipleTrees, routeTreeEdges, treeBoundary, treeDistance, upperLevelValues
 
Fields inherited from interface com.jgraph.layout.JGraphLayout
VERSION
 
Constructor Summary
OrganizationalChart()
           
 
Method Summary
protected  JGraphTreeLayout.StandardTreeNode getTreeNode(java.lang.Object cell)
          Obtains the tree node corresponding to the specified cell
protected  void layout(JGraphTreeLayout.StandardTreeNode node)
          Top-level method that performs actual layout of tree for a specific node.
 void run(JGraphFacade graph)
          The API method used to exercise the layout upon the facade description and produce a separate description of the vertex position and edge routing changes made.
 
Methods inherited from class com.jgraph.layout.tree.JGraphTreeLayout
distance, getAlignment, getLeftMostX, getRightMostX, isCombineLevelNodes, join, merge, setAlignment, setCombineLevelNodes, setLevelHeights, setPosition, spaceMultipleTrees, toString
 
Methods inherited from class com.jgraph.layout.tree.JGraphAbstractTreeLayout
getLevelDistance, getNodeDistance, getOrientation, getRouteTreeEdges, getTreeDistance, isPositionMultipleTrees, setLevelDistance, setNodeDistance, setOrientation, setPositionMultipleTrees, setRouteTreeEdges, setTreeDistance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

vertexDepthOrientationSwitch

protected int vertexDepthOrientationSwitch
The level at which nodes in the tree are switched to be vertically oriented. The first layer is 0, it cannot be laid out like this because there can only be 1 root per tree.


childrenLimitOrientationSwitch

protected int childrenLimitOrientationSwitch
The minimum number of children a parent has before all children are drawn in the vertical orientation style


horizontalParentsSet

protected java.util.Set horizontalParentsSet
A set of cells whose children should be drawn in the vertical style


verticalEdgeLeftInset

protected int verticalEdgeLeftInset
The inset from left hand side of parent vertices that descending vertical edges are placed


verticalEdgeRightInset

protected int verticalEdgeRightInset
The inset right from vertical edges that vertices in the vertical style are offset by

Constructor Detail

OrganizationalChart

public OrganizationalChart()
Method Detail

run

public void run(JGraphFacade graph)
The API method used to exercise the layout upon the facade description and produce a separate description of the vertex position and edge routing changes made. It first builds a representation of the tree using the inner tree class by doing a depth first search of the graph from the root. It then lays out the graph using the obtained data

Specified by:
run in interface JGraphLayout
Overrides:
run in class JGraphTreeLayout
Parameters:
graph - the facade describing the graph and its configuration

getTreeNode

protected JGraphTreeLayout.StandardTreeNode getTreeNode(java.lang.Object cell)
Obtains the tree node corresponding to the specified cell

Overrides:
getTreeNode in class JGraphTreeLayout
Parameters:
cell - the cell whose tree node is to be found
Returns:
the matching tree node, if any

layout

protected void layout(JGraphTreeLayout.StandardTreeNode node)
Top-level method that performs actual layout of tree for a specific node. Note this acts upon the internal tree node structure

Overrides:
layout in class JGraphTreeLayout
Parameters:
node - the tree node to be laid out

JGraph
v5.13.0.4


Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.