com.compomics.util.gui.waiting
Interface WaitingHandler

All Known Implementing Classes:
ProgressDialogX, WaitingDialog, WaitingHandlerCLIImpl

public interface WaitingHandler

An interface for code dealing with how to handle information that is displayed to the user during the loading of new projetcs.

Author:
Harald Barsnes

Field Summary
static java.text.SimpleDateFormat sdf
          Convenience date format.
static java.lang.String tab
          The tab space to add when using tab.
 
Method Summary
 void appendReport(java.lang.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(javax.swing.JEditorPane messagePane, java.lang.String title, int messageType)
          Display a given html containing message to the user separatly from the main output.
 void displayMessage(java.lang.String message, java.lang.String title, int messageType)
          Display a given message to the user separately from the main output.
 javax.swing.JProgressBar getPrimaryProgressBar()
          Returns the primary progress bar for updates from external processes.
 javax.swing.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 number.
 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.
 void resetSecondaryProgressBar()
          Reset the secondary progress bar value to 0.
 void setIndeterminate(boolean indeterminate)
          Sets whether the primary progress bar is indeterminate or not.
 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 analysis as canceled.
 void setRunFinished()
          Set the analysis as 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(java.lang.String text)
          Sets the text describing what is currently waited for.
 

Field Detail

sdf

static final java.text.SimpleDateFormat sdf
Convenience date format.


tab

static final java.lang.String tab
The tab space to add when using tab.

See Also:
Constant Field Values
Method Detail

setIndeterminate

void setIndeterminate(boolean indeterminate)
Sets whether the primary progress bar is indeterminate or not. Also turns the paint progress string on or off.

Parameters:
indeterminate - a boolean indicating whether the primary progress bar shall be indeterminate or not

setMaxProgressValue

void setMaxProgressValue(int maxProgressValue)
Set the maximum value of the progress bar.

Parameters:
maxProgressValue - the max value

increaseProgressValue

void increaseProgressValue()
Increase the progress bar value by one "counter".


increaseProgressValue

void increaseProgressValue(int increment)
Increase the progress bar value by the given number.

Parameters:
increment - the increment to increase the value by

setMaxSecondaryProgressValue

void setMaxSecondaryProgressValue(int maxProgressValue)
Set the maximum value of the secondary progress bar. And resets the value to 0.

Parameters:
maxProgressValue - the max value

resetSecondaryProgressBar

void resetSecondaryProgressBar()
Reset the secondary progress bar value to 0.


increaseSecondaryProgressValue

void increaseSecondaryProgressValue()
Increase the secondary progress bar value by one "counter".


setSecondaryProgressValue

void setSecondaryProgressValue(int value)
Sets the secondary progress bar to the given value.

Parameters:
value - the progress value

increaseSecondaryProgressValue

void increaseSecondaryProgressValue(int amount)
Increase the secondary progress bar value by the given amount.

Parameters:
amount - the amount to increase the value by

setSecondaryProgressDialogIndeterminate

void setSecondaryProgressDialogIndeterminate(boolean indeterminate)
Sets the secondary progress bar to indeterminate or not.

Parameters:
indeterminate - if true, set to indeterminate

setRunFinished

void setRunFinished()
Set the analysis as finished.


setRunCanceled

void setRunCanceled()
Set the analysis as canceled.


appendReport

void appendReport(java.lang.String report,
                  boolean includeDate,
                  boolean addNewLine)
Append text to the report.

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

void appendReportNewLineNoDate()
Append two tabs to the report. No new line.


appendReportEndLine

void appendReportEndLine()
Append a new line to the report.


isRunCanceled

boolean isRunCanceled()
Returns true if the run is canceled.

Returns:
true if the run is canceled

getSecondaryProgressBar

javax.swing.JProgressBar getSecondaryProgressBar()
Returns the secondary progress bar for updates from external processes.

Returns:
the secondary progress bar, can be null

getPrimaryProgressBar

javax.swing.JProgressBar getPrimaryProgressBar()
Returns the primary progress bar for updates from external processes. Warning: shall not be used for command line processes

Returns:
the primary progress bar, can be null

displayMessage

void displayMessage(java.lang.String message,
                    java.lang.String title,
                    int messageType)
Display a given message to the user separately from the main output. For example a warning or error message. Usually in a separate dialog if a graphical waiting handler is used. Warning: shall not be used for command line processes

Parameters:
message - the message to display
title - the title of the message
messageType - the message type in the, e.g., JOptionPane.INFORMATION_MESSAGE

displayHtmlMessage

void displayHtmlMessage(javax.swing.JEditorPane messagePane,
                        java.lang.String title,
                        int messageType)
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.

Parameters:
messagePane -
title -
messageType -

setWaitingText

void setWaitingText(java.lang.String text)
Sets the text describing what is currently waited for.

Parameters:
text - a text describing what is currently waited for


Copyright © 2013. All Rights Reserved.