com.jgraph.layout.tree

Class OrganizationalChart

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 classOrganizationalChart.OrganizationalTreeNode
An ADT representing a node in an organisational chart structure.
Field Summary
protected intchildrenLimitOrientationSwitch
The minimum number of children a parent has before all children are drawn in the vertical orientation style
protected SethorizontalParentsSet
A set of cells whose children should be drawn in the vertical style
protected intvertexDepthOrientationSwitch
The level at which nodes in the tree are switched to be vertically oriented.
protected intverticalEdgeLeftInset
The inset from left hand side of parent vertices that descending vertical edges are placed
protected intverticalEdgeRightInset
The inset right from vertical edges that vertices in the vertical style are offset by
Method Summary
protected JGraphTreeLayout.StandardTreeNodegetTreeNode(Object cell)
Obtains the tree node corresponding to the specified cell
protected voidlayout(JGraphTreeLayout.StandardTreeNode node)
Top-level method that performs actual layout of tree for a specific node.
voidrun(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.

Field Detail

childrenLimitOrientationSwitch

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

horizontalParentsSet

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

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.

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

Method Detail

getTreeNode

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

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

Parameters: node the tree node to be laid out

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

Parameters: graph the facade describing the graph and its configuration

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