Class WaitingDialog
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
com.compomics.util.gui.waiting.waitinghandlers.WaitingDialog
- All Implemented Interfaces:
WaitingHandler,ImageObserver,MenuContainer,Serializable,Accessible,RootPaneContainer,WindowConstants
A dialog displaying progress details.
- Author:
- Marc Vaudel, Harald Barsnes
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JDialog
JDialog.AccessibleJDialogNested classes/interfaces inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityTypeNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested 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, rootPaneCheckingEnabledFields inherited from class java.awt.Dialog
DEFAULT_MODALITY_TYPEFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface com.compomics.util.waiting.WaitingHandler
SIMPLE_DATA_FORMAT, TAB_HTML, TAB_NON_HTMLFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionEmpty default constructorWaitingDialog(Frame waitingHandlerParent, Image normalIcon, Image waitingIcon, boolean shakeWhenFinished, String processName, String toolName, String toolVersion, boolean modal) Creates a new WaitingDialog.WaitingDialog(Frame waitingHandlerParent, Image normalIcon, Image waitingIcon, boolean shakeWhenFinished, ArrayList<String> tips, String processName, String toolName, String toolVersion, boolean modal) Creates a new WaitingDialog. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWaitingActionListener(WaitingActionListener waitingActionListener) Adds a waiting action listener.voidappendReport(String report, boolean includeDate, boolean addNewLine) Append text to the report.voidAppend a new line to the report.voidAppend two tabs to the report.voidcloseWhenComplete(boolean close) Set if the dialog is to be closed when the process is complete.booleanReturns if the waiting handler is to show the progress for the current process or not.Returns the last selected folder.intReturns the max primary progress counter.intReturns the max secondary progress counter.intReturns the primary progress counter.Returns the report.Returns the secondary progress bar for updates from external processes.intReturns the secondary progress counter.voidIncrease the primary progress counter by one "counter".voidincreasePrimaryProgressCounter(int value) Increase the primary progress counter by the given increment.voidIncrease the secondary progress bar value by one "counter".voidincreaseSecondaryProgressCounter(int value) Increase the secondary progress counter by the given value.booleanisReport()Indicates whether this waiting handler supports reports.booleanReturns true if the run is canceled.booleanReturns true if the process is finished.voidReset the primary progress counter to 0.voidReset the secondary progress counter to 0.voidsetCloseDialogWhenImportCompletes(boolean closeWhenComplete, boolean enabled) Set if the value for if the dialog is to be closed when completed and if the option is enabled or not.voidsetDisplayProgress(boolean displayProgress) Set if the waiting handler is to show the progress for the current process or not.voidsetLastSelectedFolder(String lastSelectedFolder) Sets the last selected folder.voidsetMaxPrimaryProgressCounter(int maxProgressValue) Set the maximum value for the primary progress counter.voidsetMaxSecondaryProgressCounter(int maxProgressValue) Set the maximum value for the secondary progress counter.voidsetPrimaryProgressCounter(int value) Sets the primary progress counter to the given value.voidsetPrimaryProgressCounterIndeterminate(boolean indeterminate) Sets whether the primary progress counter is indeterminate or not.voidSet the process as canceled.voidSet the process as finished.voidSet the run to not finished.voidsetSecondaryProgressCounter(int value) Sets the secondary progress counter to the given value.voidsetSecondaryProgressCounterIndeterminate(boolean indeterminate) Sets the secondary progress counter to indeterminate or not.voidSet the secondary progress counter text.voidsetVisible(boolean b) voidsetWaitingText(String text) Sets the text describing what is currently being waited for.voidMake the dialog shake when the process has completed.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, updateMethods inherited from class java.awt.Dialog
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, show, toBackMethods 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, toFrontMethods 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, validateTreeMethods 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
-
Constructor Details
-
WaitingDialog
public WaitingDialog()Empty default constructor -
WaitingDialog
public WaitingDialog(Frame waitingHandlerParent, Image normalIcon, Image waitingIcon, boolean shakeWhenFinished, String processName, String toolName, String toolVersion, boolean modal) Creates a new WaitingDialog.- Parameters:
waitingHandlerParent- a reference to the handler parentnormalIcon- the dialog/frame icon to use when donewaitingIcon- the dialog/frame icon to use when waitingshakeWhenFinished- shake when completed, mainly a PeptideShaker featureprocessName- the name of the process we are waiting for, e.g., 'Import Data' or 'Search'toolName- the name of the tool, need for the reporttoolVersion- the version number of the tool, needed for the reportmodal- if the dialog is to be modal or not
-
WaitingDialog
public WaitingDialog(Frame waitingHandlerParent, Image normalIcon, Image waitingIcon, boolean shakeWhenFinished, ArrayList<String> tips, String processName, String toolName, String toolVersion, boolean modal) Creates a new WaitingDialog.- Parameters:
waitingHandlerParent- a reference to the handler parentnormalIcon- the dialog/frame icon to use when donewaitingIcon- the dialog/frame icon to use when waitingshakeWhenFinished- shake when completed, mainly a PeptideShaker featuretips- the list of Tip of the dayprocessName- the name of the process we are waiting fortoolName- the name of the tool, need for the reporttoolVersion- the version number of the tool, needed for the reportmodal- if the dialog is to be modal or not
-
-
Method Details
-
closeWhenComplete
public void closeWhenComplete(boolean close) Set if the dialog is to be closed when the process is complete.- Parameters:
close- if the dialog is to be closed when the process is complete
-
setPrimaryProgressCounter
public void setPrimaryProgressCounter(int value) Description copied from interface:WaitingHandlerSets the primary progress counter to the given value.- Specified by:
setPrimaryProgressCounterin interfaceWaitingHandler- Parameters:
value- the progress value
-
setMaxPrimaryProgressCounter
public void setMaxPrimaryProgressCounter(int maxProgressValue) Description copied from interface:WaitingHandlerSet the maximum value for the primary progress counter.- Specified by:
setMaxPrimaryProgressCounterin interfaceWaitingHandler- Parameters:
maxProgressValue- the max value
-
increasePrimaryProgressCounter
public void increasePrimaryProgressCounter()Description copied from interface:WaitingHandlerIncrease the primary progress counter by one "counter".- Specified by:
increasePrimaryProgressCounterin interfaceWaitingHandler
-
increasePrimaryProgressCounter
public void increasePrimaryProgressCounter(int value) Description copied from interface:WaitingHandlerIncrease the primary progress counter by the given increment.- Specified by:
increasePrimaryProgressCounterin interfaceWaitingHandler- Parameters:
value- the increment to increase the value by
-
setMaxSecondaryProgressCounter
public void setMaxSecondaryProgressCounter(int maxProgressValue) Description copied from interface:WaitingHandlerSet the maximum value for the secondary progress counter.- Specified by:
setMaxSecondaryProgressCounterin interfaceWaitingHandler- Parameters:
maxProgressValue- the max value
-
resetSecondaryProgressCounter
public void resetSecondaryProgressCounter()Description copied from interface:WaitingHandlerReset the secondary progress counter to 0.- Specified by:
resetSecondaryProgressCounterin interfaceWaitingHandler
-
resetPrimaryProgressCounter
public void resetPrimaryProgressCounter()Description copied from interface:WaitingHandlerReset the primary progress counter to 0.- Specified by:
resetPrimaryProgressCounterin interfaceWaitingHandler
-
increaseSecondaryProgressCounter
public void increaseSecondaryProgressCounter()Increase the secondary progress bar value by one "counter".- Specified by:
increaseSecondaryProgressCounterin interfaceWaitingHandler
-
setSecondaryProgressCounter
public void setSecondaryProgressCounter(int value) Description copied from interface:WaitingHandlerSets the secondary progress counter to the given value.- Specified by:
setSecondaryProgressCounterin interfaceWaitingHandler- Parameters:
value- the progress value
-
increaseSecondaryProgressCounter
public void increaseSecondaryProgressCounter(int value) Description copied from interface:WaitingHandlerIncrease the secondary progress counter by the given value.- Specified by:
increaseSecondaryProgressCounterin interfaceWaitingHandler- Parameters:
value- the value to increase the value by
-
setSecondaryProgressCounterIndeterminate
public void setSecondaryProgressCounterIndeterminate(boolean indeterminate) Description copied from interface:WaitingHandlerSets the secondary progress counter to indeterminate or not.- Specified by:
setSecondaryProgressCounterIndeterminatein interfaceWaitingHandler- Parameters:
indeterminate- if true, set to indeterminate
-
getLastSelectedFolder
Returns the last selected folder. Null if none set.- Returns:
- the last selected folder as string
-
setLastSelectedFolder
Sets the last selected folder.- Parameters:
lastSelectedFolder- the last selected folder as string
-
setRunFinished
public void setRunFinished()Description copied from interface:WaitingHandlerSet the process as finished.- Specified by:
setRunFinishedin interfaceWaitingHandler
-
setRunCanceled
public void setRunCanceled()Description copied from interface:WaitingHandlerSet the process as canceled.- Specified by:
setRunCanceledin interfaceWaitingHandler
-
appendReport
Description copied from interface:WaitingHandlerAppend text to the report.- Specified by:
appendReportin interfaceWaitingHandler- Parameters:
report- the text to appendincludeDate- if the date and time is to be added to the front of the textaddNewLine- add a new line after the text?
-
appendReportNewLineNoDate
public void appendReportNewLineNoDate()Description copied from interface:WaitingHandlerAppend two tabs to the report. No new line.- Specified by:
appendReportNewLineNoDatein interfaceWaitingHandler
-
appendReportEndLine
public void appendReportEndLine()Description copied from interface:WaitingHandlerAppend a new line to the report.- Specified by:
appendReportEndLinein interfaceWaitingHandler
-
isRunCanceled
public boolean isRunCanceled()Description copied from interface:WaitingHandlerReturns true if the run is canceled.- Specified by:
isRunCanceledin interfaceWaitingHandler- Returns:
- true if the run is canceled
-
startShake
public void startShake()Make the dialog shake when the process has completed. -
getSecondaryProgressBar
Returns the secondary progress bar for updates from external processes.- Returns:
- the secondary progress bar
-
setWaitingText
Description copied from interface:WaitingHandlerSets the text describing what is currently being waited for.- Specified by:
setWaitingTextin interfaceWaitingHandler- Parameters:
text- a text describing what is currently waited for
-
isRunFinished
public boolean isRunFinished()Description copied from interface:WaitingHandlerReturns true if the process is finished.- Specified by:
isRunFinishedin interfaceWaitingHandler- Returns:
- true if the process is finished
-
getReport
Returns the report.- Parameters:
aFile- The file to send the report to. Note that only the name is used her and included in the report, the report is not sent to the file. Can be null.- Returns:
- the report
-
setPrimaryProgressCounterIndeterminate
public void setPrimaryProgressCounterIndeterminate(boolean indeterminate) Description copied from interface:WaitingHandlerSets whether the primary progress counter is indeterminate or not.- Specified by:
setPrimaryProgressCounterIndeterminatein interfaceWaitingHandler- Parameters:
indeterminate- a boolean indicating whether the primary progress counter is indeterminate or not
-
setCloseDialogWhenImportCompletes
public void setCloseDialogWhenImportCompletes(boolean closeWhenComplete, boolean enabled) Set if the value for if the dialog is to be closed when completed and if the option is enabled or not.- Parameters:
closeWhenComplete- if true, the dialog closes when completedenabled- enable or disable the check box
-
setRunNotFinished
public void setRunNotFinished()Set the run to not finished. -
isReport
public boolean isReport()Description copied from interface:WaitingHandlerIndicates whether this waiting handler supports reports.- Specified by:
isReportin interfaceWaitingHandler- Returns:
- a boolean indicating whether this waiting handler supports reports
-
addWaitingActionListener
Adds a waiting action listener.- Parameters:
waitingActionListener- the waiting action listener
-
setSecondaryProgressText
Description copied from interface:WaitingHandlerSet the secondary progress counter text.- Specified by:
setSecondaryProgressTextin interfaceWaitingHandler- Parameters:
text- the text to set
-
getPrimaryProgressCounter
public int getPrimaryProgressCounter()Description copied from interface:WaitingHandlerReturns the primary progress counter.- Specified by:
getPrimaryProgressCounterin interfaceWaitingHandler- Returns:
- primary progress counter
-
getMaxPrimaryProgressCounter
public int getMaxPrimaryProgressCounter()Description copied from interface:WaitingHandlerReturns the max primary progress counter.- Specified by:
getMaxPrimaryProgressCounterin interfaceWaitingHandler- Returns:
- max primary progress counter
-
getSecondaryProgressCounter
public int getSecondaryProgressCounter()Description copied from interface:WaitingHandlerReturns the secondary progress counter.- Specified by:
getSecondaryProgressCounterin interfaceWaitingHandler- Returns:
- secondary progress counter
-
getMaxSecondaryProgressCounter
public int getMaxSecondaryProgressCounter()Description copied from interface:WaitingHandlerReturns the max secondary progress counter.- Specified by:
getMaxSecondaryProgressCounterin interfaceWaitingHandler- Returns:
- max secondary progress counter
-
setVisible
public void setVisible(boolean b) - Overrides:
setVisiblein classDialog
-
setDisplayProgress
public void setDisplayProgress(boolean displayProgress) Description copied from interface:WaitingHandlerSet if the waiting handler is to show the progress for the current process or not. Useful when running subprocesses that one wants to be able to cancel but do not want to show the progress for.- Specified by:
setDisplayProgressin interfaceWaitingHandler- Parameters:
displayProgress- if the waiting handler is to show the progress for the current process or not
-
getDisplayProgress
public boolean getDisplayProgress()Description copied from interface:WaitingHandlerReturns if the waiting handler is to show the progress for the current process or not. Useful when running subprocesses that one wants to be able to cancel but do not want to show the progress for.- Specified by:
getDisplayProgressin interfaceWaitingHandler- Returns:
- if the waiting handler is to show the progress for the current process or not
-