stella.jview
Class JMessageListener

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by util.rmi.RmiPropertyContainer
                  extended by util.rmi.AbstractRmiListener
                      extended by stella.MessageListener
                          extended by stella.jview.JMessageListener
All Implemented Interfaces:
Cloneable, Remote, EventListener, Displayable, RmiAcknowledgeListener, RmiCommandListener, RmiDataListener, RmiDoneListener, RmiErrorListener, RmiSerialListener, RmiWeatherListener, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiEventListener, RmiListener, RmiPropertyBearing

public class JMessageListener
extends MessageListener
implements Displayable

A class to use as message listener. Depending on the various keys, MessageListener.KEY_COMMAND, MessageListener.KEY_ACKNOWLEDGE, MessageListener.KEY_DONE, and MessageListener.KEY_ERROR this logger registers itself at the appropriate rmi-casters. Any message received from the casters is dumped into the display, distinguished by color (see the appropriate color keys in the JStatusPanel class). The JStatusField.KEY_STATUSSIZE key points to a minimum size of the display area.


Nested Class Summary
 
Nested classes/interfaces inherited from class stella.MessageListener
MessageListener.Run
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  JStatusExit status
          The status panel used for displaying the received messages.
 
Fields inherited from class stella.MessageListener
KEY_ACKNOWLEDGE, KEY_BIND, KEY_BINDNAME, KEY_COMMAND, KEY_DATA, KEY_DONE, KEY_ERROR, KEY_SERIAL, KEY_WEATHER
 
Fields inherited from class util.rmi.AbstractRmiListener
KEY_ALIVE, KEY_EXPORTPORT, KEY_INIT, KEY_LISTENERNAME, KEY_RETRY, KEY_RETRYSLEEP, KEY_SHUTDOWNDELAY
 
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
JMessageListener(Map info)
          Constructs a new message logger.
 
Method Summary
 Icon getIcon()
          Might return an icon, if one was stated in the properties
private static JPanel getLabel(String arg1, String arg2)
          Returns a jpanel that consists of horizontal glue, a right-centered label with the first argument string, a left-centered label with the second argument and horizontal glue again.
 Component getRepresentation()
          Returns a panel ready for display in a window.
static void main(String[] arg)
          Launches a new window consisting of an extended status region and a short list of registered casters.
 void rmiCommand(CommandEvent ce)
          The receiving edge of the command listener.
 void rmiDataAvailable(DataEvent de)
          The receiving edge of the data listener.
 void rmiErrorOccured(ErrorEvent ee)
          The receiving edge of the error listener.
 void rmiGotAcknowledge(AcknowledgeEvent ae)
          The receiving edge of the acknowledge listener.
 void rmiGotDone(DoneEvent de)
          The receiving edge of the done listener.
 void rmiSerial(SerialEvent se)
          The receiving edge of the serial listener.
 void rmiWeatherChanged(WeatherEvent we)
          The receiving edge of weather events.
 
Methods inherited from class stella.MessageListener
accepts, deregisterAtCaster, exit, init, registerAtCaster
 
Methods inherited from class util.rmi.AbstractRmiListener
allBound, blockBinding, blockBinding, disconnect, getIP, getListenerName, isConnected, listenerName, releaseBinding, releaseBinding, rescanned, startBinding, startBinding
 
Methods inherited from class util.rmi.RmiPropertyContainer
containsRemoteProperty, getRemoteProperties, getRemoteProperty, setRemoteProperty
 
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, 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.rmi.RmiEventListener
getListenerName
 
Methods inherited from interface util.rmi.RmiListener
disconnect, isConnected
 
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

status

private JStatusExit status
The status panel used for displaying the received messages.

Constructor Detail

JMessageListener

public JMessageListener(Map info)
                 throws RemoteException
Constructs a new message logger. The properties handed over are also used for constructing the status panel.

Throws:
RemoteException
Method Detail

getIcon

public Icon getIcon()
Might return an icon, if one was stated in the properties

Specified by:
getIcon in interface Displayable

getRepresentation

public Component getRepresentation()
Returns a panel ready for display in a window.

Specified by:
getRepresentation in interface Displayable

rmiCommand

public void rmiCommand(CommandEvent ce)
                throws RemoteException
The receiving edge of the command listener. Passes the command message received to the status field.

Specified by:
rmiCommand in interface RmiCommandListener
Overrides:
rmiCommand in class MessageListener
Throws:
RemoteException

rmiGotAcknowledge

public void rmiGotAcknowledge(AcknowledgeEvent ae)
                       throws RemoteException
The receiving edge of the acknowledge listener. Passes the acknowledge message received to the status field.

Specified by:
rmiGotAcknowledge in interface RmiAcknowledgeListener
Overrides:
rmiGotAcknowledge in class MessageListener
Throws:
RemoteException

rmiGotDone

public void rmiGotDone(DoneEvent de)
                throws RemoteException
The receiving edge of the done listener. Passes the done message received to the status field.

Specified by:
rmiGotDone in interface RmiDoneListener
Overrides:
rmiGotDone in class MessageListener
Throws:
RemoteException

rmiErrorOccured

public void rmiErrorOccured(ErrorEvent ee)
                     throws RemoteException
The receiving edge of the error listener. Passes the error/status message received to the status field's error channel.

Specified by:
rmiErrorOccured in interface RmiErrorListener
Overrides:
rmiErrorOccured in class MessageListener
Throws:
RemoteException

rmiDataAvailable

public void rmiDataAvailable(DataEvent de)
                      throws RemoteException
The receiving edge of the data listener. Passes the data event to the status field's message channel.

Specified by:
rmiDataAvailable in interface RmiDataListener
Overrides:
rmiDataAvailable in class MessageListener
Throws:
RemoteException

rmiSerial

public void rmiSerial(SerialEvent se)
               throws RemoteException
The receiving edge of the serial listener. Passes the serial event to the status field's message channel. If the serial event was a write command, a '>' is prepended to the serial string, for read events a '<' is prepended.

Specified by:
rmiSerial in interface RmiSerialListener
Overrides:
rmiSerial in class MessageListener
Throws:
RemoteException

rmiWeatherChanged

public void rmiWeatherChanged(WeatherEvent we)
                       throws RemoteException
The receiving edge of weather events. They are passed to the serial's error channel.

Specified by:
rmiWeatherChanged in interface RmiWeatherListener
Overrides:
rmiWeatherChanged in class MessageListener
Throws:
RemoteException

getLabel

private static JPanel getLabel(String arg1,
                               String arg2)
Returns a jpanel that consists of horizontal glue, a right-centered label with the first argument string, a left-centered label with the second argument and horizontal glue again.


main

public static void main(String[] arg)
Launches a new window consisting of an extended status region and a short list of registered casters.