public class RadialTreeLayout
extends prefuse.action.layout.graph.TreeLayout
TreeLayout instance that computes a radial layout, laying out subsequent depth levels of a tree on circles of progressively increasing radius.
The algorithm used is that of Ka-Ping Yee, Danyel Fisher, Rachna Dhamija, and Marti Hearst in their research paper Animated Exploration of Dynamic Graphs with Radial Layout, InfoVis 2001. This algorithm computes a radial layout which factors in possible variation in sizes, and maintains both orientation and ordering constraints to facilitate smooth and understandable transitions between layout configurations.
| Modifier and Type | Class and Description |
|---|---|
static class |
RadialTreeLayout.Params
Wrapper class holding parameters used for each node in this layout.
|
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_RADIUS |
protected boolean |
m_autoScale |
protected int |
m_maxDepth |
protected Point2D |
m_origin |
protected prefuse.visual.NodeItem |
m_prevRoot |
protected double |
m_radiusInc |
protected boolean |
m_setTheta |
protected double |
m_theta1 |
protected double |
m_theta2 |
protected double |
m_thetaOffset |
static String |
PARAMS
The data field in which the parameters used by this layout are stored.
|
static prefuse.data.Schema |
PARAMS_SCHEMA
The schema for the parameters used by this layout.
|
| Constructor and Description |
|---|
RadialTreeLayout(String group)
Creates a new RadialTreeLayout.
|
RadialTreeLayout(String group,
int radius)
Creates a new RadialTreeLayout using the specified radius increment
between levels of the layout.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
getAutoScale()
Indicates if the layout automatically scales to fit the layout bounds.
|
double |
getRadiusIncrement()
Set the radius increment to use between concentric circles.
|
protected void |
initSchema(prefuse.data.tuple.TupleSet ts) |
protected void |
layout(prefuse.visual.NodeItem n,
double r,
double theta1,
double theta2)
Compute the layout.
|
void |
reset()
Clears references to graph tuples.
|
void |
run(double frac) |
void |
setAngularBounds(double theta,
double width)
Constrains this layout to the specified angular sector
|
void |
setAutoScale(boolean s)
Set whether or not the layout should automatically scale itself
to fit the layout bounds.
|
protected void |
setPolarLocation(prefuse.visual.NodeItem n,
prefuse.visual.NodeItem p,
double r,
double t)
Set the position of the given node, given in polar co-ordinates.
|
void |
setRadiusIncrement(double inc)
Set the radius increment to use between concentric circles.
|
protected void |
setScale(Rectangle2D bounds) |
getLayoutAnchor, getLayoutBounds, setLayoutAnchor, setLayoutBounds, setMargin, setX, setYaddActivityListener, 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, setStepTimepublic static final int DEFAULT_RADIUS
protected int m_maxDepth
protected double m_radiusInc
protected double m_theta1
protected double m_theta2
protected boolean m_setTheta
protected boolean m_autoScale
protected Point2D m_origin
protected prefuse.visual.NodeItem m_prevRoot
protected double m_thetaOffset
public static final String PARAMS
public static final prefuse.data.Schema PARAMS_SCHEMA
public RadialTreeLayout(String group)
group - the data group to process. This should resolve to
either a Graph or Tree instance.public RadialTreeLayout(String group, int radius)
group - the data group to process. This should resolve to
either a Graph or Tree instance.radius - the radius increment to use between subsequent rings
in the layout.public double getRadiusIncrement()
public void setRadiusIncrement(double inc)
inc - the radius increment between subsequent rings of the layoutsetAutoScale(boolean)public boolean getAutoScale()
public void setAutoScale(boolean s)
s - true to automatically scale to fit display, false otherwisepublic void setAngularBounds(double theta,
double width)
theta - the starting angle, in radianswidth - the angular width, in radianspublic void run(double frac)
run in class prefuse.action.GroupActionAction.run(double)public void reset()
reset in class prefuse.action.layout.graph.TreeLayoutprotected void setScale(Rectangle2D bounds)
protected void layout(prefuse.visual.NodeItem n,
double r,
double theta1,
double theta2)
n - the root of the current subtree under considerationr - the radius, current distance from the centertheta1 - the start (in radians) of this subtree's angular regiontheta2 - the end (in radians) of this subtree's angular regionprotected void setPolarLocation(prefuse.visual.NodeItem n,
prefuse.visual.NodeItem p,
double r,
double t)
n - the NodeItem to set the positionp - the referrer parent NodeItemr - the radiust - the angle thetaprotected void initSchema(prefuse.data.tuple.TupleSet ts)
Copyright © 2017 OpenSource BIM. All rights reserved.