Class XProgressBarListener

java.lang.Object
org.processmining.framework.util.progress.XProgressBarListener
All Implemented Interfaces:
XProgressListener

public class XProgressBarListener extends Object implements XProgressListener
This class implements a progress listener for controlling an attached Swing progress bar. The progress bar will then reflect the progress as received by this listener.
Author:
Christian W. Guenther (christian@deckfour.org)
  • Field Details

    • progressBar

      protected JProgressBar progressBar
      Controlled progress bar.
    • startValue

      protected int startValue
      Start value to use in progress bar. When the progress listener begins, this will be the displayed value on the progress bar.
    • stopValue

      protected int stopValue
      Stop value to use in progress bar. When the progress listener is completed, this will be the displayed value on the progress bar.
  • Constructor Details

    • XProgressBarListener

      public XProgressBarListener(JProgressBar progressBar)
      Creates a new progress bar listener with the specified progress bar for display. The progress bar will accurately and completely reflect the progress, as received by this listener.
      Parameters:
      progressBar - Progress bar to display progress.
    • XProgressBarListener

      public XProgressBarListener(JProgressBar progressBar, int startValue, int stopValue)
      Creates a new progress bar listener with the specified progress bar for display. Allows the specification of start and stop values for the progress bar, so that this listener may control only part of a more higher-level progress (e.g., the loading of one from a number of files).
      Parameters:
      progressBar - Progress bar to display progress.
      startValue - When the progress listener begins, this will be the displayed value on the progress bar.
      stopValue - When the progress listener is completed, this will be the displayed value on the progress bar.
  • Method Details

    • updateProgress

      public void updateProgress(int progress, int maxProgress)
      Description copied from interface: XProgressListener
      Notifies the listener about progress being made.
      Specified by:
      updateProgress in interface XProgressListener
      Parameters:
      progress - Current progress step achieved.
      maxProgress - Maximal progress steps available.
    • isAborted

      public boolean isAborted()
      Checks whether the monitored process has been canceled.
      Specified by:
      isAborted in interface XProgressListener