Package org.astrogrid.samp.gui
Class NotifyActionManager
java.lang.Object
org.astrogrid.samp.gui.SendActionManager
org.astrogrid.samp.gui.NotifyActionManager
SendActionManager subclass which works with messages of a single MType,
using the Notify delivery pattern.
- Since:
- 5 Sep 2008
- Author:
- Mark Taylor
-
Field Summary
Fields inherited from class org.astrogrid.samp.gui.SendActionManager
BROADCAST_TARGET
-
Constructor Summary
ConstructorsConstructorDescriptionNotifyActionManager
(Component parent, GuiHubConnector connector, String mtype, String sendType) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected Action
Returns a new action for broadcast associated with this object.protected abstract Map
Generates the message which is sent to one or all clients by this object's actions.Returns a new menu for targetted sends with a title suitable for this object.protected Action
getSendAction
(Client client) Returns an action which can perform a single-client send associated with this object.protected void
messageSent
(HubConnection connection, Message msg, Client[] recipients) Called when a message has been sent by this object.Methods inherited from class org.astrogrid.samp.gui.SendActionManager
createSendMenu, createTargetAction, createTargetSelector, dispose, disposeSendMenu, getBroadcastAction, getBroadcastIcon, getClientListModel, getConnector, getSendIcon, setEnabled, updateState
-
Constructor Details
-
NotifyActionManager
public NotifyActionManager(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. -
messageSent
Called when a message has been sent by this object. The default action is to notify via the logging system. Subclasses may override this method.- Parameters:
connection
- connection objectmsg
- the message which was sentrecipients
- the recipients to whom an attempt was made to send the message
-
createBroadcastAction
Description copied from class:SendActionManager
Returns a new action for broadcast associated with this object. The enabled status of the action will be managed by this object.- Specified by:
createBroadcastAction
in classSendActionManager
- Returns:
- broadcast action; may be null if broadcast is not required
-
createSendMenu
Returns a new menu for targetted sends with a title suitable for this object.- Returns:
- new send menu
-
getSendAction
Description copied from class:SendActionManager
Returns 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.- Specified by:
getSendAction
in classSendActionManager
- Parameters:
client
- recipient client- Returns:
- action which sends to the given client
-