public class WaitingDialog extends JDialog implements WaitingHandler
JDialog.AccessibleJDialog
Dialog.AccessibleAWTDialog, Dialog.ModalExclusionType, Dialog.ModalityType
Window.AccessibleAWTWindow, Window.Type
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
accessibleContext, rootPane, rootPaneCheckingEnabled
DEFAULT_MODALITY_TYPE
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
sdf, tab
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
WaitingDialog(Frame waitingHandlerParent,
Image normalIcon,
Image waitingIcon,
boolean shakeWhenFinished,
ArrayList<String> tips,
String processName,
String toolName,
String toolVersion,
boolean modal)
Creates a new WaitingDialog.
|
WaitingDialog(Frame waitingHandlerParent,
Image normalIcon,
Image waitingIcon,
boolean shakeWhenFinished,
String processName,
String toolName,
String toolVersion,
boolean modal)
Creates a new WaitingDialog.
|
Modifier and Type | Method and Description |
---|---|
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 |
closeWhenComplete(boolean close)
Set if the dialog is to be closed when the process is complete.
|
void |
displayHtmlMessage(JEditorPane messagePane,
String title,
int messageType)
Display a given HTML containing message to the user separately from the
main output.
|
void |
displayMessage(String message,
String title,
int messageType)
Display a given message to the user separately from the main output.
|
String |
getLastSelectedFolder()
Returns the last selected folder.
|
JProgressBar |
getPrimaryProgressBar()
Returns the primary progress bar for updates from external processes.
|
String |
getReport(File aFile)
Returns the report.
|
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 amount)
Increase the progress bar value by the given amount.
|
void |
increaseSecondaryProgressValue()
Increase the secondary progress bar value by one "counter".
|
void |
increaseSecondaryProgressValue(int amount)
Increase the secondary progress bar value by the given amount.
|
boolean |
isRunCanceled()
Returns true if the run is canceled.
|
boolean |
isRunFinished()
Returns true if the run is finished.
|
void |
resetProgressBar()
Reset the primary progress bar value to 0.
|
void |
resetSecondaryProgressBar()
Reset the secondary progress bar value to 0.
|
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.
|
void |
setIndeterminate(boolean indeterminate)
Sets whether the primary progress bar is indeterminate or not.
|
void |
setLastSelectedFolder(String lastSelectedFolder)
Sets the last selected folder.
|
void |
setMaxProgressValue(int maxProgressValue)
Set the maximum value of the progress bar.
|
void |
setMaxSecondaryProgressValue(int maxProgressValue)
Set the maximum value of the secondary progress bar.
|
void |
setRunCanceled()
Set the process as canceled.
|
void |
setRunFinished()
Set the process as finished.
|
void |
setRunNotFinished()
Set the run to not finished.
|
void |
setSecondaryProgressDialogIndeterminate(boolean indeterminate)
Sets the secondary progress bar to indeterminate or not.
|
void |
setSecondaryProgressValue(int value)
Sets the secondary progress bar to the given value.
|
void |
setWaitingText(String text)
Sets the text describing what is currently waited for.
|
void |
startShake()
Make the dialog shake when the process has completed.
|
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
addNotify, getModalityType, getTitle, hide, isModal, isResizable, isUndecorated, setBackground, setModal, setModalityType, setOpacity, setResizable, setShape, setTitle, setUndecorated, setVisible, show, toBack
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
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
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, 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, 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, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public WaitingDialog(Frame waitingHandlerParent, Image normalIcon, Image waitingIcon, boolean shakeWhenFinished, String processName, String toolName, String toolVersion, boolean modal)
waitingHandlerParent
- a reference to the handler parentwaitingIcon
- the dialog/frame icon to use when waitingnormalIcon
- the dialog/frame icon to use when doneshakeWhenFinished
- 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, need for the reportmodal
- public WaitingDialog(Frame waitingHandlerParent, Image normalIcon, Image waitingIcon, boolean shakeWhenFinished, ArrayList<String> tips, String processName, String toolName, String toolVersion, boolean modal)
waitingHandlerParent
- a reference to the handler parentwaitingIcon
- the dialog/frame icon to use when waitingnormalIcon
- the dialog/frame icon to use when doneshakeWhenFinished
- shake when completed, mainly a PeptideShaker
featureprocessName
- the name of the process we are waiting formodal
- toolName
- the name of the tool, need for the reporttoolVersion
- the version number of the tool, need for the reporttips
- the list of Tip of the daypublic void closeWhenComplete(boolean close)
close
- public void setMaxProgressValue(int maxProgressValue)
setMaxProgressValue
in interface WaitingHandler
maxProgressValue
- the max valuepublic void increaseProgressValue()
increaseProgressValue
in interface WaitingHandler
public void increaseProgressValue(int amount)
increaseProgressValue
in interface WaitingHandler
amount
- the amount to increase the value bypublic void setMaxSecondaryProgressValue(int maxProgressValue)
setMaxSecondaryProgressValue
in interface WaitingHandler
maxProgressValue
- the max valuepublic void resetSecondaryProgressBar()
resetSecondaryProgressBar
in interface WaitingHandler
public void resetProgressBar()
public void increaseSecondaryProgressValue()
increaseSecondaryProgressValue
in interface WaitingHandler
public void setSecondaryProgressValue(int value)
setSecondaryProgressValue
in interface WaitingHandler
value
- the progress valuepublic void increaseSecondaryProgressValue(int amount)
increaseSecondaryProgressValue
in interface WaitingHandler
amount
- the amount to increase the value bypublic void setSecondaryProgressDialogIndeterminate(boolean indeterminate)
setSecondaryProgressDialogIndeterminate
in interface WaitingHandler
indeterminate
- if true, set to indeterminatepublic String getLastSelectedFolder()
public void setLastSelectedFolder(String lastSelectedFolder)
lastSelectedFolder
- the last selected folder as stringpublic void setRunFinished()
setRunFinished
in interface WaitingHandler
public void setRunCanceled()
setRunCanceled
in interface WaitingHandler
public void appendReport(String report, boolean includeDate, boolean addNewLine)
WaitingHandler
appendReport
in interface WaitingHandler
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?public void appendReportNewLineNoDate()
appendReportNewLineNoDate
in interface WaitingHandler
public void appendReportEndLine()
appendReportEndLine
in interface WaitingHandler
public boolean isRunCanceled()
isRunCanceled
in interface WaitingHandler
public void startShake()
public JProgressBar getSecondaryProgressBar()
getSecondaryProgressBar
in interface WaitingHandler
public void displayMessage(String message, String title, int messageType)
WaitingHandler
displayMessage
in interface WaitingHandler
message
- the message to displaytitle
- the title of the messagemessageType
- the message type in the, e.g.,
JOptionPane.INFORMATION_MESSAGEpublic void displayHtmlMessage(JEditorPane messagePane, String title, int messageType)
WaitingHandler
displayHtmlMessage
in interface WaitingHandler
public void setWaitingText(String text)
WaitingHandler
setWaitingText
in interface WaitingHandler
text
- a text describing what is currently waited forpublic boolean isRunFinished()
public String getReport(File aFile)
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.public JProgressBar getPrimaryProgressBar()
WaitingHandler
getPrimaryProgressBar
in interface WaitingHandler
public void setIndeterminate(boolean indeterminate)
WaitingHandler
setIndeterminate
in interface WaitingHandler
indeterminate
- a boolean indicating whether the primary progress
bar shall be indeterminate or notpublic void setCloseDialogWhenImportCompletes(boolean closeWhenComplete, boolean enabled)
closeWhenComplete
- if true, the dialog closes when completedenabled
- enable or disable the check boxpublic void setRunNotFinished()
Copyright © 2013. All Rights Reserved.