jview
Class JStatusField

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by jview.AbstractDisplayable
                  extended by jview.JStatusField
All Implemented Interfaces:
Cloneable, Displayable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying
Direct Known Subclasses:
JLogField, JStatusPanel

public class JStatusField
extends AbstractDisplayable

This Class provides the status area. It consists of a generally writable (but not editable!) textarea for messages to the user. An JExitButton is added at the left edge. If constructed with an array of buttons, flow layout them between the exit button and the status field. The following properties are supported.

A typical status panel looks like this:

JStatusPanel


Nested Class Summary
static class JStatusField.Test
          Test purpose only.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static String DEBUG
          The name for the status text style.
private static Color DEFDEBUGCOLOR
          The default status color.
private static Color DEFERRORCOLOR
          The default error color.
private static Color DEFFATALCOLOR
          The default status color.
private static Color DEFINFOCOLOR
          The default status color.
private static Dimension DEFSTATUSSIZE
          The default dimension of the text pane.
private static Color DEFWARNINGCOLOR
          The default command color.
private  JPanel deliver
          Initialized at first call to getRepresentation().
private static String ERROR
          The name for the acknowledge text style.
private static String FATAL
          The name for the done text style.
private static String INFO
          The name for the status text style.
static String KEY_DEBUGCOLOR
          The key denoting the color of standard messages.
static String KEY_ERRORCOLOR
          The key denoting the color of error messages.
static String KEY_FATALCOLOR
          The key denoting the color of done messages.
static String KEY_INFOCOLOR
          The key denoting the color of standard messages.
static String KEY_STATUSSIZE
          The key denoting the minimum size of the text pane, MyDimension.
static String KEY_WARNINGCOLOR
          The key denoting the color of command messages.
private  JTextPane status
          The text area of this status field.
private static String WARNING
          The name for the command text style.
 
Fields inherited from class jview.AbstractDisplayable
KEY_COMPONENTNAME, KEY_ICON, KEY_INSETS
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
JStatusField(Map<String,String> prop)
          Creates a Status Panel without any additional buttons.
 
Method Summary
protected  void append(String text, Style how)
          Appends the given string to the end of the status text pane.
 void debug(String mess)
          Displays the message mess in Status with STATUSTEXT Color.
 void error(String err)
          Displays the error message err in Status with STATUSERROR Color.
 void error(Throwable err)
          Displays the error message err in Status with STATUSERROR Color.
 void fatal(String done)
          Displays the error message err in Status with STATUSERROR Color.
 Component getRepresentation()
          Returns the previously prepared representation.
protected  JTextPane getStatus()
          Returns the status text pane.
protected  Document getStatusDocument()
          Returns the text of the status field contained in a document object.
 void info(String mess)
          Displays the message mess in Status with STATUSTEXT Color.
 void init()
          Initializes the status field.
protected  JPanel prepareRepresentation()
          Prepares a panel that has the status field in its center.
protected  void setColor(Color textcol, String who)
          Sets the default color in which to draw messages.
 void warning(String mess)
          Displays the command mess in Status with COMMANDTEXT Color.
 
Methods inherited from class jview.AbstractDisplayable
getComponentName, getIcon, getIcon
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Field Detail

KEY_DEBUGCOLOR

public static final String KEY_DEBUGCOLOR
The key denoting the color of standard messages.

See Also:
Constant Field Values

KEY_INFOCOLOR

public static final String KEY_INFOCOLOR
The key denoting the color of standard messages.

See Also:
Constant Field Values

KEY_WARNINGCOLOR

public static final String KEY_WARNINGCOLOR
The key denoting the color of command messages.

See Also:
Constant Field Values

KEY_ERRORCOLOR

public static final String KEY_ERRORCOLOR
The key denoting the color of error messages.

See Also:
Constant Field Values

KEY_FATALCOLOR

public static final String KEY_FATALCOLOR
The key denoting the color of done messages.

See Also:
Constant Field Values

KEY_STATUSSIZE

public static final String KEY_STATUSSIZE
The key denoting the minimum size of the text pane, MyDimension.

See Also:
Constant Field Values

DEFDEBUGCOLOR

private static final Color DEFDEBUGCOLOR
The default status color.


DEFINFOCOLOR

private static final Color DEFINFOCOLOR
The default status color.


DEFWARNINGCOLOR

private static final Color DEFWARNINGCOLOR
The default command color.


DEFERRORCOLOR

private static final Color DEFERRORCOLOR
The default error color.


DEFFATALCOLOR

private static final Color DEFFATALCOLOR
The default status color.


DEFSTATUSSIZE

private static final Dimension DEFSTATUSSIZE
The default dimension of the text pane.


DEBUG

private static final String DEBUG
The name for the status text style.

See Also:
Constant Field Values

INFO

private static final String INFO
The name for the status text style.

See Also:
Constant Field Values

WARNING

private static final String WARNING
The name for the command text style.

See Also:
Constant Field Values

ERROR

private static final String ERROR
The name for the acknowledge text style.

See Also:
Constant Field Values

FATAL

private static final String FATAL
The name for the done text style.

See Also:
Constant Field Values

deliver

private JPanel deliver
Initialized at first call to getRepresentation().


status

private JTextPane status
The text area of this status field.

Constructor Detail

JStatusField

public JStatusField(Map<String,String> prop)
Creates a Status Panel without any additional buttons.

Method Detail

init

public void init()
Initializes the status field.

Specified by:
init in interface Initializable
Overrides:
init in class PropertyResources

getRepresentation

public Component getRepresentation()
Returns the previously prepared representation.


debug

public void debug(String mess)
Displays the message mess in Status with STATUSTEXT Color.

Parameters:
mess -

info

public void info(String mess)
Displays the message mess in Status with STATUSTEXT Color.

Parameters:
mess -

warning

public void warning(String mess)
Displays the command mess in Status with COMMANDTEXT Color.

Parameters:
mess -

error

public void error(String err)
Displays the error message err in Status with STATUSERROR Color.

Parameters:
err - The error message to print

error

public void error(Throwable err)
Displays the error message err in Status with STATUSERROR Color.

Parameters:
err - The exception to print

fatal

public void fatal(String done)
Displays the error message err in Status with STATUSERROR Color.

Parameters:
err -

prepareRepresentation

protected JPanel prepareRepresentation()
Prepares a panel that has the status field in its center. The panel uses a border layout, where the text is entered in the center. Subclasses can rely on the panel delivered to be border-layedout.


setColor

protected void setColor(Color textcol,
                        String who)
Sets the default color in which to draw messages.


getStatusDocument

protected Document getStatusDocument()
Returns the text of the status field contained in a document object.


getStatus

protected JTextPane getStatus()
Returns the status text pane.


append

protected void append(String text,
                      Style how)
Appends the given string to the end of the status text pane. The style how to add the text is given in the second argument.