com.compomics.util.gui.waiting.waitinghandlers
Class ProgressDialogX

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Dialog
                  extended by javax.swing.JDialog
                      extended by com.compomics.util.gui.waiting.waitinghandlers.ProgressDialogX
All Implemented Interfaces:
WaitingHandler, ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class ProgressDialogX
extends JDialog
implements WaitingHandler

A dialog for displaying information about progress.

Author:
Harald Barsnes, Marc Vaudel
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
 
Nested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
 
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPE
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ProgressDialogX(boolean modal)
          Opens a new ProgressDialog.
ProgressDialogX(Frame waitingHandlerParent, Image normalIcon, Image waitingIcon, boolean modal)
          Opens a new ProgressDialogX with a Frame as a parent.
ProgressDialogX(JDialog waitingHandlerParent, Image normalIcon, Image waitingIcon, boolean modal)
          Opens a new ProgressDialog with a JDialog as a parent.
 
Method Summary
 void appendReport(String report, boolean includeDate, boolean addNewLine)
          Append text to the report.
 void appendReportEndLine()
          Append a new line to the report.
 void appendReportNewLineNoDate()
          Append two tabs to the report.
 void displayHtmlMessage(JEditorPane messagePane, String title, int messageType)
          Display a given html containing message to the user separatly from the main output.
 void displayMessage(String message, String title, int messageType)
          Display a given message to the user separatly from the main output.
 void doNothingOnClose()
          Deprecated. replace by setUnstoppable
 JProgressBar getProgressBar()
          Returns the progress bar for updates from external processes.
 JProgressBar getSecondaryProgressBar()
          Returns the secondary progress bar for updates from external processes.
 void increaseProgressValue()
          Increase the progress bar value by one "counter".
 void increaseProgressValue(int increment)
          Increase the progress bar value by the given amount.
 void increaseSecondaryProgressValue()
          Increases the progress bar.
 void increaseSecondaryProgressValue(int number)
          Increases the value of the progress bar.
 void incrementValue()
          Deprecated. use waiting handler method instead
 void incrementValue(int increment)
          Deprecated. use waiting handler method instead
 boolean isRunCanceled()
          Returns true if the run is canceled.
 void resetSecondaryProgressBar()
          resets the value of the progress bar.
 void setIndeterminate(boolean indeterminate)
          Makes the dialog indeterminate or not indeterminate.
 void setIntermidiate(boolean intermidiate)
          Deprecated. Replaced by setIndeterminate, from utilities 3.1.17.
 void setMax(int value)
          Deprecated. use waiting handler method instead
 void setMaxProgressValue(int maxProgressValue)
          Set the maximum value of the progress bar.
 void setMaxSecondaryProgressValue(int maxProgressValue)
          Sets the maximal value of the progress bar.
 void setRunCanceled()
          Set the analysis as canceled.
 void setRunFinished()
          Set the analysis as finished.
 void setSecondaryProgressDialogIndeterminate(boolean indeterminate)
          Makes the dialog indeterminate or not indeterminate.
 void setSecondaryProgressValue(int value)
          Sets the value of the progress bar.
 void setString(String currentFileName)
          Sets the string to display in the progrss bar.
 void setUnstoppable(boolean unstoppable)
          Set this to true of the process the progress bar is used for is not possible to stop, or not possble to stop nicely.
 void setValue(int value)
          Sets the progress bar value.
 void setWaitingText(String text)
          Sets the text describing what is currently waited for.
 
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, setModal, setModalityType, setResizable, setTitle, setUndecorated, setVisible, show, toBack
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeNotify, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImage, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, 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, transferFocusBackward, 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, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, 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, isOpaque, 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, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProgressDialogX

public ProgressDialogX(Frame waitingHandlerParent,
                       Image normalIcon,
                       Image waitingIcon,
                       boolean modal)
Opens a new ProgressDialogX with a Frame as a parent.

Parameters:
waitingHandlerParent -
waitingIcon - the dialog/frame icon to use when waiting
normalIcon - the dialog/frame icon to use when done
modal -

ProgressDialogX

public ProgressDialogX(JDialog waitingHandlerParent,
                       Image normalIcon,
                       Image waitingIcon,
                       boolean modal)
Opens a new ProgressDialog with a JDialog as a parent.

Parameters:
waitingHandlerParent -
waitingIcon - the dialog/frame icon to use when waiting
normalIcon - the dialog/frame icon to use when done
modal -

ProgressDialogX

public ProgressDialogX(boolean modal)
Opens a new ProgressDialog.

Parameters:
modal -
Method Detail

setValue

public void setValue(int value)
Sets the progress bar value.

Parameters:
value - the progress bar value

incrementValue

public void incrementValue()
Deprecated. use waiting handler method instead

Increases the progress value by 1.


incrementValue

public void incrementValue(int increment)
Deprecated. use waiting handler method instead

Increases the progress value by n.

Parameters:
increment - the value to increment by

setMax

public void setMax(int value)
Deprecated. use waiting handler method instead

Sets the maximum value of the progress bar.

Parameters:
value - the maximum value

setIntermidiate

public void setIntermidiate(boolean intermidiate)
Deprecated. Replaced by setIndeterminate, from utilities 3.1.17.

Makes the dialog indeterminate or not indeterminate. Also turns the paint progress string on or off.

Parameters:
intermidiate -
See Also:
setIndeterminate(boolean)

setIndeterminate

public void setIndeterminate(boolean indeterminate)
Makes the dialog indeterminate or not indeterminate. Also turns the paint progress string on or off.

Parameters:
indeterminate -

setString

public void setString(String currentFileName)
Sets the string to display in the progrss bar. For example to show the name of the file currently being converted.

Parameters:
currentFileName -

doNothingOnClose

public void doNothingOnClose()
Deprecated. replace by setUnstoppable

This method makes it impossible to close the dialog. Used when the method monitored by the progres bar can not be stopped.


setUnstoppable

public void setUnstoppable(boolean unstoppable)
Set this to true of the process the progress bar is used for is not possible to stop, or not possble to stop nicely. If the user still tries to close the progress bar the a warning message is first shown were the user has to confirm that he/she still wants to close the progress bar.

Parameters:
unstoppable -

getProgressBar

public JProgressBar getProgressBar()
Returns the progress bar for updates from external processes.

Returns:
the progress bar

setMaxProgressValue

public void setMaxProgressValue(int maxProgressValue)
Description copied from interface: WaitingHandler
Set the maximum value of the progress bar.

Specified by:
setMaxProgressValue in interface WaitingHandler
Parameters:
maxProgressValue - the max value

increaseProgressValue

public void increaseProgressValue()
Description copied from interface: WaitingHandler
Increase the progress bar value by one "counter".

Specified by:
increaseProgressValue in interface WaitingHandler

increaseProgressValue

public void increaseProgressValue(int increment)
Description copied from interface: WaitingHandler
Increase the progress bar value by the given amount.

Specified by:
increaseProgressValue in interface WaitingHandler
Parameters:
increment - the increment to increase the value by

setMaxSecondaryProgressValue

public void setMaxSecondaryProgressValue(int maxProgressValue)
Sets the maximal value of the progress bar.

Specified by:
setMaxSecondaryProgressValue in interface WaitingHandler
Parameters:
maxProgressValue - the maximal progress value

resetSecondaryProgressBar

public void resetSecondaryProgressBar()
resets the value of the progress bar.

Specified by:
resetSecondaryProgressBar in interface WaitingHandler

increaseSecondaryProgressValue

public void increaseSecondaryProgressValue()
Increases the progress bar.

Specified by:
increaseSecondaryProgressValue in interface WaitingHandler

setSecondaryProgressValue

public void setSecondaryProgressValue(int value)
Sets the value of the progress bar.

Specified by:
setSecondaryProgressValue in interface WaitingHandler
Parameters:
value - the progress value

increaseSecondaryProgressValue

public void increaseSecondaryProgressValue(int number)
Increases the value of the progress bar.

Specified by:
increaseSecondaryProgressValue in interface WaitingHandler
Parameters:
number - the increment number

setSecondaryProgressDialogIndeterminate

public void setSecondaryProgressDialogIndeterminate(boolean indeterminate)
Makes the dialog indeterminate or not indeterminate. Also turns the paint progress string on or off.

Specified by:
setSecondaryProgressDialogIndeterminate in interface WaitingHandler
Parameters:
indeterminate -

setRunFinished

public void setRunFinished()
Description copied from interface: WaitingHandler
Set the analysis as finished.

Specified by:
setRunFinished in interface WaitingHandler

setRunCanceled

public void setRunCanceled()
Description copied from interface: WaitingHandler
Set the analysis as canceled.

Specified by:
setRunCanceled in interface WaitingHandler

appendReport

public void appendReport(String report,
                         boolean includeDate,
                         boolean addNewLine)
Description copied from interface: WaitingHandler
Append text to the report.

Specified by:
appendReport in interface WaitingHandler
Parameters:
report - the text to append
includeDate - if the date and time is to be added to the front of the text
addNewLine - add a new line after the text?

appendReportNewLineNoDate

public void appendReportNewLineNoDate()
Description copied from interface: WaitingHandler
Append two tabs to the report. No new line.

Specified by:
appendReportNewLineNoDate in interface WaitingHandler

appendReportEndLine

public void appendReportEndLine()
Description copied from interface: WaitingHandler
Append a new line to the report.

Specified by:
appendReportEndLine in interface WaitingHandler

isRunCanceled

public boolean isRunCanceled()
Description copied from interface: WaitingHandler
Returns true if the run is canceled.

Specified by:
isRunCanceled in interface WaitingHandler
Returns:
true if the run is canceled

getSecondaryProgressBar

public JProgressBar getSecondaryProgressBar()
Description copied from interface: WaitingHandler
Returns the secondary progress bar for updates from external processes.

Specified by:
getSecondaryProgressBar in interface WaitingHandler
Returns:
the secondary progress bar, can be null

displayMessage

public void displayMessage(String message,
                           String title,
                           int messageType)
Description copied from interface: WaitingHandler
Display a given message to the user separatly from the main output. For example a warning or error message. Usually in a separate dialog if a grahical waiting handler is used.

Specified by:
displayMessage in interface WaitingHandler
Parameters:
message - the message to display
title - the title of the message
messageType - the message type in the, e.g., JOptionPane.INFORMATION_MESSAGE

displayHtmlMessage

public void displayHtmlMessage(JEditorPane messagePane,
                               String title,
                               int messageType)
Description copied from interface: WaitingHandler
Display a given html containing message to the user separatly from the main output. For example a warning or error message. Usually in a separate dialog if a grahical waiting handler is used. The html links should be clickable.

Specified by:
displayHtmlMessage in interface WaitingHandler

setWaitingText

public void setWaitingText(String text)
Description copied from interface: WaitingHandler
Sets the text describing what is currently waited for.

Specified by:
setWaitingText in interface WaitingHandler
Parameters:
text - a text describing what is currently waited for


Copyright © 2012. All Rights Reserved.