|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.plastic.PlasticTransmitter
Provides actions for transmitting messages of a particular kind using PLASTIC. The purpose of this class is to provide actions and menus which allow the user to send a message to either one or multiple appropriate listeners. These actions/menus are kept up to date with respect to the current set of registered listener applications. Only applications which claim to support a particular message are considerered. If there are no such applications the send actions are disabled.
Constructor Summary | |
PlasticTransmitter(HubManager hubman,
URI messageId,
String sendType)
Constructs a new transmitter. |
Method Summary | |
JMenu |
createSendMenu()
Returns a new menu which provides options to send a message to one of the registered listeners at a time. |
Action |
getBroadcastAction()
Returns an action which will broadcast a message to all suitable registered applications. |
void |
setEnabled(boolean enabled)
Sets the enabled status of this transmitter. |
protected abstract void |
transmit(PlasticHubListener hub,
URI clientId,
ApplicationItem app)
This performs the actual work of transmission to one or all registered applications. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PlasticTransmitter(HubManager hubman, URI messageId, String sendType)
hubman
- hub manager which keeps track of registered appsmessageId
- the message ID this transmitter will transmit;
only registered applications which claim to suppor this
message are consideredsendType
- short string representing the type of object which
is transmitted; this is used only for setting up text names
for actions etcMethod Detail |
protected abstract void transmit(PlasticHubListener hub, URI clientId, ApplicationItem app) throws IOException
hub
- hub objectclientId
- identifier under which this application is
registered with hub
app
- application to which the transmit should be done.
If null, broadcast to all suitable listeners.
IOException
public void setEnabled(boolean enabled)
enabled
- false to ensure that the actions are disabled,
true means they may be enabledpublic Action getBroadcastAction()
This action is currently not disabled when there are no suitable listeners, mainly for debugging purposes (so you can see if a message is getting sent and what it looks like even in absence of suitable listeners).
public JMenu createSendMenu()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |