Class PleaseWaitProgressMonitor
- java.lang.Object
-
- org.openstreetmap.josm.gui.progress.AbstractProgressMonitor
-
- org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor
-
- All Implemented Interfaces:
ProgressMonitor
public class PleaseWaitProgressMonitor extends AbstractProgressMonitor
A progress monitor used inPleaseWaitRunnable.Progress is displayed in a dialog window (
PleaseWaitDialog).- Since:
- 12675 (moved from
gui.progresspackage}
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfacePleaseWaitProgressMonitor.ProgressMonitorDialogImplemented by both foreground dialog and background progress dialog (in status bar)-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.progress.AbstractProgressMonitor
AbstractProgressMonitor.State
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.progress.ProgressMonitor
ProgressMonitor.CancelListener
-
-
Field Summary
Fields Modifier and Type Field Description private booleancancelableprivate java.awt.event.ActionListenercancelListener(package private) static PleaseWaitProgressMonitorcurrentProgressMonitorThe progress monitor being currently displayed.private intcurrentProgressValueprivate java.lang.StringcustomTextprivate PleaseWaitDialogdialogprivate java.awt.ComponentdialogParentprivate java.awt.event.ActionListenerinBackgroundListenerprivate booleanindeterminateprivate booleanisInBackgroundstatic intPROGRESS_BAR_MAXThe maximum value the progress bar that displays the current progress should have.protected ProgressTaskIdtaskIdprivate java.lang.Stringtitleprivate java.awt.event.WindowListenerwindowListenerprivate java.lang.StringwindowTitle-
Fields inherited from class org.openstreetmap.josm.gui.progress.AbstractProgressMonitor
state
-
Fields inherited from interface org.openstreetmap.josm.gui.progress.ProgressMonitor
ALL_TICKS, DEFAULT_TICKS
-
-
Constructor Summary
Constructors Constructor Description PleaseWaitProgressMonitor()Constructs a newPleaseWaitProgressMonitor.PleaseWaitProgressMonitor(java.awt.Component dialogParent)Constructs a newPleaseWaitProgressMonitor.PleaseWaitProgressMonitor(java.awt.Component dialogParent, java.lang.String windowTitle)Constructs a newPleaseWaitProgressMonitor.PleaseWaitProgressMonitor(java.lang.String windowTitle)Constructs a newPleaseWaitProgressMonitor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendLogMessage(java.lang.String message)Default implementation is empty.voidclose()Close the progress dialog window.voiddoBeginTask()voiddoFinishTask()private voiddoInEDT(java.lang.Runnable runnable)protected voiddoSetCustomText(java.lang.String title)protected voiddoSetIntermediate(boolean value)protected voiddoSetTitle(java.lang.String title)static PleaseWaitProgressMonitorgetCurrent()Returns the progress monitor being currently displayed.private PleaseWaitProgressMonitor.ProgressMonitorDialoggetDialog()ProgressTaskIdgetProgressTaskId()Returns the task ID of the progress dialog Should be used only by PleaseWaitRunnablejava.awt.ComponentgetWindowParent()Return the parent windows of progress dialogbooleanisCancelable()See if this task is cancelablevoidreset()Update the dialog valuesvoidsetCancelable(boolean cancelable)Sets this task to be cancelableprivate voidsetDialogVisible(boolean visible)voidsetProgressTaskId(ProgressTaskId taskId)Set the task ID of the progress dialog Should be used only by PleaseWaitRunnable.voidshowForegroundDialog()Show the progress dialog in foregroundjava.lang.StringtoString()protected voidupdateProgress(double progressValue)Update progress message-
Methods inherited from class org.openstreetmap.josm.gui.progress.AbstractProgressMonitor
addCancelListener, beginTask, beginTask, cancel, checkState, childFinished, childSetCustomText, childSetIntermediate, childSetProgress, childSetTitle, createSubTaskMonitor, finishTask, getTicks, getTicksCount, indeterminateSubTask, invalidate, isCanceled, removeCancelListener, setCustomText, setExtraText, setTicks, setTicksCount, subTask, worked
-
-
-
-
Field Detail
-
PROGRESS_BAR_MAX
public static final int PROGRESS_BAR_MAX
The maximum value the progress bar that displays the current progress should have.- See Also:
- Constant Field Values
-
currentProgressMonitor
static PleaseWaitProgressMonitor currentProgressMonitor
The progress monitor being currently displayed.
-
dialogParent
private final java.awt.Component dialogParent
-
currentProgressValue
private int currentProgressValue
-
customText
private java.lang.String customText
-
title
private java.lang.String title
-
indeterminate
private boolean indeterminate
-
isInBackground
private boolean isInBackground
-
dialog
private PleaseWaitDialog dialog
-
windowTitle
private java.lang.String windowTitle
-
taskId
protected ProgressTaskId taskId
-
cancelable
private boolean cancelable
-
cancelListener
private final java.awt.event.ActionListener cancelListener
-
inBackgroundListener
private final java.awt.event.ActionListener inBackgroundListener
-
windowListener
private final java.awt.event.WindowListener windowListener
-
-
Constructor Detail
-
PleaseWaitProgressMonitor
public PleaseWaitProgressMonitor()
Constructs a newPleaseWaitProgressMonitor.
-
PleaseWaitProgressMonitor
public PleaseWaitProgressMonitor(java.lang.String windowTitle)
Constructs a newPleaseWaitProgressMonitor.- Parameters:
windowTitle- window title
-
PleaseWaitProgressMonitor
public PleaseWaitProgressMonitor(java.awt.Component dialogParent)
Constructs a newPleaseWaitProgressMonitor.- Parameters:
dialogParent- component to get parent frame from
-
PleaseWaitProgressMonitor
public PleaseWaitProgressMonitor(java.awt.Component dialogParent, java.lang.String windowTitle)
Constructs a newPleaseWaitProgressMonitor.- Parameters:
dialogParent- component to get parent frame fromwindowTitle- window title
-
-
Method Detail
-
getCurrent
public static PleaseWaitProgressMonitor getCurrent()
Returns the progress monitor being currently displayed.- Returns:
- the progress monitor being currently displayed
- Since:
- 12638
-
doInEDT
private void doInEDT(java.lang.Runnable runnable)
-
setDialogVisible
private void setDialogVisible(boolean visible)
-
getDialog
private PleaseWaitProgressMonitor.ProgressMonitorDialog getDialog()
-
isCancelable
public final boolean isCancelable()
See if this task is cancelable- Returns:
trueif it can be canceled
-
setCancelable
public final void setCancelable(boolean cancelable)
Sets this task to be cancelable- Parameters:
cancelable- Whether it can be canceled
-
doBeginTask
public void doBeginTask()
- Specified by:
doBeginTaskin classAbstractProgressMonitor
-
doFinishTask
public void doFinishTask()
- Specified by:
doFinishTaskin classAbstractProgressMonitor
-
updateProgress
protected void updateProgress(double progressValue)
Description copied from class:AbstractProgressMonitorUpdate progress message- Specified by:
updateProgressin classAbstractProgressMonitor- Parameters:
progressValue- The percentage of completion (this and child progress)
-
doSetCustomText
protected void doSetCustomText(java.lang.String title)
- Specified by:
doSetCustomTextin classAbstractProgressMonitor
-
doSetTitle
protected void doSetTitle(java.lang.String title)
- Specified by:
doSetTitlein classAbstractProgressMonitor
-
doSetIntermediate
protected void doSetIntermediate(boolean value)
- Specified by:
doSetIntermediatein classAbstractProgressMonitor
-
appendLogMessage
public void appendLogMessage(java.lang.String message)
Description copied from class:AbstractProgressMonitorDefault implementation is empty. Override in subclasses to display the log messages.- Specified by:
appendLogMessagein interfaceProgressMonitor- Overrides:
appendLogMessagein classAbstractProgressMonitor- Parameters:
message- the log message. Ignored if null or white space only.
-
reset
public void reset()
Update the dialog values
-
close
public void close()
Close the progress dialog window.
-
showForegroundDialog
public void showForegroundDialog()
Show the progress dialog in foreground
-
setProgressTaskId
public void setProgressTaskId(ProgressTaskId taskId)
Description copied from interface:ProgressMonitorSet the task ID of the progress dialog Should be used only by PleaseWaitRunnable. If taskId<> nullthen "In background" button will be shown- Parameters:
taskId- the task ID
-
getProgressTaskId
public ProgressTaskId getProgressTaskId()
Description copied from interface:ProgressMonitorReturns the task ID of the progress dialog Should be used only by PleaseWaitRunnable- Returns:
- the task ID
-
getWindowParent
public java.awt.Component getWindowParent()
Description copied from interface:ProgressMonitorReturn the parent windows of progress dialog- Returns:
- component suitable as parent for dialogs that wants to be shown in front of progress dialog
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-