infovis.graph.visualization.layout
Class FRLayout
java.lang.Object
infovis.graph.GraphProxy
infovis.graph.visualization.layout.AbstractGraphLayout
infovis.graph.visualization.layout.RandomGraphLayout
infovis.graph.visualization.layout.BasicSpringLayout
infovis.graph.visualization.layout.FRLayout
- All Implemented Interfaces:
- Graph, NodeLinkGraphLayout, Metadata, Constants, Layout
public class FRLayout
- extends BasicSpringLayout
Implements the Fruchterman-Reingold algorithm for node layout.
Taken almost verbatim from Jung (jung.sourceforge.net)
- Version:
- $Revision: 1.14 $
- Author:
- Jean-Daniel Fekete
- InfoVis factory arguments:
- GraphLayoutFactory "Fruchterman&Reingold (Spring)"
Fields inherited from interface infovis.metadata.Constants |
CONTRIBUTOR, COVERAGE, CREATOR, DATE, DESCRITION, FORMAT, IDENTIFIER, LANGUAGE, PUBLISHER, RELATION, RIGHTS, SOURCE, SUBJECT, TITLE, TYPE |
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.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 |
instance
public static final FRLayout instance
FRLayout
public FRLayout()
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.
repulsiveForce
public double repulsiveForce(double length)
attractiveForce
public double attractiveForce(double length)
calcRepulsion
public void calcRepulsion(int v)
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.
isFinished
public boolean isFinished()
- Returns true once the current iteration has passed the maximum count,
MAX_ITERATIONS.
- Specified by:
isFinished
in interface NodeLinkGraphLayout
- Overrides:
isFinished
in class AbstractGraphLayout
Copyright © 2005 by Jean-Daniel Fekete and INRIA, France All rights reserved.