|
Cytoscape 2.2 (c) 2004 ISB, MSKCC, UCSD | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcytoscape.layout.AbstractLayout
The AbstractLayout provides nice starting point for Layouts written for Cytoscape.
Constructor Summary | |
AbstractLayout(CyNetworkView networkView)
The Constructor is null |
Method Summary | |
void |
advancePositions()
Implementors must override this method in order to create a Layout. |
void |
cancel()
Gets called when the user clicks on the Cancel button of the progress monitor. |
abstract Object |
construct()
|
void |
doLayout()
|
boolean |
done()
Returns true if the task is done. |
boolean |
dontMove(NodeView nv)
|
void |
forceMove(NodeView 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. |
int |
getCurrent()
Returns the currentProgress parameter. |
Dimension |
getCurrentSize()
Returns the current size of the visualization space, accoring to the last call to resize(). |
int |
getLengthOfTask()
Returns the lenghtOfTask parameter. |
String |
getMessage()
Returns a String, possibly the message to be printed on a dialog. |
String |
getName()
|
NodeView |
getNodeView(double x,
double y)
|
String |
getStatus()
{@inheritDoc} By default, an AbstractLayout returns null for its status. |
String |
getTaskName()
Returns a String, possibly the message that describes the task being performed. |
void |
go(boolean wait)
Initializes currentProgress (generally to zero) and then spawns a SwingWorker to start doing the work. |
void |
incrementProgress()
Increments the progress by one |
void |
initialize()
Initializer, calls intialize_local and initializeLocations to start construction process. |
void |
lockNode(NodeView v)
Adds the NodeView to the DontMove list |
void |
lockNodes(NodeView[] nodes)
|
void |
move(double x,
double y)
|
void |
resize(Dimension size)
When a visualizetion is resized, it presumably wants to fix the locations of the vertices and possibly to reinitialize its data. |
void |
restart()
Restarts the visualization entirely, as if the the user had pressed the "scramble" button. |
void |
setSingle(double x,
double y)
|
void |
stop()
Stops the task by simply setting currentProgress to lengthOfTask, or if a boolean "done" variable is used, setting it to true. |
void |
unlockNode(NodeView v)
Removes the NodeView from the DontMove list |
boolean |
wasCanceled()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractLayout(CyNetworkView networkView)
Method Detail |
public abstract Object construct()
public String getMessage()
MonitoredTask
getMessage
in interface MonitoredTask
public String getTaskName()
MonitoredTask
getTaskName
in interface MonitoredTask
public String getName()
public boolean done()
MonitoredTask
done
in interface MonitoredTask
public void cancel()
cancel
in interface MonitoredTask
public boolean wasCanceled()
wasCanceled
in interface MonitoredTask
public void stop()
MonitoredTask
stop
in interface MonitoredTask
public void incrementProgress()
MonitoredTask
incrementProgress
in interface MonitoredTask
public int getCurrent()
MonitoredTask
getCurrent
in interface MonitoredTask
public int getLengthOfTask()
MonitoredTask
getLengthOfTask
in interface MonitoredTask
public void go(boolean wait)
go
in interface MonitoredTask
wait
- whether or not the method should wait for the task to be done before returning
if true, should call SwingWorker.get() before returningpublic void doLayout()
doLayout
in interface LayoutAlgorithm
public boolean dontMove(NodeView nv)
public void initialize()
public String getStatus()
public void advancePositions()
Note that "locked" vertices are not to be moved; however, it is the policy of the visualization to decide how to handle them, and what to do with the vertices around them. Prototypical code might include a clipping like
for (Iterator i = getVertices().iterator(); i.hasNext() ) { Vertex v = (Vertex) i.next(); if (! dontmove.contains( v ) ) { ... // handle the node } else { // ignore the node } }
Layout#advancePositions()
public Dimension getCurrentSize()
public void move(double x, double y)
public void setSingle(double x, double y)
public void resize(Dimension size)
public void restart()
public NodeView getNodeView(double x, double y)
public void forceMove(NodeView picked, double x, double y)
public void lockNodes(NodeView[] nodes)
lockNodes
in interface LayoutAlgorithm
public void lockNode(NodeView v)
lockNode
in interface LayoutAlgorithm
public void unlockNode(NodeView v)
unlockNode
in interface LayoutAlgorithm
|
www.cytoscape.org | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |