Class OrganizationalChart
java.lang.Object
com.jgraph.layout.tree.JGraphAbstractTreeLayout
com.jgraph.layout.tree.JGraphTreeLayout
com.jgraph.layout.tree.OrganizationalChart
- All Implemented Interfaces:
JGraphLayout
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
Nested ClassesModifier and TypeClassDescriptionprotected classAn ADT representing a node in an organisational chart structure.Nested classes/interfaces inherited from class JGraphTreeLayout
JGraphTreeLayout.PolyLine, JGraphTreeLayout.StandardTreeNodeNested classes/interfaces inherited from class JGraphAbstractTreeLayout
JGraphAbstractTreeLayout.TreeNodeNested classes/interfaces inherited from interface JGraphLayout
JGraphLayout.Stoppable -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe minimum number of children a parent has before all children are drawn in the vertical orientation styleprotected SetA set of cells whose children should be drawn in the vertical styleprotected intThe level at which nodes in the tree are switched to be vertically oriented.protected intThe inset from left hand side of parent vertices that descending vertical edges are placedprotected intThe inset right from vertical edges that vertices in the vertical style are offset byFields inherited from class JGraphTreeLayout
alignment, combineLevelNodesFields inherited from class JGraphAbstractTreeLayout
graph, levelDistance, lowerLevelValues, nodeDistance, nodes, oldOrigin, orientation, positionMultipleTrees, routeTreeEdges, treeBoundary, treeDistance, upperLevelValuesFields inherited from interface JGraphLayout
VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected JGraphTreeLayout.StandardTreeNodegetTreeNode(Object cell) Obtains the tree node corresponding to the specified cellprotected voidTop-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.Methods inherited from class JGraphTreeLayout
distance, getAlignment, getLeftMostX, getRightMostX, isCombineLevelNodes, join, merge, setAlignment, setCombineLevelNodes, setLevelHeights, setPosition, spaceMultipleTrees, toString
-
Field Details
-
vertexDepthOrientationSwitch
protected int vertexDepthOrientationSwitchThe 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 childrenLimitOrientationSwitchThe minimum number of children a parent has before all children are drawn in the vertical orientation style -
horizontalParentsSet
A set of cells whose children should be drawn in the vertical style -
verticalEdgeLeftInset
protected int verticalEdgeLeftInsetThe inset from left hand side of parent vertices that descending vertical edges are placed -
verticalEdgeRightInset
protected int verticalEdgeRightInsetThe inset right from vertical edges that vertices in the vertical style are offset by
-
-
Constructor Details
-
OrganizationalChart
public OrganizationalChart()
-
-
Method Details
-
run
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:
runin interfaceJGraphLayout- Overrides:
runin classJGraphTreeLayout- Parameters:
graph- the facade describing the graph and its configuration
-
getTreeNode
Obtains the tree node corresponding to the specified cell- Overrides:
getTreeNodein classJGraphTreeLayout- Parameters:
cell- the cell whose tree node is to be found- Returns:
- the matching tree node, if any
-
layout
Top-level method that performs actual layout of tree for a specific node. Note this acts upon the internal tree node structure- Overrides:
layoutin classJGraphTreeLayout- Parameters:
node- the tree node to be laid out
-