org.graffiti.plugin.algorithm
Class AbstractThreadSaveLayoutAlgorithm

java.lang.Object
  extended by org.graffiti.plugin.AbstractParametrizable
      extended by org.graffiti.plugin.algorithm.AbstractAlgorithm
          extended by org.graffiti.plugin.algorithm.AbstractThreadSaveLayoutAlgorithm
All Implemented Interfaces:
Algorithm, Parametrizable

public abstract class AbstractThreadSaveLayoutAlgorithm
extends AbstractAlgorithm

Basis for Thread Safe (layout) Plugins and communication to the MainFrame


Field Summary
protected  boolean redrawNeeded
          DOCUMENT ME!
protected  boolean settingsChanged
          DOCUMENT ME!
protected  boolean threadSettingsChanged
          DOCUMENT ME!
 
Fields inherited from class org.graffiti.plugin.algorithm.AbstractAlgorithm
graph
 
Fields inherited from class org.graffiti.plugin.AbstractParametrizable
parameters
 
Constructor Summary
AbstractThreadSaveLayoutAlgorithm()
           
 
Method Summary
 Object getOrSetParam(boolean getParam, int index, Object setValue)
          Sets or gets a Parameter Threadsafe for the Algorithm.
 void storeOrSetNodePosition(boolean setAllNodePositions, int index, Node n, double x, double y)
          Stores a node position (from the layout thread) or sets the node position of a node to a stored position (from the FrameMain thread).
 
Methods inherited from class org.graffiti.plugin.algorithm.AbstractAlgorithm
attach, check, getAnimation, reset, supportsAnimation
 
Methods inherited from class org.graffiti.plugin.AbstractParametrizable
copyParameters, getAlgorithmParameters, getDefaultParameters, getParameters, getUserParameters, saveUserParameters, saveUserParameters, setAlgorithmParameters, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.graffiti.plugin.algorithm.Algorithm
execute
 
Methods inherited from interface org.graffiti.plugin.Parametrizable
getDefaultParameters, getName, getParameters, setParameters
 

Field Detail

redrawNeeded

protected boolean redrawNeeded
DOCUMENT ME!


settingsChanged

protected boolean settingsChanged
DOCUMENT ME!


threadSettingsChanged

protected boolean threadSettingsChanged
DOCUMENT ME!

Constructor Detail

AbstractThreadSaveLayoutAlgorithm

public AbstractThreadSaveLayoutAlgorithm()
Method Detail

getOrSetParam

public Object getOrSetParam(boolean getParam,
                            int index,
                            Object setValue)
Sets or gets a Parameter Threadsafe for the Algorithm.

Parameters:
getParam - If true, parameter with index "index" is returned, if false, the parameter is set (stored).
index - Index of Parameter to set or get
setValue - Object to store, if getParam is false
Returns:
Desired Parameter object or Paramter that was just stored.

storeOrSetNodePosition

public void storeOrSetNodePosition(boolean setAllNodePositions,
                                   int index,
                                   Node n,
                                   double x,
                                   double y)
Stores a node position (from the layout thread) or sets the node position of a node to a stored position (from the FrameMain thread). For synchronizing only one method stores or sets coordinates.

Parameters:
setAllNodePositions - If true all Nodepositions are actually modified.
index - Index of node
n - Node which should be modified or node that corespondends to the given coordinates.
x - Node position (X) for storage.
y - Node position (Y) for storage.


Generated at 2012-05-30 11:00:36 PM CEST