edu.sdsc.mbt.util
Class Status

java.lang.Object
  extended byedu.sdsc.mbt.util.Status

public class Status
extends java.lang.Object

Provides a toolkit-wide static status message output mechanism. This should be used to produce textual status messages to the user. By default, messages are printed to the current terminal, but authors may elect to add StatusListener objects in order to capture the output for display in scrolling status GUIs, output logs, etc.

Author:
John L. Moreland
See Also:
StatusListener,


Field Summary
static int LEVEL_DEBUG
          On a scale of 1 to 5, how important is the message.
static int LEVEL_DUMP
          On a scale of 1 to 5, how important is the message.
static int LEVEL_ERROR
          On a scale of 1 to 5, how important is the message.
static int LEVEL_QUIET
          On a scale of 1 to 5, how important is the message.
static int LEVEL_REMARK
          On a scale of 1 to 5, how important is the message.
static int LEVEL_WARNING
          On a scale of 1 to 5, how important is the message.
 
Constructor Summary
Status()
           
 
Method Summary
static void addStatusListener(StatusListener statusListener)
          Add a StatusListener object in order to start recieving StatusEvent messages.
static void disableStatus()
           
static void enableStatus()
           
static int getLevelCount()
          Get the number of supported level values.
static java.lang.String getLevelName(int level)
          Get the human-reable name corresponding to the given level number.
static int getOutputLevel()
          Get the output level for subsequent calls to the output method.
static void output(int level, java.lang.String message)
          Output a message at the given status level.
static void progress(float percent, java.lang.String message)
          Show a short progress message and a percentage completed.
static void removeStatusListener(StatusListener statusListener)
          Remove a StatusListener object in order to stop recieving StatusEvent messages.
static void setOutputLevel(int level)
          Set the output level for subsequent calls to the output method.
static void setOutputLevel(java.lang.String level_name)
          Set the output level for subsequent calls to the output method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEVEL_QUIET

public static final int LEVEL_QUIET
On a scale of 1 to 5, how important is the message. A status level is passed to the output method in order for an application to specify the intent level of the message, and, the level is also used to set the constraint level for output. Only messages at or above this level will be output. Default terminal output is not generated.

See Also:
Constant Field Values

LEVEL_ERROR

public static final int LEVEL_ERROR
On a scale of 1 to 5, how important is the message. A status level is passed to the output method in order for an application to specify the intent level of the message, and, the level is also used to set the constraint level for output. Only messages at or above this level will be output. Default terminal output is sent to STDERR.

See Also:
Constant Field Values

LEVEL_WARNING

public static final int LEVEL_WARNING
On a scale of 1 to 5, how important is the message. A status level is passed to the output method in order for an application to specify the intent level of the message, and, the level is also used to set the constraint level for output. Only messages at or above this level will be output. Default terminal output is sent to STDOUT.

See Also:
Constant Field Values

LEVEL_REMARK

public static final int LEVEL_REMARK
On a scale of 1 to 5, how important is the message. A status level is passed to the output method in order for an application to specify the intent level of the message, and, the level is also used to set the constraint level for output. Only messages at or above this level will be output. Default terminal output is sent to STDOUT.

See Also:
Constant Field Values

LEVEL_DEBUG

public static final int LEVEL_DEBUG
On a scale of 1 to 5, how important is the message. A status level is passed to the output method in order for an application to specify the intent level of the message, and, the level is also used to set the constraint level for output. Only messages at or above this level will be output. Default terminal output is sent to STDERR.

See Also:
Constant Field Values

LEVEL_DUMP

public static final int LEVEL_DUMP
On a scale of 1 to 5, how important is the message. A status level is passed to the output method in order for an application to specify the intent level of the message, and, the level is also used to set the constraint level for output. Only messages at or above this level will be output. Default terminal output is sent to STDERR.

See Also:
Constant Field Values
Constructor Detail

Status

public Status()
Method Detail

disableStatus

public static void disableStatus()

enableStatus

public static void enableStatus()

addStatusListener

public static void addStatusListener(StatusListener statusListener)
Add a StatusListener object in order to start recieving StatusEvent messages. If one or more StatusListener objects are registered, then no messages are printed to the terminal by the output method.


removeStatusListener

public static void removeStatusListener(StatusListener statusListener)
Remove a StatusListener object in order to stop recieving StatusEvent messages. If one or more StatusListener objects are registered, then no messages are printed to the terminal by the output method.


setOutputLevel

public static void setOutputLevel(int level)
Set the output level for subsequent calls to the output method. Only messages at or above this level will be output.


setOutputLevel

public static void setOutputLevel(java.lang.String level_name)
Set the output level for subsequent calls to the output method. Only messages at or above this level will be output.


getOutputLevel

public static int getOutputLevel()
Get the output level for subsequent calls to the output method. Only messages at or above this level will be output.


getLevelCount

public static int getLevelCount()
Get the number of supported level values.


getLevelName

public static java.lang.String getLevelName(int level)
Get the human-reable name corresponding to the given level number.


output

public static void output(int level,
                          java.lang.String message)
Output a message at the given status level.


progress

public static void progress(float percent,
                            java.lang.String message)
Show a short progress message and a percentage completed. Progress percentage is clamped to a 0.0 to 1.0 range. If the message is null, don't show progress.