edu.uci.ics.jung.visualization.contrib
Class CircleLayout

java.lang.Object
  extended by edu.uci.ics.jung.visualization.AbstractLayout
      extended by edu.uci.ics.jung.visualization.contrib.CircleLayout
All Implemented Interfaces:
ChangeEventSupport, Layout, VertexLocationFunction

public class CircleLayout
extends AbstractLayout

Positions vertices equally spaced on a regular circle. Does not respect filter calls.

Author:
Masanori Harada

Nested Class Summary
static class CircleLayout.CircleVertexData
           
 
Field Summary
 
Fields inherited from class edu.uci.ics.jung.visualization.AbstractLayout
changeSupport, vertex_locations
 
Constructor Summary
CircleLayout(Graph g)
           
 
Method Summary
 void advancePositions()
          Do nothing.
 CircleLayout.CircleVertexData getCircleData(Vertex v)
           
 Object getKey()
          Returns a visualization-specific key (that is, specific both to this instance and AbstractLayout) that can be used to access UserData related to the AbstractLayout.
 double getRadius()
           
 String getStatus()
          Returns the current status of the sytem, or null if there is no particular status to report.By default, an AbstractLayout returns null for its status.
 boolean incrementsAreDone()
          Returns true;
protected  void initialize_local_vertex(Vertex v)
          Initializes the local information on a single vertex.
protected  void initialize_local()
          Initializes all local information, and is called immediately within the initialize() process.
protected  void initializeLocations()
          This method calls initialize_local_vertex for each vertex, and also adds initial coordinate information for each vertex.
 boolean isIncremental()
          This one is not incremental.
 void orderVertices(Vertex[] vertices)
          Specifies the order of vertices.
 void setRadius(double radius)
           
 
Methods inherited from class edu.uci.ics.jung.visualization.AbstractLayout
addChangeListener, applyFilter, dontMove, fireStateChanged, forceMove, getAVertex, getBaseKey, getChangeListeners, getCoordinates, getCurrentSize, getEdge, getEdge, getGraph, getLocation, getVertex, getVertex, getVertexIterator, getVisibleEdges, getVisibleGraph, getVisibleVertices, getX, getY, initialize, initialize, initializeLocation, 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
 

Constructor Detail

CircleLayout

public CircleLayout(Graph g)
Method Detail

getStatus

public String getStatus()
Description copied from class: AbstractLayout
Returns the current status of the sytem, or null if there is no particular status to report. Useful for reporting things like number of iterations passed, temperature, and so on.By default, an AbstractLayout returns null for its status.

Specified by:
getStatus in interface Layout
Overrides:
getStatus in class AbstractLayout
Returns:
the status, as a string

isIncremental

public boolean isIncremental()
This one is not incremental.


incrementsAreDone

public boolean incrementsAreDone()
Returns true;


getRadius

public double getRadius()

setRadius

public void setRadius(double radius)

orderVertices

public void orderVertices(Vertex[] vertices)
Specifies the order of vertices. The first element of the specified array will be positioned with angle 0 (on the X axis), and the second one will be positioned with angle 1/n, and the third one will be positioned with angle 2/n, and so on.

The default implemention shuffles elements randomly.


getKey

public Object getKey()
Returns a visualization-specific key (that is, specific both to this instance and AbstractLayout) that can be used to access UserData related to the AbstractLayout.


initialize_local_vertex

protected void initialize_local_vertex(Vertex v)
Description copied from class: AbstractLayout
Initializes the local information on a single vertex. The user is responsible for overriding this method to do any vertex-level construction that may be necessary: for example, to attach vertex-level information to each vertex.

Specified by:
initialize_local_vertex in class AbstractLayout

initialize_local

protected void initialize_local()
Description copied from class: AbstractLayout
Initializes all local information, and is called immediately within the initialize() process. The user is responsible for overriding this method to do any construction that may be necessary: for example, to initialize local per-edge or graph-wide data.

Overrides:
initialize_local in class AbstractLayout

initializeLocations

protected void initializeLocations()
Description copied from class: AbstractLayout
This method calls initialize_local_vertex for each vertex, and also adds initial coordinate information for each vertex. (The vertex's initial location is set by calling initializeLocation.

Overrides:
initializeLocations in class AbstractLayout

getCircleData

public CircleLayout.CircleVertexData getCircleData(Vertex v)

advancePositions

public void advancePositions()
Do nothing.

Specified by:
advancePositions in interface Layout
Specified by:
advancePositions in class AbstractLayout
See Also:
Layout.advancePositions()