|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.uci.ics.jung.algorithms.layout.AbstractLayout<V,E>
V - the vertex typeE - the edge typepublic abstract class AbstractLayout<V,E>
Abstract class for implementations of Layout. It handles some of the
basic functions: storing coordinates, maintaining the dimensions, initializing
the locations, maintaining locked vertices.
| Field Summary | |
|---|---|
protected Graph<V,E> |
graph
|
protected boolean |
initialized
|
protected Map<V,Point2D> |
locations
|
protected Dimension |
size
|
| Constructor Summary | |
|---|---|
protected |
AbstractLayout(Graph<V,E> graph)
Creates an instance which does not initialize the vertex locations. |
protected |
AbstractLayout(Graph<V,E> graph,
|
protected |
AbstractLayout(Graph<V,E> graph,
|
| Method Summary | |
|---|---|
Graph<V,E> |
getGraph()
Accessor for the graph that represets all vertices. |
Dimension |
getSize()
Returns the current size of the visualization space, accoring to the last call to resize(). |
double |
getX(V v)
Returns the x coordinate of the vertex from the Coordinates object. |
double |
getY(V v)
Returns the y coordinate of the vertex from the Coordinates object. |
boolean |
isLocked(V v)
Returns true if the position of vertex v
is locked. |
void |
lock(boolean lock)
Locks all vertices in place if lock is true, otherwise unlocks all vertices. |
void |
lock(V v,
boolean state)
Locks v in place if state is true, otherwise unlocks it. |
protected void |
offsetVertex(V v,
double xOffset,
double yOffset)
|
void |
setGraph(Graph<V,E> graph)
setter for graph |
void |
setInitializer(
provides initial locations for all vertices. |
void |
setLocation(V picked,
double x,
double y)
Forcibly moves a vertex to the (x,y) location by setting its x and y locations to the inputted location. |
void |
setLocation(V picked,
Point2D p)
set the location of a vertex |
void |
setSize(Dimension size)
When a visualization is resized, it presumably wants to fix the locations of the vertices and possibly to reinitialize its data. |
Point2D |
transform(V v)
|
| 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.algorithms.layout.Layout |
|---|
initialize, reset |
| Field Detail |
|---|
protected Dimension size
protected Graph<V,E> graph
protected boolean initialized
protected Map<V,Point2D> locations
| Constructor Detail |
|---|
protected AbstractLayout(Graph<V,E> graph)
graph - the graph for which the layout algorithm is to be created.
protected AbstractLayout(Graph<V,E> graph,
initializer)
protected AbstractLayout(Graph<V,E> graph,
initializer,
Dimension size)
| Method Detail |
|---|
public void setGraph(Graph<V,E> graph)
Layout
setGraph in interface Layout<V,E>public void setSize(Dimension size)
setSize in interface Layout<V,E>public boolean isLocked(V v)
Layouttrue if the position of vertex v
is locked.
isLocked in interface Layout<V,E>public void setInitializer(initializer)
Layout
setInitializer in interface Layout<V,E>public Dimension getSize()
getSize in interface Layout<V,E>public Point2D transform(V v)
public double getX(V v)
public double getY(V v)
protected void offsetVertex(V v,
double xOffset,
double yOffset)
v - xOffset - yOffset - public Graph<V,E> getGraph()
getGraph in interface Layout<V,E>
public void setLocation(V picked,
double x,
double y)
public void setLocation(V picked,
Point2D p)
Layout
setLocation in interface Layout<V,E>
public void lock(V v,
boolean state)
v in place if state is true, otherwise unlocks it.
lock in interface Layout<V,E>v - vertexpublic void lock(boolean lock)
lock is true, otherwise unlocks all vertices.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||