Package org.graffiti.plugin.algorithm
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 Summary
Constructors Constructor Description AbstractThreadSaveLayoutAlgorithm()
-
Method Summary
Modifier and Type Method Description 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
addEdit, attach, canRedo, canUndo, check, die, doesUndo, getAcceleratorKeyStroke, getActionEvent, getCategory, getDescription, getMenuCategory, getParameters, getPresentationName, getRedoPresentationName, getSetCategory, getUndoPresentationName, isAlwaysExecutable, isLayoutAlgorithm, isSignificant, markExecutionDone, markRedoDone, markUndoDone, mayWorkOnMultipleGraphs, redo, replaceEdit, reset, setActionEvent, setParameters, showMenuIcon, undo
-
Constructor Details
-
AbstractThreadSaveLayoutAlgorithm
public AbstractThreadSaveLayoutAlgorithm()
-
-
Method Details
-
getOrSetParam
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 getsetValue
- 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 noden
- 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.
-