Package org.openstreetmap.josm.gui
Class PleaseWaitDialog
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Dialog
-
- javax.swing.JDialog
-
- org.openstreetmap.josm.gui.PleaseWaitDialog
-
- All Implemented Interfaces:
java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
,PleaseWaitProgressMonitor.ProgressMonitorDialog
public class PleaseWaitDialog extends javax.swing.JDialog implements PleaseWaitProgressMonitor.ProgressMonitorDialog
This is a dialog that displays the progress of an action to the user.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
-
Nested classes/interfaces inherited from class java.awt.Dialog
java.awt.Dialog.AccessibleAWTDialog, java.awt.Dialog.ModalExclusionType, java.awt.Dialog.ModalityType
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JButton
btnCancel
private javax.swing.JButton
btnInBackground
private javax.swing.JLabel
currentAction
private javax.swing.JLabel
customText
private javax.swing.JProgressBar
progressBar
private javax.swing.JScrollPane
spLog
private JosmTextArea
taLog
the text area and the scroll pane for the log-
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description PleaseWaitDialog(java.awt.Component parent)
Constructs a newPleaseWaitDialog
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
adjustLayout()
void
appendLogMessage(java.lang.String message)
Appends a log message to the progress dialog.private void
initDialog()
void
setCancelCallback(java.awt.event.ActionListener callback)
Installs a callback for the cancel button.void
setCancelEnabled(boolean enabled)
Sets whether the cancel button is enabled or not.void
setCurrentAction(java.lang.String text)
Sets the current action that is donevoid
setCustomText(java.lang.String text)
Sets a custom text line below currentAction.void
setInBackgroundCallback(java.awt.event.ActionListener callback)
Installs a callback for the "In background" button.void
setInBackgroundPossible(boolean value)
Enables / disables a button that can be pressed to run the task in background.void
setIndeterminate(boolean newValue)
Display that the current progress cannot be determinedvoid
setMaximumProgress(int progressBarMax)
Sets the maximum progress value.void
updateProgress(int progress)
Updates the progress value to the specified progress.-
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
-
Methods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
-
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, toFront
-
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
-
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.gui.progress.swing.PleaseWaitProgressMonitor.ProgressMonitorDialog
setVisible
-
-
-
-
Field Detail
-
progressBar
private final javax.swing.JProgressBar progressBar
-
currentAction
private final javax.swing.JLabel currentAction
-
customText
private final javax.swing.JLabel customText
-
btnCancel
private javax.swing.JButton btnCancel
-
btnInBackground
private javax.swing.JButton btnInBackground
-
taLog
private final JosmTextArea taLog
the text area and the scroll pane for the log
-
spLog
private final javax.swing.JScrollPane spLog
-
-
Constructor Detail
-
PleaseWaitDialog
public PleaseWaitDialog(java.awt.Component parent)
Constructs a newPleaseWaitDialog
.- Parameters:
parent
- theComponent
from which the dialog is displayed. Can benull
.
-
-
Method Detail
-
initDialog
private void initDialog()
-
setIndeterminate
public void setIndeterminate(boolean newValue)
Description copied from interface:PleaseWaitProgressMonitor.ProgressMonitorDialog
Display that the current progress cannot be determined- Specified by:
setIndeterminate
in interfacePleaseWaitProgressMonitor.ProgressMonitorDialog
- Parameters:
newValue
- whether the progress cannot be determined
-
adjustLayout
protected void adjustLayout()
-
setCustomText
public void setCustomText(java.lang.String text)
Sets a custom text line below currentAction. Can be used to display additional information.- Specified by:
setCustomText
in interfacePleaseWaitProgressMonitor.ProgressMonitorDialog
- Parameters:
text
- custom text
-
setCurrentAction
public void setCurrentAction(java.lang.String text)
Description copied from interface:PleaseWaitProgressMonitor.ProgressMonitorDialog
Sets the current action that is done- Specified by:
setCurrentAction
in interfacePleaseWaitProgressMonitor.ProgressMonitorDialog
- Parameters:
text
- The current action
-
appendLogMessage
public void appendLogMessage(java.lang.String message)
Appends a log message to the progress dialog. If the log area isn't visible yet it becomes visible. The height of the progress dialog is slightly increased too.- Specified by:
appendLogMessage
in interfacePleaseWaitProgressMonitor.ProgressMonitorDialog
- Parameters:
message
- the message to append to the log. Ignore if null or white space only.
-
setCancelEnabled
public void setCancelEnabled(boolean enabled)
Sets whether the cancel button is enabled or not.- Parameters:
enabled
- true, if the cancel button is enabled; false otherwise- See Also:
setCancelCallback(ActionListener)
-
setInBackgroundPossible
public void setInBackgroundPossible(boolean value)
Enables / disables a button that can be pressed to run the task in background.- Parameters:
value
-true
iff that button should be displayed.- See Also:
setInBackgroundCallback(ActionListener)
-
setCancelCallback
public void setCancelCallback(java.awt.event.ActionListener callback)
Installs a callback for the cancel button. If callback is null, all action listeners are removed from the cancel button.- Parameters:
callback
- the cancel callback
-
setInBackgroundCallback
public void setInBackgroundCallback(java.awt.event.ActionListener callback)
Installs a callback for the "In background" button. If callback is null, all action listeners are removed from the cancel button.- Parameters:
callback
- the cancel callback
-
updateProgress
public void updateProgress(int progress)
Description copied from interface:PleaseWaitProgressMonitor.ProgressMonitorDialog
Updates the progress value to the specified progress.- Specified by:
updateProgress
in interfacePleaseWaitProgressMonitor.ProgressMonitorDialog
- Parameters:
progress
- The progress as integer. Between 0 andPleaseWaitProgressMonitor.PROGRESS_BAR_MAX
-
setMaximumProgress
public void setMaximumProgress(int progressBarMax)
Sets the maximum progress value.- Parameters:
progressBarMax
- The value that represents the rightmost point of the progress bar (100%).- Since:
- 11672
-
-