Class BackgroundAlgorithm
java.lang.Object
org.graffiti.plugin.algorithm.AbstractAlgorithm
org.graffiti.plugin.algorithm.AbstractEditorAlgorithm
org.vanted.plugins.layout.stressminimization.BackgroundAlgorithm
- All Implemented Interfaces:
UndoableEdit
,Algorithm
,EditorAlgorithm
- Direct Known Subclasses:
StressMinimizationLayout
public abstract class BackgroundAlgorithm extends AbstractEditorAlgorithm
Algorithm which runs in the background and
able to notify other classes about state
of the algorithm or the layout change of the graph.
-
Constructor Summary
Constructors Constructor Description BackgroundAlgorithm()
-
Method Summary
Modifier and Type Method Description void
addPropertyChangeListener(PropertyChangeListener pcl)
add new PropertyChangeListener to the listener listvoid
addPropertyChangeListeners(PropertyChangeListener[] pcl)
add elements of an array to the property change listSupplier<HashMap<Node,Vector2d>>
getLayout()
abstract JComponent
getParameterUI()
double
getProgress()
PropertyChangeListener[]
getPropertyChangeListener()
returns an array of PropertyChangeListener that were added to the BackgroundAlgorithmBackgroundStatus
getStatus()
String
getStatusDescription()
boolean
isPaused()
boolean
isStopped()
void
pause()
Pauses the execution of this algorithm, if the algorithm is running.void
removePropertyChangeListener(PropertyChangeListener pcl)
remove PropertyChangeListener from the listener listvoid
reset()
Resets the internal state of the algorithm.void
resume()
Resumes execution of this algorithm, if the algorithm has been paused.void
stop()
Stops the execution of the algorithm.Methods inherited from class org.graffiti.plugin.algorithm.AbstractEditorAlgorithm
getIcon, getParameterDialog, getShortName
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, setActionEvent, setParameters, showMenuIcon, undo
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.graffiti.plugin.algorithm.Algorithm
attach, check, execute, getAcceleratorKeyStroke, getActionEvent, getCategory, getDescription, getMenuCategory, getName, getParameters, getSetCategory, isLayoutAlgorithm, mayWorkOnMultipleGraphs, setActionEvent, setParameters, showMenuIcon
Methods inherited from interface org.graffiti.plugin.algorithm.EditorAlgorithm
activeForView
-
Constructor Details
-
BackgroundAlgorithm
public BackgroundAlgorithm()
-
-
Method Details
-
getPropertyChangeListener
returns an array of PropertyChangeListener that were added to the BackgroundAlgorithm- Returns:
- all of the PropertyChangeListeners added or an empty array if no listeners have been added
-
addPropertyChangeListener
add new PropertyChangeListener to the listener list- Parameters:
pcl
- PropertyChangeListner to be added
-
removePropertyChangeListener
remove PropertyChangeListener from the listener list- Parameters:
pcl
- PropertyChangeListener to be removed
-
addPropertyChangeListeners
add elements of an array to the property change list- Parameters:
pcl
- Array of PropertyChangeListener which should be added to the listener list
-
pause
public void pause()Pauses the execution of this algorithm, if the algorithm is running. -
resume
public void resume()Resumes execution of this algorithm, if the algorithm has been paused. -
stop
public void stop()Stops the execution of the algorithm. In contrast to pause the algorithm will terminate. reset has to be called before the next execution of the algorithm. -
reset
public void reset()Description copied from interface:Algorithm
Resets the internal state of the algorithm.- Specified by:
reset
in interfaceAlgorithm
- Overrides:
reset
in classAbstractAlgorithm
-
getStatus
-
getProgress
public double getProgress() -
getParameterUI
-
getStatusDescription
-
getLayout
-
isPaused
public boolean isPaused() -
isStopped
public boolean isStopped()
-