Class XProgressBarListener
java.lang.Object
org.processmining.framework.util.progress.XProgressBarListener
- All Implemented Interfaces:
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 Summary
FieldsModifier and TypeFieldDescriptionprotected JProgressBar
Controlled progress bar.protected int
Start value to use in progress bar.protected int
Stop value to use in progress bar. -
Constructor Summary
ConstructorsConstructorDescriptionXProgressBarListener
(JProgressBar progressBar) Creates a new progress bar listener with the specified progress bar for display.XProgressBarListener
(JProgressBar progressBar, int startValue, int stopValue) Creates a new progress bar listener with the specified progress bar for display. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks whether the monitored process has been canceled.void
updateProgress
(int progress, int maxProgress) Notifies the listener about progress being made.
-
Field Details
-
progressBar
Controlled progress bar. -
startValue
protected int startValueStart value to use in progress bar. When the progress listener begins, this will be the displayed value on the progress bar. -
stopValue
protected int stopValueStop 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
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
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 interfaceXProgressListener
- 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 interfaceXProgressListener
-