public abstract class JGraphAbstractTreeLayout extends java.lang.Object implements JGraphLayout
TreeNode
structure with appropriate interfaces to the
actual graph model. The layout can be configured by orientation, the
alignment of the nodes per level, the minimum distance betweenModifier and Type | Class and Description |
---|---|
protected class |
JGraphAbstractTreeLayout.TreeNode
An ADT representing a node in a tree structure.
|
JGraphLayout.Stoppable
Modifier and Type | Field and Description |
---|---|
protected JGraphFacade |
graph
The facade that describes the graph to be acted upon
|
protected double |
levelDistance
levelDistance is the distance between the lowest point of any vertex on
one level to the highest point of any vertex on the next level down.
|
protected double[] |
lowerLevelValues
The lowest point for each tree level
|
protected double |
nodeDistance
nodeDistance is the minimum distance between any two vertices on the same
level.
|
protected java.util.Map |
nodes
Stores the mapping between internal tree nodes and graph cells
|
protected java.awt.geom.Point2D |
oldOrigin
Keeps track of the old origin so that the new layout can be aligned to it
|
protected int |
orientation
orientation indicates where, relative to the rest of the tree, the root
node is placed.
|
protected boolean |
positionMultipleTrees
Indicates whether or not to space out multiple trees so that no
overlapping occurs between each tree
|
protected boolean |
routeTreeEdges
Whether or not to apply a standard routing algorithm to the edges
|
protected double |
treeBoundary
Keeps track of the coordinate that each tree fills space up to.
|
protected double |
treeDistance
If
positionMultipleTrees is true this value
is the minimum distance between each overlapping tree structure after
they are separated |
protected double[] |
upperLevelValues
The highest point for each tree level
|
VERSION
Constructor and Description |
---|
JGraphAbstractTreeLayout() |
Modifier and Type | Method and Description |
---|---|
double |
getLevelDistance() |
double |
getNodeDistance() |
int |
getOrientation() |
boolean |
getRouteTreeEdges() |
double |
getTreeDistance() |
boolean |
isPositionMultipleTrees() |
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.
|
void |
setLevelDistance(double distance) |
void |
setNodeDistance(int distance) |
void |
setOrientation(int orientation)
SwingConstants.NORTH SwingConstants.EAST SwingConstants.SOUTH
SwingConstants.WEST are valid inputs to this method
|
void |
setPositionMultipleTrees(boolean positionMultipleTrees) |
void |
setRouteTreeEdges(boolean routeTreeEdges) |
void |
setTreeDistance(int treeDistance) |
protected transient java.util.Map nodes
protected int orientation
protected double levelDistance
protected double nodeDistance
protected boolean positionMultipleTrees
protected double treeDistance
positionMultipleTrees
is true
this value
is the minimum distance between each overlapping tree structure after
they are separatedprotected double treeBoundary
protected java.awt.geom.Point2D oldOrigin
protected JGraphFacade graph
protected boolean routeTreeEdges
protected double[] lowerLevelValues
protected double[] upperLevelValues
public void run(JGraphFacade graph)
run
in interface JGraphLayout
graph
- the facade describing the graph and its configurationpublic void setOrientation(int orientation)
orientation
- public void setLevelDistance(double distance)
distance
- new level distancepublic void setNodeDistance(int distance)
distance
- new node distancepublic double getLevelDistance()
public double getNodeDistance()
public int getOrientation()
public boolean isPositionMultipleTrees()
public void setPositionMultipleTrees(boolean positionMultipleTrees)
positionMultipleTrees
- The positionMultipleTrees to set.public double getTreeDistance()
public void setTreeDistance(int treeDistance)
treeDistance
- The treeDistance to set.public boolean getRouteTreeEdges()
public void setRouteTreeEdges(boolean routeTreeEdges)
routeTreeEdges
- The routeTreeEdges to set.Copyright (C) 2001-2009 JGraph Ltd. All rights reserved.