Class AbstractThreadSaveLayoutAlgorithm

java.lang.Object
org.graffiti.plugin.algorithm.AbstractAlgorithm
org.graffiti.plugin.algorithm.AbstractThreadSaveLayoutAlgorithm
All Implemented Interfaces:
UndoableEdit, Algorithm

public abstract class AbstractThreadSaveLayoutAlgorithm
extends AbstractAlgorithm
Basis for Thread Safe (layout) Plugins and communication to the MainFrame
  • Constructor Details

    • AbstractThreadSaveLayoutAlgorithm

      public AbstractThreadSaveLayoutAlgorithm()
  • Method Details

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