infovis.graph.visualization.layout
Class SpringLayout

java.lang.Object
  extended by infovis.graph.GraphProxy
      extended by infovis.graph.visualization.layout.AbstractGraphLayout
          extended by infovis.graph.visualization.layout.RandomGraphLayout
              extended by infovis.graph.visualization.layout.BasicSpringLayout
                  extended by infovis.graph.visualization.layout.SpringLayout
All Implemented Interfaces:
Graph, NodeLinkGraphLayout, Metadata, Constants, Layout

public class SpringLayout
extends BasicSpringLayout

Class SpringLayout

Version:
$Revision: 1.10 $
Author:
Jean-Daniel Fekete
InfoVis factory arguments:
GraphLayoutFactory "Spring"

Nested Class Summary
static interface SpringLayout.LengthFunction
          If the edge is weighted, then override this method to show what the visualized length is.
static class SpringLayout.UnitLengthFunction
          Returns all edges as the same length: the input value
 
Field Summary
static int RANGE
           
static double STRETCH
           
static SpringLayout.LengthFunction UNITLENGTHFUNCTION
           
 
Fields inherited from class infovis.graph.visualization.layout.BasicSpringLayout
EPSILON
 
Fields inherited from class infovis.graph.visualization.layout.RandomGraphLayout
instance
 
Fields inherited from class infovis.graph.visualization.layout.AbstractGraphLayout
COLUMN_FIXED
 
Fields inherited from interface infovis.Graph
GRAPH_TYPE, GRAPH_TYPE_DIRECTED, GRAPH_TYPE_UNDIRECTED, NIL
 
Fields inherited from interface infovis.metadata.Constants
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE
 
Constructor Summary
SpringLayout()
           
SpringLayout(SpringLayout.LengthFunction fn)
           
 
Method Summary
 void calcAttraction(int e)
           
 boolean calcPosition(int v)
          Calculates the new position of the specified vertex.
 void calcRepulsion(int v1)
           
 String getName()
          Returns the Graph name.
 void initializeEdges()
           
 void initializeLayout(Rectangle2D bounds)
           
 boolean isFinished()
           
 
Methods inherited from class infovis.graph.visualization.layout.BasicSpringLayout
computeShapes, dist, dontMove, getMaxIterations, getX, getY, incrementLayout, isIncremental, setMaxIterations, setX, setY
 
Methods inherited from class infovis.graph.visualization.layout.RandomGraphLayout
getEngine, getInstance, initRect, nextDouble, setEngine, setInstance
 
Methods inherited from class infovis.graph.visualization.layout.AbstractGraphLayout
computeShapes, createRect, getBounds, getLinkShapes, getOrientation, getParent, getPreferredSize, getRectAt, getShapes, getVisualization, invalidate, setRectSizeAt, setShapeAt
 
Methods inherited from class infovis.graph.GraphProxy
addEdge, addGraphChangedListener, addVertex, clear, edgeIterator, edgeIterator, findEdge, getClientProperty, getDegree, getEdge, getEdgesCount, getEdgeTable, getFirstVertex, getGraph, getInDegree, getInEdgeAt, getMetadata, getOtherVertex, getOutDegree, getOutEdgeAt, getSecondVertex, getVertexTable, getVerticesCount, inEdgeIterator, isDirected, outEdgeIterator, removeEdge, removeGraphChangedListener, removeVertex, setDirected, setGraph, setName, vertexIterator
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RANGE

public static final int RANGE
See Also:
Constant Field Values

STRETCH

public static final double STRETCH
See Also:
Constant Field Values

UNITLENGTHFUNCTION

public static final SpringLayout.LengthFunction UNITLENGTHFUNCTION
Constructor Detail

SpringLayout

public SpringLayout()

SpringLayout

public SpringLayout(SpringLayout.LengthFunction fn)
Method Detail

getName

public String getName()
Description copied from interface: Graph
Returns the Graph name.

Specified by:
getName in interface Graph
Specified by:
getName in interface Layout
Overrides:
getName in class GraphProxy
Returns:
the Graph name.

initializeLayout

public void initializeLayout(Rectangle2D bounds)

isFinished

public boolean isFinished()
Specified by:
isFinished in interface NodeLinkGraphLayout
Overrides:
isFinished in class AbstractGraphLayout

initializeEdges

public void initializeEdges()

calcRepulsion

public void calcRepulsion(int v1)

calcAttraction

public void calcAttraction(int e)

calcPosition

public boolean calcPosition(int v)
Description copied from class: BasicSpringLayout
Calculates the new position of the specified vertex.

Parameters:
v - the vertex
Returns:
true if the node has moved, false otherwise.


Copyright 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.