|
||||||||||
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.FruchtermanReingoldLayout
public class FruchtermanReingoldLayout
Layout instance implementing the Fruchterman-Reingold algorithm for force-directed placement of graph nodes. The computational complexity of this algorithm is quadratic [O(n^2)] in the number of nodes, so should only be applied for relatively small graphs, particularly in interactive situations.
This implementation was ported from the implementation in the JUNG framework.
Nested Class Summary | |
---|---|
static class |
FruchtermanReingoldLayout.Params
Wrapper class holding parameters used for each node in this layout. |
Field Summary | |
---|---|
protected java.lang.String |
m_edgeGroup
|
protected int |
m_fidx
|
protected java.lang.String |
m_nodeGroup
|
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.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 | |
---|---|
FruchtermanReingoldLayout(java.lang.String graph)
Create a new FruchtermanReingoldLayout. |
|
FruchtermanReingoldLayout(java.lang.String graph,
int maxIter)
Create a new FruchtermanReingoldLayout |
Method Summary | |
---|---|
void |
calcAttraction(EdgeItem e)
|
void |
calcPositions(NodeItem n,
java.awt.geom.Rectangle2D b)
|
void |
calcRepulsion(Graph g,
NodeItem n1)
|
int |
getMaxIterations()
Get the maximum number of iterations to run of this algorithm. |
protected void |
initSchema(TupleSet ts)
|
void |
run(double frac)
Runs this Action, triggering whatever processing this Action performs. |
void |
setMaxIterations(int maxIter)
Set the maximum number of iterations to run of this algorithm. |
Methods inherited from class prefuse.action.layout.Layout |
---|
getLayoutAnchor, 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 |
---|
protected java.lang.String m_nodeGroup
protected java.lang.String m_edgeGroup
protected int m_fidx
public static final java.lang.String PARAMS
public static final Schema PARAMS_SCHEMA
Constructor Detail |
---|
public FruchtermanReingoldLayout(java.lang.String graph)
graph
- the data field to layout. Must resolve to a Graph instance.public FruchtermanReingoldLayout(java.lang.String graph, int maxIter)
graph
- the data field to layout. Must resolve to a Graph instance.maxIter
- the maximum number of iterations of the algorithm to runMethod Detail |
---|
public int getMaxIterations()
public void setMaxIterations(int maxIter)
maxIter
- the maximum number of iterations to usepublic void run(double frac)
Action
run
in class GroupAction
frac
- the fraction of this Action's duration that has elapsed.Action.run(double)
public void calcPositions(NodeItem n, java.awt.geom.Rectangle2D b)
public void calcAttraction(EdgeItem e)
public void calcRepulsion(Graph g, NodeItem n1)
protected void initSchema(TupleSet ts)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |