Package com.compomics.util.waiting
Interface WaitingHandler
- All Known Implementing Classes:
ProgressDialogX
,WaitingDialog
,WaitingHandlerCLIImpl
,WaitingHandlerDummy
public interface WaitingHandler
An interface for code dealing with how to handle information that is
displayed to the user during loading or processing.
- Author:
- Harald Barsnes
-
Field Summary
Fields Modifier and Type Field Description static SimpleDateFormat
SIMPLE_DATA_FORMAT
Convenience date format.static String
TAB_HTML
The tab space to add when using HTML.static String
TAB_NON_HTML
The tab space to add when not using HTML. -
Method Summary
Modifier and Type Method 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.boolean
getDisplayProgress()
Returns if the waiting handler is to show the progress for the current process or not.int
getMaxPrimaryProgressCounter()
Returns the max primary progress counter.int
getMaxSecondaryProgressCounter()
Returns the max secondary progress counter.int
getPrimaryProgressCounter()
Returns the primary progress counter.int
getSecondaryProgressCounter()
Returns the secondary progress counter.void
increasePrimaryProgressCounter()
Increase the primary progress counter by one "counter".void
increasePrimaryProgressCounter(int increment)
Increase the primary progress counter by the given increment.void
increaseSecondaryProgressCounter()
Increase the secondary progress counter by one "counter".void
increaseSecondaryProgressCounter(int value)
Increase the secondary progress counter by the given value.boolean
isReport()
Indicates whether this waiting handler supports reports.boolean
isRunCanceled()
Returns true if the run is canceled.boolean
isRunFinished()
Returns true if the process is finished.void
resetPrimaryProgressCounter()
Reset the primary progress counter to 0.void
resetSecondaryProgressCounter()
Reset the secondary progress counter to 0.void
setDisplayProgress(boolean displayProgress)
Set if the waiting handler is to show the progress for the current process or not.void
setMaxPrimaryProgressCounter(int maxProgressValue)
Set the maximum value for the primary progress counter.void
setMaxSecondaryProgressCounter(int maxProgressValue)
Set the maximum value for the secondary progress counter.void
setPrimaryProgressCounter(int value)
Sets the primary progress counter to the given value.void
setPrimaryProgressCounterIndeterminate(boolean indeterminate)
Sets whether the primary progress counter is indeterminate or not.void
setRunCanceled()
Set the process as canceled.void
setRunFinished()
Set the process as finished.void
setSecondaryProgressCounter(int value)
Sets the secondary progress counter to the given value.void
setSecondaryProgressCounterIndeterminate(boolean indeterminate)
Sets the secondary progress counter to indeterminate or not.void
setSecondaryProgressText(String text)
Set the secondary progress counter text.void
setWaitingText(String text)
Sets the text describing what is currently being waited for.
-
Field Details
-
SIMPLE_DATA_FORMAT
Convenience date format. -
TAB_HTML
The tab space to add when using HTML.- See Also:
- Constant Field Values
-
TAB_NON_HTML
The tab space to add when not using HTML.- See Also:
- Constant Field Values
-
-
Method Details
-
setPrimaryProgressCounterIndeterminate
void setPrimaryProgressCounterIndeterminate(boolean indeterminate)Sets whether the primary progress counter is indeterminate or not.- Parameters:
indeterminate
- a boolean indicating whether the primary progress counter is indeterminate or not
-
setMaxPrimaryProgressCounter
void setMaxPrimaryProgressCounter(int maxProgressValue)Set the maximum value for the primary progress counter.- Parameters:
maxProgressValue
- the max value
-
increasePrimaryProgressCounter
void increasePrimaryProgressCounter()Increase the primary progress counter by one "counter". -
increasePrimaryProgressCounter
void increasePrimaryProgressCounter(int increment)Increase the primary progress counter by the given increment.- Parameters:
increment
- the increment to increase the value by
-
setPrimaryProgressCounter
void setPrimaryProgressCounter(int value)Sets the primary progress counter to the given value.- Parameters:
value
- the progress value
-
setMaxSecondaryProgressCounter
void setMaxSecondaryProgressCounter(int maxProgressValue)Set the maximum value for the secondary progress counter.- Parameters:
maxProgressValue
- the max value
-
resetPrimaryProgressCounter
void resetPrimaryProgressCounter()Reset the primary progress counter to 0. -
resetSecondaryProgressCounter
void resetSecondaryProgressCounter()Reset the secondary progress counter to 0. -
increaseSecondaryProgressCounter
void increaseSecondaryProgressCounter()Increase the secondary progress counter by one "counter". -
setSecondaryProgressCounter
void setSecondaryProgressCounter(int value)Sets the secondary progress counter to the given value.- Parameters:
value
- the progress value
-
increaseSecondaryProgressCounter
void increaseSecondaryProgressCounter(int value)Increase the secondary progress counter by the given value.- Parameters:
value
- the value to increase the value by
-
setSecondaryProgressCounterIndeterminate
void setSecondaryProgressCounterIndeterminate(boolean indeterminate)Sets the secondary progress counter to indeterminate or not.- Parameters:
indeterminate
- if true, set to indeterminate
-
setRunFinished
void setRunFinished()Set the process as finished. -
setRunCanceled
void setRunCanceled()Set the process as canceled. -
appendReport
Append text to the report.- 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
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
-
isRunFinished
boolean isRunFinished()Returns true if the process is finished.- Returns:
- true if the process is finished
-
setSecondaryProgressText
Set the secondary progress counter text.- Parameters:
text
- the text to set
-
isReport
boolean isReport()Indicates whether this waiting handler supports reports.- Returns:
- a boolean indicating whether this waiting handler supports reports
-
setWaitingText
Sets the text describing what is currently being waited for.- Parameters:
text
- a text describing what is currently waited for
-
getPrimaryProgressCounter
int getPrimaryProgressCounter()Returns the primary progress counter.- Returns:
- primary progress counter
-
getMaxPrimaryProgressCounter
int getMaxPrimaryProgressCounter()Returns the max primary progress counter.- Returns:
- max primary progress counter
-
getSecondaryProgressCounter
int getSecondaryProgressCounter()Returns the secondary progress counter.- Returns:
- secondary progress counter
-
getMaxSecondaryProgressCounter
int getMaxSecondaryProgressCounter()Returns the max secondary progress counter.- Returns:
- max secondary progress counter
-
setDisplayProgress
void setDisplayProgress(boolean displayProgress)Set 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.- Parameters:
displayProgress
- if the waiting handler is to show the progress for the current process or not
-
getDisplayProgress
boolean getDisplayProgress()Returns 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.- Returns:
- if the waiting handler is to show the progress for the current process or not
-