stella.jview
Class JMessageListener
java.lang.Object
util.PropertyContainer
util.PropertyResources
util.PropertyBundles
util.rmi.RmiPropertyContainer
util.rmi.AbstractRmiListener
stella.MessageListener
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.
|
Field Summary |
private JStatusExit |
status
The status panel used for displaying the received messages. |
| 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.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 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 |
status
private JStatusExit status
- The status panel used for displaying the received messages.
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
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.