Class JGraphLayoutProgress

java.lang.Object
com.jgraph.layout.JGraphLayoutProgress

public class JGraphLayoutProgress extends Object
Describes the state of a long-running layout. The UI can listen to property changes to inform the user of the layout progress, and it can set the isStopped property to signal the layout to terminate.
  • Field Details

    • MAXIMUM_PROPERTY

      public static final String MAXIMUM_PROPERTY
      Bound property name for maximum.
      See Also:
    • PROGRESS_PROPERTY

      public static final String PROGRESS_PROPERTY
      Bound property name for progress.
      See Also:
    • ISSTOPPED_PROPERTY

      public static final String ISSTOPPED_PROPERTY
      Bound property name for isStopped.
      See Also:
    • changeSupport

      protected PropertyChangeSupport changeSupport
      Property change support is delegated to this class.
    • maximum

      protected int maximum
      Specifies the maximum progress, for example 100%.
    • progress

      protected int progress
      Specifies the current progress.
    • isStopped

      protected boolean isStopped
      Specifies whether the layout was stopped in the user interface.
  • Constructor Details

    • JGraphLayoutProgress

      public JGraphLayoutProgress()
      Constructs a new layout progress with a maximum progress of 0.
    • JGraphLayoutProgress

      public JGraphLayoutProgress(int maximum)
      Constructs a new layout progress for the specified maximum progress.
      Parameters:
      maximum -
  • Method Details

    • reset

      public void reset(int maximum)
      Resets the progress to 0 and sets isStopped to false.
    • getChangeSupport

      public PropertyChangeSupport getChangeSupport()
      Returns:
      Returns the changeSupport.
    • setChangeSupport

      public void setChangeSupport(PropertyChangeSupport changeSupport)
      Parameters:
      changeSupport - The changeSupport to set.
    • isStopped

      public boolean isStopped()
      Stoppable layouts should check this within their inner-most loops and return immediately if this returns true.
      Returns:
      Returns true if the layout should terminate.
    • setStopped

      public void setStopped(boolean isStopped)
      Signals the layout to stop running.

      Fires a property change for the ISSTOPPED_PROPERTY.

      Parameters:
      isStopped - Whether the layout should stop.
    • getMaximum

      public int getMaximum()
      Returns:
      Returns the maximum progress.
    • setMaximum

      public void setMaximum(int maximum)
      Sets the maximum progress of the layout. This should be set at construction time only.

      Fires a property change for the MAXIMUM_PROPERTY.

      Parameters:
      maximum - The maximum to set.
    • getProgress

      public int getProgress()
      Returns:
      Returns the progress.
    • setProgress

      public void setProgress(int progress)
      Sets the current progress of the layout.

      Fires a property change for the PROGRESS_PROPERTY.

      Parameters:
      progress - The progress to set.
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
      Adds a property change listener.
      Parameters:
      listener -
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
      Removes a property change listener.
      Parameters:
      listener -