|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectedu.uci.ics.jung.visualization.FadingVertexLayout
Implements a pass-through visaulizer that fades out nodes that have been removed, and fades in nodes that have appeared. Adds a field FADINGNODEVIZ to the nodes, which directs the _Renderer to view those nodes as faded.
In order to use this class, create a FadingNodeLayout that takes as an arguemnt the Layout you actually wish to use:
Layout v= new FadingNodeLayout( 10, new SpringLayout( g ));In order to operate, this implementation tracks the vertices that are visible before and after each call to applyFilte.
In this documentaiton, code that is labelled as a passthrough has no functionality except to pass the data through to the contained layout.
Be sure to use a _Renderer that knows to pay attention to the Fading information. In particular, it must know that the FADINGNODEVIZ field gives information about the fade level.
| Nested Class Summary | |
class |
FadingVertexLayout.FadingVertexLayoutData
|
| Constructor Summary | |
FadingVertexLayout(int fadelevels,
Layout layout)
Adds user data to every vertex in the graph. |
|
| Method Summary | |
void |
advancePositions()
In addition to being a passthrough, this also advances the fade function by calling tick |
void |
applyFilter(Graph g_int)
Tracks the changes in the set of visible vertices from the set of actual vertices. |
void |
forceMove(Vertex picked,
int x,
int y)
Simply passes through the vertex. |
java.awt.Dimension |
getCurrentSize()
Returns the current size of the visualization's space. |
int |
getFadeLevel(Vertex v)
Static utility function returns the fade level of a given vertex. |
java.lang.Object |
getFadingKey()
|
Graph |
getGraph()
A pass-through. |
int |
getMaxLevel()
Returns the number of levels that vertices fade through. |
java.lang.String |
getStatus()
Returns the current status of the sytem, or null if there is no particular status to report. |
Vertex |
getVertex(double x,
double y)
A pass-through. |
Vertex |
getVertex(double x,
double y,
double maxDistance)
A pass-through. |
java.util.Set |
getVisibleEdges()
Returns *all* edges. |
java.util.Set |
getVisibleVertices()
Returns both the visible and the hidden vertices. |
double |
getX(Vertex vert)
Passthrough. |
double |
getY(Vertex vert)
Passthrough. |
boolean |
incrementsAreDone()
Passthrough. |
void |
initialize(java.awt.Dimension d)
A pass-through to the contained Layout |
boolean |
isHidden(Vertex v)
Static utility function returns the fade level of a given vertex. |
boolean |
isIncremental()
Passthrough. |
void |
lockVertex(Vertex vert)
Passthrough. |
void |
resize(java.awt.Dimension d)
Passthrough. |
void |
restart()
Passthrough. |
void |
unlockVertex(Vertex vert)
Passthrough. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FadingVertexLayout(int fadelevels,
Layout layout)
fadelevels - The number of levels through which
a vertex should fade once it is removed.| Method Detail |
public java.awt.Dimension getCurrentSize()
Layout
getCurrentSize in interface Layoutpublic void initialize(java.awt.Dimension d)
initialize in interface Layoutpublic java.lang.String getStatus()
Layout
getStatus in interface Layoutpublic java.util.Set getVisibleEdges()
getVisibleEdges in interface LayoutLayout.getVisibleEdges()public Graph getGraph()
getGraph in interface LayoutLayout.getGraph()
public Vertex getVertex(double x,
double y)
getVertex in interface Layoutx - The x coordinate of the inputy - The y coordinate of the input
Layout.getVertex(double, double)
public Vertex getVertex(double x,
double y,
double maxDistance)
getVertex in interface Layoutx - The x coordinate of the inputy - The y coordinate of the inputmaxDistance - The maximum acceptable distance. Beyond this, vertices are ignored.
Layout.getVertex(double, double, double)public void advancePositions()
tick
advancePositions in interface LayoutLayout.advancePositions()public java.lang.Object getFadingKey()
public void applyFilter(Graph g_int)
applyFilter in interface Layoutg_int - a filtered graph that is a subgraph of the Graph returned by getGraphLayout.applyFilter(edu.uci.ics.jung.graph.Graph)public void resize(java.awt.Dimension d)
resize in interface Layoutd - Layout.resize(java.awt.Dimension)public void restart()
restart in interface LayoutLayout.restart()public double getX(Vertex vert)
getX in interface Layoutvert - The vertex being examined
Layout.getX(edu.uci.ics.jung.graph.Vertex)public double getY(Vertex vert)
getY in interface Layoutvert - The vertex being examined
Layout.getX(edu.uci.ics.jung.graph.Vertex)public java.util.Set getVisibleVertices()
getVisibleVertices. Where usually only visible
vertices would be passed, this function also passes the
hidden ones, and counts on the _Renderer (or other calling
client) to know what to do with it appropriately. This is done
in order to ensure that fading vertices are still shown.
getVisibleVertices in interface LayoutLayout.getVisibleVertices()public int getFadeLevel(Vertex v)
v - public boolean isHidden(Vertex v)
v - public void lockVertex(Vertex vert)
lockVertex in interface Layoutvert - vertexLayout.lockVertex(edu.uci.ics.jung.graph.Vertex)public void unlockVertex(Vertex vert)
unlockVertex in interface Layoutvert - vertexLayout.unlockVertex(edu.uci.ics.jung.graph.Vertex)
public void forceMove(Vertex picked,
int x,
int y)
forceMove in interface Layoutpicked - x - y - Layout.forceMove(edu.uci.ics.jung.graph.Vertex, int, int)public int getMaxLevel()
public boolean isIncremental()
isIncremental in interface LayoutLayout.isIncremental()public boolean incrementsAreDone()
incrementsAreDone in interface LayoutLayout.incrementsAreDone()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||