Package uk.ac.starlink.topcat.interop
Class SendManager
- java.lang.Object
-
- uk.ac.starlink.topcat.interop.SendManager
-
public class SendManager extends java.lang.Object
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 implementingActivity
subclasses using SAMP.- Since:
- 17 Sep 2008
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description SendManager(org.astrogrid.samp.gui.GuiHubConnector connector, java.lang.String mtype)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
call(java.util.Map message)
Sends a given message by call/response to the currently selected target client or clients.javax.swing.ListModel
getClientListModel()
Returns a list model containing all clients that are potential targets for this send manager.javax.swing.ComboBoxModel
getComboBoxModel()
Returns a combo box model which allows to select any of the subscribed clients, or broadcast to all.org.astrogrid.samp.Client
getSelectedClient()
Returns the client currently selected for sending.void
notify(java.util.Map message)
Sends a given message by notification to the currently selected target client or clients.
-
-
-
Method Detail
-
getComboBoxModel
public javax.swing.ComboBoxModel getComboBoxModel()
Returns a combo box model which allows to select any of the subscribed clients, or broadcast to all.- Returns:
- combo box model
-
getClientListModel
public javax.swing.ListModel 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
public void notify(java.util.Map message) throws org.astrogrid.samp.client.SampException
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
public void call(java.util.Map message) throws org.astrogrid.samp.client.SampException
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
-
-