|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alveole.studio.web.designer.graph.CustomLayout
public class CustomLayout
This class is a custom settable layout. This is a simple implementation of a Jung layout. It embeds a native Jung implementation layout, but enables to change node positions and to save them into project UI preferences.
Field Summary | |
---|---|
protected java.util.Properties |
currentPackageProps
Current UI props for the edited package. |
protected java.awt.Dimension |
currentSize
The current dimension. |
protected edu.uci.ics.jung.graph.Graph |
g
The current graph. |
protected edu.uci.ics.jung.visualization.FRLayout |
initial
The default layout. |
protected java.util.ArrayList<javax.swing.event.ChangeListener> |
listeners
List of all change listeners. |
protected java.util.ArrayList<edu.uci.ics.jung.graph.Vertex> |
lockedVertices
List of licked vertices. |
protected java.util.HashMap<edu.uci.ics.jung.graph.ArchetypeVertex,java.awt.geom.Point2D> |
vertexPositions
List of all vertex positions. |
protected edu.uci.ics.jung.graph.Graph |
visibleGraph
The visible graph. |
Constructor Summary | |
---|---|
CustomLayout(edu.uci.ics.jung.graph.Graph g,
java.util.Properties currentPackageProps,
boolean relayout)
Constructor. |
Method Summary | |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener l)
Add a change listener. |
void |
advancePositions()
|
void |
applyFilter(edu.uci.ics.jung.graph.Graph subgraph)
Store a visibility mask. |
void |
fireStateChanged()
Inform listeners that state changed. |
void |
forceMove(edu.uci.ics.jung.graph.Vertex picked,
double x,
double y)
Moves a vertex to a point. |
javax.swing.event.ChangeListener[] |
getChangeListeners()
Get list of change-listeners. |
java.awt.Dimension |
getCurrentSize()
Get current size for layout. |
edu.uci.ics.jung.graph.Graph |
getGraph()
Get associated graph. |
edu.uci.ics.jung.visualization.Layout |
getInitial()
Get initial layout. |
java.awt.geom.Point2D |
getLocation(edu.uci.ics.jung.graph.ArchetypeVertex v)
Get a location for the given vertex. |
java.lang.String |
getStatus()
Get status. |
edu.uci.ics.jung.graph.Vertex |
getVertex(double x,
double y)
Get a vertex given its [x,y]. |
edu.uci.ics.jung.graph.Vertex |
getVertex(double x,
double y,
double maxDistance)
Get a vertex given its [x,y]. |
java.util.Iterator |
getVertexIterator()
Get all vertices. |
java.util.Set |
getVisibleEdges()
Get visible edges. |
java.util.Set |
getVisibleVertices()
Get visible vertices. |
double |
getX(edu.uci.ics.jung.graph.Vertex v)
Get X for given vertex. |
double |
getY(edu.uci.ics.jung.graph.Vertex v)
Get Y for given vertex. |
boolean |
incrementsAreDone()
See parent interface. |
void |
initialize(java.awt.Dimension currentSize)
Initialize layout. |
boolean |
isIncremental()
Is incremental. |
boolean |
isLocked(edu.uci.ics.jung.graph.Vertex v)
Check if a given vertex is locked. |
void |
lockVertex(edu.uci.ics.jung.graph.Vertex v)
Lock the given vertex. |
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Remove a change listener. |
void |
resize(java.awt.Dimension d)
Change layout size. |
void |
restart()
Restart layout. |
void |
setInitial(edu.uci.ics.jung.visualization.FRLayout initial)
Set initial layout. |
void |
setLocation(edu.uci.ics.jung.graph.ArchetypeVertex v,
java.awt.geom.Point2D location)
Sets a vertex location. |
void |
unlockVertex(edu.uci.ics.jung.graph.Vertex v)
Unlock the given vertex. |
void |
update()
Update layout. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected edu.uci.ics.jung.graph.Graph g
protected edu.uci.ics.jung.graph.Graph visibleGraph
protected edu.uci.ics.jung.visualization.FRLayout initial
protected java.awt.Dimension currentSize
protected java.util.ArrayList<edu.uci.ics.jung.graph.Vertex> lockedVertices
protected java.util.HashMap<edu.uci.ics.jung.graph.ArchetypeVertex,java.awt.geom.Point2D> vertexPositions
protected java.util.ArrayList<javax.swing.event.ChangeListener> listeners
protected java.util.Properties currentPackageProps
Constructor Detail |
---|
public CustomLayout(edu.uci.ics.jung.graph.Graph g, java.util.Properties currentPackageProps, boolean relayout)
g
- The associated graph.currentPackageProps
- The UI properties of the current package.Method Detail |
---|
public void advancePositions()
advancePositions
in interface edu.uci.ics.jung.visualization.Layout
public void applyFilter(edu.uci.ics.jung.graph.Graph subgraph)
applyFilter
in interface edu.uci.ics.jung.visualization.Layout
the
- subgraph.public void forceMove(edu.uci.ics.jung.graph.Vertex picked, double x, double y)
forceMove
in interface edu.uci.ics.jung.visualization.Layout
picked
- The vertex to move.x
- The X.y
- The Y.public java.awt.Dimension getCurrentSize()
getCurrentSize
in interface edu.uci.ics.jung.visualization.Layout
public edu.uci.ics.jung.graph.Graph getGraph()
getGraph
in interface edu.uci.ics.jung.visualization.Layout
Associated
- graph.public java.awt.geom.Point2D getLocation(edu.uci.ics.jung.graph.ArchetypeVertex v)
getLocation
in interface edu.uci.ics.jung.visualization.Layout
getLocation
in interface edu.uci.ics.jung.visualization.VertexLocationFunction
v
- The vertex to find.
public java.lang.String getStatus()
getStatus
in interface edu.uci.ics.jung.visualization.Layout
public edu.uci.ics.jung.graph.Vertex getVertex(double x, double y)
getVertex
in interface edu.uci.ics.jung.visualization.Layout
x
- The X.y
- The Y.
public edu.uci.ics.jung.graph.Vertex getVertex(double x, double y, double maxDistance)
getVertex
in interface edu.uci.ics.jung.visualization.Layout
x
- The X.y
- The Y.maxDistance
- A max distance for lookup.
public java.util.Iterator getVertexIterator()
getVertexIterator
in interface edu.uci.ics.jung.visualization.VertexLocationFunction
public java.util.Set getVisibleEdges()
getVisibleEdges
in interface edu.uci.ics.jung.visualization.Layout
public java.util.Set getVisibleVertices()
getVisibleVertices
in interface edu.uci.ics.jung.visualization.Layout
public double getX(edu.uci.ics.jung.graph.Vertex v)
getX
in interface edu.uci.ics.jung.visualization.Layout
v
- The vertex.
public double getY(edu.uci.ics.jung.graph.Vertex v)
getY
in interface edu.uci.ics.jung.visualization.Layout
v
- The vertex to lookup.
public boolean incrementsAreDone()
incrementsAreDone
in interface edu.uci.ics.jung.visualization.Layout
public void initialize(java.awt.Dimension currentSize)
initialize
in interface edu.uci.ics.jung.visualization.Layout
currentSize
- The initial size.public boolean isIncremental()
isIncremental
in interface edu.uci.ics.jung.visualization.Layout
public boolean isLocked(edu.uci.ics.jung.graph.Vertex v)
isLocked
in interface edu.uci.ics.jung.visualization.Layout
v
- The vertex to check.
public void lockVertex(edu.uci.ics.jung.graph.Vertex v)
lockVertex
in interface edu.uci.ics.jung.visualization.Layout
v
- The vertex to lock.public void resize(java.awt.Dimension d)
resize
in interface edu.uci.ics.jung.visualization.Layout
d
- The new size.public void restart()
restart
in interface edu.uci.ics.jung.visualization.Layout
public void unlockVertex(edu.uci.ics.jung.graph.Vertex v)
unlockVertex
in interface edu.uci.ics.jung.visualization.Layout
v
- The vertex to unlock.public void addChangeListener(javax.swing.event.ChangeListener l)
addChangeListener
in interface edu.uci.ics.jung.utils.ChangeEventSupport
l
- The listener.public void fireStateChanged()
fireStateChanged
in interface edu.uci.ics.jung.utils.ChangeEventSupport
public javax.swing.event.ChangeListener[] getChangeListeners()
getChangeListeners
in interface edu.uci.ics.jung.utils.ChangeEventSupport
public void removeChangeListener(javax.swing.event.ChangeListener l)
removeChangeListener
in interface edu.uci.ics.jung.utils.ChangeEventSupport
l
- The listener.public void setLocation(edu.uci.ics.jung.graph.ArchetypeVertex v, java.awt.geom.Point2D location)
setLocation
in interface edu.uci.ics.jung.visualization.SettableVertexLocationFunction
v
- The vertex.location
- The new location.public edu.uci.ics.jung.visualization.Layout getInitial()
public void setInitial(edu.uci.ics.jung.visualization.FRLayout initial)
initial
- The layout.public void update()
update
in interface edu.uci.ics.jung.visualization.LayoutMutable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |