Class 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 Details

    • BackgroundAlgorithm

      public BackgroundAlgorithm()
  • Method Details

    • getPropertyChangeListener

      public PropertyChangeListener[] 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

      public void addPropertyChangeListener​(PropertyChangeListener pcl)
      add new PropertyChangeListener to the listener list
      Parameters:
      pcl - PropertyChangeListner to be added
    • removePropertyChangeListener

      public void removePropertyChangeListener​(PropertyChangeListener pcl)
      remove PropertyChangeListener from the listener list
      Parameters:
      pcl - PropertyChangeListener to be removed
    • addPropertyChangeListeners

      public void addPropertyChangeListeners​(PropertyChangeListener[] pcl)
      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 interface Algorithm
      Overrides:
      reset in class AbstractAlgorithm
    • getStatus

      public BackgroundStatus getStatus()
    • getProgress

      public double getProgress()
    • getParameterUI

      public abstract JComponent getParameterUI()
    • getStatusDescription

      public String getStatusDescription()
    • getLayout

      public Supplier<HashMap<Node,​Vector2d>> getLayout()
    • isPaused

      public boolean isPaused()
    • isStopped

      public boolean isStopped()