org.graffiti.plugin.algorithm
Class ThreadSafeOptions

java.lang.Object
  extended by org.graffiti.plugin.algorithm.ThreadSafeOptions

public class ThreadSafeOptions
extends Object

This class can be used for thread safe communication between user interfaces and plugins.

Version:
$Revision: 5768 $
Author:
Christian Klukas, IPK Gatersleben

Field Summary
 boolean autoRedraw
          If true, the algorithm should auto-update the view.
 boolean borderForce
          Rand-Abstoßung verwenden, ja/nein
 double borderWidth
          Rand-Absto�ung links und oben
 boolean doCopyPatternLayout
          Init parameter.
 boolean doFinishMoveToTop
          Parameter which is evaluated by the springEmbedder layouter at the end of the run.
 boolean doRandomInit
          Init parameter.
 double maxBorderForce
          Absto�ungs-Kraft direkt am Rand
 int maxThreads
          Maximale Anzahl an Threads, die vom Algorithmus verwendet werden sollen
 Vector<Node> nodeArray
          Vecor node array, contains patternNodeStruct objects, which saves/caches the information about pattern type and number for all nodes of a graph
 HashMap<Object,Object> nodeSearch
          Used for search from Node to NodeCacheEntry (which includes the Node)
 boolean redraw
          If set to true, a redraw should be done.
 boolean respectNodeDimensionsForLayout
          If true, distances are calculated with respect to node dimensions.
 int runStatus
          Can be interpreted by the algorithm like desired.
protected  boolean settingsChanged
          If true, the settigns should be re-read by the plugin.
 double temp_alpha
          Run parameter.
 double temperature_max_move
          Run parameter.
 boolean threadSettingsChanged
          A second variable for changed settigns.
 
Constructor Summary
ThreadSafeOptions()
           
 
Method Summary
 boolean getBval(int index, boolean defaultValue)
          Returns a stored boolean parameter value.
 double getDval(int index, double defaultValue)
          DOCUMENT ME!
 Graph getGraphInstance()
          DOCUMENT ME!
 int getIval(int index, int defaultValue)
          Returns a stored integer parameter value.
 Object getParam(int index, Object defaultValue)
          Get a parameter object
 Selection getSelection()
           
 boolean isAbortWanted()
          Check if the plugin should stop.
 void setAbortWanted(boolean value)
          Use this call to indicate that the plugin should stop it work
 void setBval(int index, boolean value)
          Sets a boolean Parameter with a given Index index and a given value.
 void setDval(int index, double value)
          DOCUMENT ME!
 void setGraphInstance(Graph newG)
          DOCUMENT ME!
 void setIval(int index, int value)
          Sets a integer Parameter with a given Index index and a given value.
 Object setParam(int index, Object setValue)
          DOCUMENT ME!
 void setSelection(Selection selection)
          Set selection for graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

doRandomInit

public boolean doRandomInit
Init parameter. This parameter needs to be removed later to make this class more general.


doCopyPatternLayout

public boolean doCopyPatternLayout
Init parameter. This parameter needs to be removed later to make this class more general.


doFinishMoveToTop

public boolean doFinishMoveToTop
Parameter which is evaluated by the springEmbedder layouter at the end of the run. This parameter needs to be removed later to make this class more general.


borderWidth

public double borderWidth
Rand-Absto�ung links und oben


maxBorderForce

public double maxBorderForce
Absto�ungs-Kraft direkt am Rand


temperature_max_move

public double temperature_max_move
Run parameter. This parameter needs to be removed later to make this class more general.


temp_alpha

public double temp_alpha
Run parameter. This parameter needs to be removed later to make this class more general.


maxThreads

public int maxThreads
Maximale Anzahl an Threads, die vom Algorithmus verwendet werden sollen


respectNodeDimensionsForLayout

public boolean respectNodeDimensionsForLayout
If true, distances are calculated with respect to node dimensions. Intersections of Nodes in Layout should then be impossible.


borderForce

public boolean borderForce
Rand-Abstoßung verwenden, ja/nein


redraw

public boolean redraw
If set to true, a redraw should be done.


autoRedraw

public boolean autoRedraw
If true, the algorithm should auto-update the view. If false, the algorithm should only redraw, if the value redraw is true.


nodeArray

public Vector<Node> nodeArray
Vecor node array, contains patternNodeStruct objects, which saves/caches the information about pattern type and number for all nodes of a graph


nodeSearch

public HashMap<Object,Object> nodeSearch
Used for search from Node to NodeCacheEntry (which includes the Node)


runStatus

public int runStatus
Can be interpreted by the algorithm like desired. 0 should be "not started", 1 should be "running", 2 should be "idle", 3 should be "finished".


settingsChanged

protected volatile boolean settingsChanged
If true, the settigns should be re-read by the plugin.


threadSettingsChanged

public volatile boolean threadSettingsChanged
A second variable for changed settigns. ToDo (CK): check purpose

Constructor Detail

ThreadSafeOptions

public ThreadSafeOptions()
Method Detail

setAbortWanted

public void setAbortWanted(boolean value)
Use this call to indicate that the plugin should stop it work

Parameters:
value - Set to True to indicate a wanted stop

isAbortWanted

public boolean isAbortWanted()
Check if the plugin should stop.

Returns:
True, in case the plugin should stop its run. False, if the plugin should continue its work.

setGraphInstance

public void setGraphInstance(Graph newG)
DOCUMENT ME!

Parameters:
newG - DOCUMENT ME!

getGraphInstance

public Graph getGraphInstance()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getParam

public Object getParam(int index,
                       Object defaultValue)
Get a parameter object

Parameters:
index - index number (GUI and Plugin should use the same indicies ;-)
defaultValue - In case the parameter is not yet set, this value will be returned.
Returns:
The parameter object which was set before or if not yet set the defaultValue.

setParam

public Object setParam(int index,
                       Object setValue)
DOCUMENT ME!

Parameters:
index - DOCUMENT ME!
setValue - DOCUMENT ME!
Returns:
DOCUMENT ME!

setDval

public void setDval(int index,
                    double value)
DOCUMENT ME!

Parameters:
index - DOCUMENT ME!
value - DOCUMENT ME!

getDval

public double getDval(int index,
                      double defaultValue)
DOCUMENT ME!

Parameters:
index - DOCUMENT ME!
defaultValue - DOCUMENT ME!
Returns:
DOCUMENT ME!

setBval

public void setBval(int index,
                    boolean value)
Sets a boolean Parameter with a given Index index and a given value. It is up to the plugin that uses the options to make sure, that each time the right index for storing and restoring the parameter value is used.

Parameters:
index - Index of the property. (self choosen from 0...x)
value - The new setting stored at index index.

getBval

public boolean getBval(int index,
                       boolean defaultValue)
Returns a stored boolean parameter value. If the parameter has not yet been stored the defaultValue is returned.

Parameters:
index - Index of the parameter to be retrieved.
defaultValue - The default value that is returned in case the parameter is yet unknown.
Returns:
A boolean parameter value.

setIval

public void setIval(int index,
                    int value)
Sets a integer Parameter with a given Index index and a given value. It is up to the plugin that uses the options to make sure, that each time the right index for storing and restoring the parameter value is used.

Parameters:
index - Index of the property. (self choosen from 0...x)
value - The new setting stored at index index.

getIval

public int getIval(int index,
                   int defaultValue)
Returns a stored integer parameter value. If the parameter has not yet been stored the defaultValue is returned.

Parameters:
index - Index of the parameter to be retrieved.
defaultValue - The default value that is returned in case the parameter is yet unknown.
Returns:
A integer parameter value.

getSelection

public Selection getSelection()
Returns:
The selected nodes/edges for the graph.

setSelection

public void setSelection(Selection selection)
Set selection for graph.

Parameters:
selection - The selection.


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