|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.jung.visualization.AbstractLayout
edu.uci.ics.jung.visualization.SpringLayout
public class SpringLayout
The SpringLayout package represents a visualization of a set of nodes. The
SpringLayout, which is initialized with a Graph, assigns X/Y locations to
each node. When called relax()
, the SpringLayout moves the
visualization forward one step.
Nested Class Summary | |
---|---|
static interface |
SpringLayout.LengthFunction
If the edge is weighted, then override this method to show what the visualized length is. |
class |
SpringLayout.SpringDimensionChecker
|
protected static class |
SpringLayout.SpringEdgeData
|
protected static class |
SpringLayout.SpringVertexData
|
static class |
SpringLayout.UnitLengthFunction
Returns all edges as the same length: the input value |
Field Summary | |
---|---|
protected double |
force_multiplier
|
protected SpringLayout.LengthFunction |
lengthFunction
|
protected int |
repulsion_range
|
protected double |
stretch
|
static SpringLayout.LengthFunction |
UNITLENGTHFUNCTION
|
Fields inherited from class edu.uci.ics.jung.visualization.AbstractLayout |
---|
changeSupport, vertex_locations |
Constructor Summary | |
---|---|
SpringLayout(Graph g)
Constructor for a SpringLayout for a raw graph with associated dimension--the input knows how big the graph is. |
|
SpringLayout(Graph g,
SpringLayout.LengthFunction f)
Constructor for a SpringLayout for a raw graph with associated component. |
Method Summary | |
---|---|
void |
advancePositions()
Relaxation step. |
protected void |
calcEdgeLength(SpringLayout.SpringEdgeData sed,
SpringLayout.LengthFunction f)
|
protected void |
calculateRepulsion()
|
protected Vertex |
getAVertex(Edge e)
Utility method, gets a single vertex from this edge. |
double |
getForceMultiplier()
|
double |
getLength(Edge e)
|
int |
getRepulsionRange()
|
SpringLayout.SpringEdgeData |
getSpringData(Edge e)
|
SpringLayout.SpringVertexData |
getSpringData(Vertex v)
|
Object |
getSpringKey()
|
String |
getStatus()
Returns the status. |
double |
getStretch()
|
boolean |
incrementsAreDone()
For now, we pretend it never finishes. |
protected void |
initialize_local_vertex(Vertex v)
(non-Javadoc) |
protected void |
initialize_local()
Initializes all local information, and is called immediately within the initialize() process. |
boolean |
isIncremental()
This one is an incremental visualization |
protected void |
moveNodes()
|
protected void |
relaxEdges()
|
void |
setForceMultiplier(double force)
Sets the force multiplier for this instance. |
void |
setRepulsionRange(int range)
Sets the node repulsion range (in drawing area units) for this instance. |
void |
setStretch(double stretch)
Sets the stretch parameter for this instance. |
void |
update()
|
Methods inherited from class edu.uci.ics.jung.visualization.AbstractLayout |
---|
addChangeListener, applyFilter, dontMove, fireStateChanged, forceMove, getBaseKey, getChangeListeners, getCoordinates, getCurrentSize, getEdge, getEdge, getGraph, getLocation, getVertex, getVertex, getVertexIterator, getVisibleEdges, getVisibleGraph, getVisibleVertices, getX, getY, initialize, initialize, initializeLocation, initializeLocations, isLocked, lockVertex, offsetVertex, postInitialize, removeChangeListener, resize, restart, unlockVertex |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.uci.ics.jung.visualization.Layout |
---|
applyFilter, forceMove, getCurrentSize, getGraph, getLocation, getVertex, getVertex, getVisibleEdges, getVisibleVertices, getX, getY, initialize, isLocked, lockVertex, resize, restart, unlockVertex |
Methods inherited from interface edu.uci.ics.jung.visualization.VertexLocationFunction |
---|
getVertexIterator |
Field Detail |
---|
protected double stretch
protected SpringLayout.LengthFunction lengthFunction
protected int repulsion_range
protected double force_multiplier
public static final SpringLayout.LengthFunction UNITLENGTHFUNCTION
Constructor Detail |
---|
public SpringLayout(Graph g)
public SpringLayout(Graph g, SpringLayout.LengthFunction f)
g
- the input Graphf
- the length functionMethod Detail |
---|
public String getStatus()
getStatus
in interface Layout
getStatus
in class AbstractLayout
public double getStretch()
setStretch(double)
public void setStretch(double stretch)
Sets the stretch parameter for this instance. This value specifies how much the degrees of an edge's incident vertices should influence how easily the endpoints of that edge can move (that is, that edge's tendency to change its length).
The default value is 0.70. Positive values less than 1 cause high-degree vertices to move less than low-degree vertices, and values > 1 cause high-degree vertices to move more than low-degree vertices. Negative values will have unpredictable and inconsistent results.
stretch
- public int getRepulsionRange()
setRepulsionRange(int)
public void setRepulsionRange(int range)
range
- public double getForceMultiplier()
setForceMultiplier(double)
public void setForceMultiplier(double force)
protected void initialize_local()
AbstractLayout
initialize_local
in class AbstractLayout
public Object getSpringKey()
protected void initialize_local_vertex(Vertex v)
initialize_local_vertex
in class AbstractLayout
AbstractLayout.initialize_local_vertex(edu.uci.ics.jung.graph.Vertex)
protected void calcEdgeLength(SpringLayout.SpringEdgeData sed, SpringLayout.LengthFunction f)
public void advancePositions()
advancePositions
in interface Layout
advancePositions
in class AbstractLayout
Layout.advancePositions()
protected Vertex getAVertex(Edge e)
AbstractLayout
getAVertex
in class AbstractLayout
protected void relaxEdges()
protected void calculateRepulsion()
protected void moveNodes()
public SpringLayout.SpringVertexData getSpringData(Vertex v)
public SpringLayout.SpringEdgeData getSpringData(Edge e)
public double getLength(Edge e)
public boolean isIncremental()
isIncremental
in interface Layout
public boolean incrementsAreDone()
incrementsAreDone
in interface Layout
public void update()
update
in interface LayoutMutable
LayoutMutable.update()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |