Package uk.ac.starlink.topcat.interop
Class SendManager
java.lang.Object
uk.ac.starlink.topcat.interop.SendManager
Provides a ComboBoxModel allowing selection of SAMP clients subscribed
to a given MType. An option corresponding to broadcast to all clients
is also provided. This class is useful for implementing
Activity
subclasses using SAMP.- Since:
- 17 Sep 2008
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionSendManager
(org.astrogrid.samp.gui.GuiHubConnector connector, String mtype) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Sends a given message by call/response to the currently selected target client or clients.ListModel<org.astrogrid.samp.Client>
Returns a list model containing all clients that are potential targets for this send manager.Returns a combo box model which allows to select any of the subscribed clients, or broadcast to all.org.astrogrid.samp.Client
Returns the client currently selected for sending.void
Sends a given message by notification to the currently selected target client or clients.
-
Constructor Details
-
SendManager
Constructor.- Parameters:
connector
- hub connectormtype
- MType to which all selectable clients must be subscribed
-
-
Method Details
-
getComboBoxModel
Returns a combo box model which allows to select any of the subscribed clients, or broadcast to all.- Returns:
- combo box model
-
getClientListModel
Returns a list model containing all clients that are potential targets for this send manager. If the list is empty, sending won't do anything. Note the content is not the same as forgetComboBoxModel()
, since this list contains onlyClient
instances, not the Broadcast pseudo-client.- Returns:
- list with only
Client
entries
-
getSelectedClient
public org.astrogrid.samp.Client getSelectedClient()Returns the client currently selected for sending. If null, a broadcast is indicated.- Returns:
- selected destination client, or null for broadcast
-
notify
Sends a given message by notification to the currently selected target client or clients. This message will presumably have the MType supplied to this object in the constructor.- Parameters:
message
-Message
-like map- Throws:
org.astrogrid.samp.client.SampException
-
call
Sends a given message by call/response to the currently selected target client or clients. This message will presumably have the MType supplied to this object in the constructor. The response is logged, but nothing else is done with it.- Parameters:
message
-Message
-like map- Throws:
org.astrogrid.samp.client.SampException
-