|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.uci.ics.jung.algorithms.layout3d.AbstractLayout<V,E> edu.uci.ics.jung.algorithms.layout3d.SpringLayout<V,E>
public class SpringLayout<V,E>
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<E>
If the edge is weighted, then override this method to show what the visualized length is. |
class |
SpringLayout.SpringDimensionChecker
|
protected static class |
SpringLayout.SpringEdgeData<E>
|
protected static class |
SpringLayout.SpringVertexData
|
static class |
SpringLayout.UnitLengthFunction<E>
Returns all edges as the same length: the input value |
Field Summary | |
---|---|
protected double |
force_multiplier
|
protected SpringLayout.LengthFunction<E> |
lengthFunction
|
protected int |
repulsion_range
|
protected double |
stretch
|
static SpringLayout.LengthFunction |
UNITLENGTHFUNCTION
|
Fields inherited from class edu.uci.ics.jung.algorithms.layout3d.AbstractLayout |
---|
locations |
Constructor Summary | |
---|---|
SpringLayout(Graph<V,E> g)
Constructor for a SpringLayout for a raw graph with associated dimension--the input knows how big the graph is. |
|
SpringLayout(Graph<V,E> g,
SpringLayout.LengthFunction<E> f)
Constructor for a SpringLayout for a raw graph with associated component. |
Method Summary | |
---|---|
protected void |
calcEdgeLength(SpringLayout.SpringEdgeData<E> sed,
SpringLayout.LengthFunction<E> f)
|
protected void |
calculateRepulsion()
|
boolean |
done()
For now, we pretend it never finishes. |
protected V |
getAVertex(E e)
|
double |
getForceMultiplier()
|
double |
getLength(E e)
|
int |
getRepulsionRange()
|
SpringLayout.SpringEdgeData<E> |
getSpringData(E e)
|
SpringLayout.SpringVertexData |
getSpringData(V v)
|
double |
getStretch()
|
void |
initialize()
Initializer, calls intialize_local and initializeLocations to start construction process. |
boolean |
isIncremental()
This one is an incremental visualization |
protected void |
moveNodes()
|
protected void |
relaxEdges()
|
void |
reset()
|
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 |
setSize(javax.media.j3d.BoundingSphere bs)
When a visualization is resized, it presumably wants to fix the locations of the vertices and possibly to reinitialize its data. |
void |
setStretch(double stretch)
Sets the stretch parameter for this instance. |
void |
step()
Relaxation step. |
Methods inherited from class edu.uci.ics.jung.algorithms.layout3d.AbstractLayout |
---|
getGraph, getSize, getVertices, getX, getY, isLocked, lock, lock, offsetVertex, setGraph, setInitializer, setLocation, setLocation, transform |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected double stretch
protected SpringLayout.LengthFunction<E> lengthFunction
protected int repulsion_range
protected double force_multiplier
public static final SpringLayout.LengthFunction UNITLENGTHFUNCTION
Constructor Detail |
---|
public SpringLayout(Graph<V,E> g)
public SpringLayout(Graph<V,E> g, SpringLayout.LengthFunction<E> f)
g
- the input Graphf
- the length functionMethod Detail |
---|
public double getStretch()
setStretch(double)
public void setSize(javax.media.j3d.BoundingSphere bs)
AbstractLayout
setSize
in interface Layout<V,E>
setSize
in class AbstractLayout<V,E>
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)
public void initialize()
AbstractLayout
initialize
in interface Layout<V,E>
initialize
in class AbstractLayout<V,E>
protected void calcEdgeLength(SpringLayout.SpringEdgeData<E> sed, SpringLayout.LengthFunction<E> f)
public void step()
step
in interface IterativeContext
protected V getAVertex(E e)
protected void relaxEdges()
protected void calculateRepulsion()
protected void moveNodes()
public SpringLayout.SpringVertexData getSpringData(V v)
public SpringLayout.SpringEdgeData<E> getSpringData(E e)
public double getLength(E e)
public boolean isIncremental()
public boolean done()
done
in interface IterativeContext
public void reset()
reset
in interface Layout<V,E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |