public abstract class PlasticTransmitter extends Object
Constructor and Description |
---|
PlasticTransmitter(HubManager hubman,
URI messageId,
String sendType)
Constructs a new transmitter.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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 etcprotected 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()
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.