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

java.lang.Object
  extended by com.compomics.util.gui.waiting.waitinghandlers.WaitingHandlerCLIImpl
All Implemented Interfaces:
WaitingHandler

public class WaitingHandlerCLIImpl
extends java.lang.Object
implements WaitingHandler

This class is an implementation of the WaitingHandler interface to be used when operating through the Command Line Interface.

Author:
Kenny Helsens

Field Summary
protected  java.lang.String iReport
          The report to append
 
Fields inherited from interface com.compomics.util.gui.waiting.WaitingHandler
sdf, tab
 
Constructor Summary
WaitingHandlerCLIImpl()
           
 
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 amount)
          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 intermediate)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iReport

protected java.lang.String iReport
The report to append

Constructor Detail

WaitingHandlerCLIImpl

public WaitingHandlerCLIImpl()
Method Detail

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 amount)
Description copied from interface: WaitingHandler
Increase the progress bar value by the given number.

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

setMaxSecondaryProgressValue

public void setMaxSecondaryProgressValue(int maxProgressValue)
Description copied from interface: WaitingHandler
Set the maximum value of the secondary progress bar. And resets the value to 0.

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

resetSecondaryProgressBar

public void resetSecondaryProgressBar()
Description copied from interface: WaitingHandler
Reset the secondary progress bar value to 0.

Specified by:
resetSecondaryProgressBar in interface WaitingHandler

increaseSecondaryProgressValue

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

Specified by:
increaseSecondaryProgressValue in interface WaitingHandler

setSecondaryProgressValue

public void setSecondaryProgressValue(int value)
Description copied from interface: WaitingHandler
Sets the secondary progress bar to the given value.

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

increaseSecondaryProgressValue

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

Specified by:
increaseSecondaryProgressValue in interface WaitingHandler
Parameters:
amount - the amount to increase the value by

setSecondaryProgressDialogIndeterminate

public void setSecondaryProgressDialogIndeterminate(boolean intermediate)
Description copied from interface: WaitingHandler
Sets the secondary progress bar to indeterminate or not.

Specified by:
setSecondaryProgressDialogIndeterminate in interface WaitingHandler
Parameters:
intermediate - if true, set to 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(java.lang.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 javax.swing.JProgressBar getSecondaryProgressBar()
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(java.lang.String message,
                           java.lang.String title,
                           int messageType)
Description copied from interface: WaitingHandler
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

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(javax.swing.JEditorPane messagePane,
                               java.lang.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(java.lang.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

getPrimaryProgressBar

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

Specified by:
getPrimaryProgressBar in interface WaitingHandler
Returns:
the primary progress bar, can be null

setIndeterminate

public void setIndeterminate(boolean indeterminate)
Description copied from interface: WaitingHandler
Sets whether the primary progress bar is indeterminate or not. Also turns the paint progress string on or off.

Specified by:
setIndeterminate in interface WaitingHandler
Parameters:
indeterminate - a boolean indicating whether the primary progress bar shall be indeterminate or not


Copyright © 2013. All Rights Reserved.