|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.activity.Activity prefuse.action.Action prefuse.action.GroupAction prefuse.action.layout.Layout prefuse.action.layout.graph.TreeLayout prefuse.action.layout.graph.NodeLinkTreeLayout
public class NodeLinkTreeLayout
TreeLayout that computes a tidy layout of a node-link tree diagram. This algorithm lays out a rooted tree such that each depth level of the tree is on a shared line. The orientation of the tree can be set such that the tree goes left-to-right (default), right-to-left, top-to-bottom, or bottom-to-top.
The algorithm used is that of Christoph Buchheim, Michael Jünger, and Sebastian Leipert from their research paper Improving Walker's Algorithm to Run in Linear Time, Graph Drawing 2002. This algorithm corrects performance issues in Walker's algorithm, which generalizes Reingold and Tilford's method for tidy drawings of trees to support trees with an arbitrary number of children at any given node.
Nested Class Summary | |
---|---|
static class |
NodeLinkTreeLayout.Params
Wrapper class holding parameters used for each node in this layout. |
Field Summary | |
---|---|
static java.lang.String |
PARAMS
The data field in which the parameters used by this layout are stored. |
static Schema |
PARAMS_SCHEMA
The schema for the parameters used by this layout. |
Fields inherited from class prefuse.action.layout.graph.TreeLayout |
---|
m_root |
Fields inherited from class prefuse.action.layout.Layout |
---|
m_anchor, m_bounds, m_bpts, m_insets, m_margin, m_tmpa, m_tmpb |
Fields inherited from class prefuse.action.GroupAction |
---|
m_group |
Fields inherited from class prefuse.action.Action |
---|
m_vis |
Fields inherited from class prefuse.activity.Activity |
---|
DEFAULT_STEP_TIME, INFINITY |
Constructor Summary | |
---|---|
NodeLinkTreeLayout(java.lang.String group)
Create a new NodeLinkTreeLayout. |
|
NodeLinkTreeLayout(java.lang.String group,
int orientation,
double dspace,
double bspace,
double tspace)
Create a new NodeLinkTreeLayout. |
Method Summary | |
---|---|
double |
getBreadthSpacing()
Get the spacing between neighbor nodes. |
double |
getDepthSpacing()
Get the spacing between depth levels. |
java.awt.geom.Point2D |
getLayoutAnchor()
Return the layout anchor at which to center or root the layout. |
int |
getOrientation()
Get the orientation of the tree layout. |
double |
getRootNodeOffset()
Get the offset value for placing the root node of the tree. |
double |
getSubtreeSpacing()
Get the spacing between neighboring subtrees. |
protected void |
initSchema(TupleSet ts)
|
void |
run(double frac)
Runs this Action, triggering whatever processing this Action performs. |
void |
setBreadthSpacing(double b)
Set the spacing between neighbor nodes. |
void |
setDepthSpacing(double d)
Set the spacing between depth levels. |
void |
setOrientation(int orientation)
Set the orientation of the tree layout. |
void |
setRootNodeOffset(double o)
Set the offset value for placing the root node of the tree. |
void |
setSubtreeSpacing(double s)
Set the spacing between neighboring subtrees. |
Methods inherited from class prefuse.action.layout.graph.TreeLayout |
---|
getLayoutRoot, setLayoutRoot |
Methods inherited from class prefuse.action.layout.Layout |
---|
getLayoutBounds, setLayoutAnchor, setLayoutBounds, setMargin, setX, setY |
Methods inherited from class prefuse.action.GroupAction |
---|
getGroup, setGroup |
Methods inherited from class prefuse.action.Action |
---|
getVisualization, run, setVisualization |
Methods inherited from class prefuse.activity.Activity |
---|
addActivityListener, alwaysRunAfter, cancel, fireActivityCancelled, fireActivityFinished, fireActivityScheduled, fireActivityStarted, fireActivityStepped, getDuration, getNextTime, getPace, getPacingFunction, getStartTime, getStepTime, getStopTime, isEnabled, isRunning, isScheduled, removeActivityListener, run, runAfter, runAt, setDuration, setEnabled, setPacingFunction, setStartTime, setStepTime |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PARAMS
public static final Schema PARAMS_SCHEMA
Constructor Detail |
---|
public NodeLinkTreeLayout(java.lang.String group)
group
- the data group to layout. Must resolve to a Graph instance.public NodeLinkTreeLayout(java.lang.String group, int orientation, double dspace, double bspace, double tspace)
group
- the data group to layout. Must resolve to a Graph instance.orientation
- the orientation of the tree layout. One of
Constants.ORIENT_LEFT_RIGHT
,
Constants.ORIENT_RIGHT_LEFT
,
Constants.ORIENT_TOP_BOTTOM
, or
Constants.ORIENT_BOTTOM_TOP
.dspace
- the spacing to maintain between depth levels of the treebspace
- the spacing to maintain between sibling nodestspace
- the spacing to maintain between neighboring subtreesMethod Detail |
---|
public void setOrientation(int orientation)
orientation
- the orientation value. One of
Constants.ORIENT_LEFT_RIGHT
,
Constants.ORIENT_RIGHT_LEFT
,
Constants.ORIENT_TOP_BOTTOM
, or
Constants.ORIENT_BOTTOM_TOP
.public int getOrientation()
Constants.ORIENT_LEFT_RIGHT
,
Constants.ORIENT_RIGHT_LEFT
,
Constants.ORIENT_TOP_BOTTOM
, or
Constants.ORIENT_BOTTOM_TOP
.public void setDepthSpacing(double d)
d
- the depth spacing to usepublic double getDepthSpacing()
public void setBreadthSpacing(double b)
b
- the breadth spacing to usepublic double getBreadthSpacing()
public void setSubtreeSpacing(double s)
s
- the subtree spacing to usepublic double getSubtreeSpacing()
public void setRootNodeOffset(double o)
o
- the value by which to offset the root node of the treepublic double getRootNodeOffset()
public java.awt.geom.Point2D getLayoutAnchor()
Layout
getLayoutAnchor
in class Layout
Layout.getLayoutAnchor()
public void run(double frac)
Action
run
in class GroupAction
frac
- the fraction of this Action's duration that has elapsed.Action.run(double)
protected void initSchema(TupleSet ts)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |