Class ThreadSafeOptions

java.lang.Object
org.graffiti.plugin.algorithm.ThreadSafeOptions
All Implemented Interfaces:
HelperClass

public class ThreadSafeOptions
extends Object
implements HelperClass
This class can be used for thread safe communication between user interfaces and plugins.
Version:
$Revision: 1.14 $
Author:
Christian Klukas, IPK Gatersleben
  • Field Details

    • 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.
    • doMultiplyByNodeDegree

      public boolean doMultiplyByNodeDegree
    • doRemoveAllBends

      public boolean doRemoveAllBends
    • 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.
    • doFinishRemoveOverlapp

      public boolean doFinishRemoveOverlapp
    • 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 ArrayList 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 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". Check or overwrite getRunStatus so that the descriptions match.
    • threadSettingsChanged

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

      public Double[] dValues
      Array for storing Double parameters
    • bValues

      public Boolean[] bValues
      Array for storing Boolean parameters
  • Constructor Details

    • ThreadSafeOptions

      public ThreadSafeOptions()
  • Method Details

    • 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.
    • 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.
    • getRunStatus

      public String getRunStatus()
    • addInt

      public void addInt​(int i)
    • setInt

      public void setInt​(int i)
    • getInt

      public int getInt()
    • addDouble

      public void addDouble​(double d)
    • setDouble

      public void setDouble​(double d)
    • getDouble

      public double getDouble()
    • executeThreadSafe

      public void executeThreadSafe​(Runnable runnable)
    • setLong

      public void setLong​(long l)
    • addLong

      public void addLong​(long l)
    • getLong

      public long getLong()
    • getNextLong

      public long getNextLong()