Package org.astrogrid.samp.gui
Class IndividualCallActionManager
- java.lang.Object
-
- org.astrogrid.samp.gui.SendActionManager
-
- org.astrogrid.samp.gui.AbstractCallActionManager
-
- org.astrogrid.samp.gui.IndividualCallActionManager
-
public abstract class IndividualCallActionManager extends AbstractCallActionManager
SendActionManager which uses the Asynchronous Call/Response delivery pattern, but allows a "broadcast" to send different message objects to different recipients. Multiple targetted sends rather than an actual SAMP broadcast may be used to achieve this. Concrete subclasses need only implement thecreateMessage(org.astrogrid.samp.Client)
method. They may also wish to to customise the returned Send and Broadcast Action objects (for instance give them useful names and descriptions).- Since:
- 3 Dec 2008
- Author:
- Mark Taylor
-
-
Field Summary
-
Fields inherited from class org.astrogrid.samp.gui.SendActionManager
BROADCAST_TARGET
-
-
Constructor Summary
Constructors Constructor Description IndividualCallActionManager(java.awt.Component parent, GuiHubConnector connector, javax.swing.ListModel clientListModel)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description javax.swing.Action
createBroadcastAction()
Must be implemented by concrete subclasses.protected abstract java.util.Map
createMessage(Client client)
Returns the Message object which is to be transmitted by this manager to a given client.-
Methods inherited from class org.astrogrid.samp.gui.AbstractCallActionManager
createResultHandler, createTag, dispose, getSendAction, registerHandler
-
Methods inherited from class org.astrogrid.samp.gui.SendActionManager
createSendMenu, createTargetAction, createTargetSelector, disposeSendMenu, getBroadcastAction, getBroadcastIcon, getClientListModel, getConnector, getSendIcon, setEnabled, updateState
-
-
-
-
Constructor Detail
-
IndividualCallActionManager
public IndividualCallActionManager(java.awt.Component parent, GuiHubConnector connector, javax.swing.ListModel clientListModel)
Constructor.- Parameters:
parent
- parent componentconnector
- hub connectorclientListModel
- list model containing only those clients which are suitable recipients; all elements must beClient
s
-
-
Method Detail
-
createMessage
protected abstract java.util.Map createMessage(Client client) throws java.lang.Exception
Description copied from class:AbstractCallActionManager
Returns the Message object which is to be transmitted by this manager to a given client. This is called by the action returned byAbstractCallActionManager.getSendAction(org.astrogrid.samp.Client)
.- Specified by:
createMessage
in classAbstractCallActionManager
- Parameters:
client
- target- Returns:
- message
- Throws:
java.lang.Exception
-
createBroadcastAction
public javax.swing.Action createBroadcastAction()
Description copied from class:AbstractCallActionManager
Must be implemented by concrete subclasses.- Specified by:
createBroadcastAction
in classAbstractCallActionManager
- Returns:
- broadcast action; may be null if broadcast is not required
-
-