Package org.astrogrid.samp.gui
Class UniformCallActionManager
java.lang.Object
org.astrogrid.samp.gui.SendActionManager
org.astrogrid.samp.gui.AbstractCallActionManager
org.astrogrid.samp.gui.UniformCallActionManager
SendActionManager subclass which works with messages of a single MType,
using the Aysnchronous Call/Response delivery pattern.
Concrete subclasses need only implement
createMessage().- Since:
- 11 Nov 2008
- Author:
- Mark Taylor
-
Field Summary
Fields inherited from class org.astrogrid.samp.gui.SendActionManager
BROADCAST_TARGET -
Constructor Summary
ConstructorsConstructorDescriptionUniformCallActionManager(Component parent, GuiHubConnector connector, String mtype, String sendType) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected ActionMust be implemented by concrete subclasses.protected abstract MapGenerates the message which is sent to one or all clients by this object's actions.protected MapcreateMessage(Client client) Implemented simply by callingcreateMessage().Returns a new targetted send menu with a title suitable for this object.getSendAction(Client client) Returns an action which can perform a single-client send associated with this object.Methods inherited from class org.astrogrid.samp.gui.AbstractCallActionManager
createResultHandler, createTag, dispose, registerHandlerMethods inherited from class org.astrogrid.samp.gui.SendActionManager
createSendMenu, createTargetAction, createTargetSelector, disposeSendMenu, getBroadcastAction, getBroadcastIcon, getClientListModel, getConnector, getSendIcon, setEnabled, updateState
-
Constructor Details
-
UniformCallActionManager
public UniformCallActionManager(Component parent, GuiHubConnector connector, String mtype, String sendType) Constructor.- Parameters:
parent- parent componentconnector- hub connectormtype- MType for messages transmitted by this object's actionssendType- short string identifying the kind of thing being sent (used for action descriptions etc)
-
-
Method Details
-
createMessage
Generates the message which is sent to one or all clients by this object's actions. -
createMessage
Implemented simply by callingcreateMessage().- Specified by:
createMessagein classAbstractCallActionManager- Parameters:
client- target- Returns:
- message
- Throws:
Exception
-
createBroadcastAction
Description copied from class:AbstractCallActionManagerMust be implemented by concrete subclasses.- Specified by:
createBroadcastActionin classAbstractCallActionManager- Returns:
- broadcast action; may be null if broadcast is not required
-
createSendMenu
Returns a new targetted send menu with a title suitable for this object.- Returns:
- new send menu
-
getSendAction
Description copied from class:SendActionManagerReturns an action which can perform a single-client send associated with this object. If it implementsequals(andhashCode) intelligently there will be efficiency advantages. The enabled status of such actions will be managed by this object.- Overrides:
getSendActionin classAbstractCallActionManager- Parameters:
client- recipient client- Returns:
- action which sends to the given client
-