org.astrogrid.samp.gui
Class DefaultSendActionManager

java.lang.Object
  extended byorg.astrogrid.samp.gui.SendActionManager
      extended byorg.astrogrid.samp.gui.DefaultSendActionManager

public abstract class DefaultSendActionManager
extends SendActionManager

SendActionManager concrete subclass which works with messages of a single MType.

Since:
5 Sep 2008
Author:
Mark Taylor

Constructor Summary
DefaultSendActionManager(Component parent, HubConnector connector, String mtype, String sendType)
          Constructor.
 
Method Summary
protected  Action createBroadcastAction()
          Returns a new action for broadcast associated with this object.
protected abstract  Map createMessage()
          Generates the message which is sent to one or all clients by this object's actions.
 JMenu createSendMenu()
          Constructs a menu with a sensible name and icon.
protected  Action 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.SendActionManager
createSendMenu, dispose, disposeSendMenu, getBroadcastAction, setEnabled, updateState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultSendActionManager

public DefaultSendActionManager(Component parent,
                                HubConnector connector,
                                String mtype,
                                String sendType)
Constructor.

Parameters:
parent - parent component
connector - hub connector
mtype - MType for messages transmitted by this object's actions
sendType - short string identifying the kind of thing being sent (used for action descriptions etc)
Method Detail

createMessage

protected abstract Map createMessage()
                              throws Exception
Generates the message which is sent to one or all clients by this object's actions.

Returns:
Message-like Map representing message to transmit
Throws:
Exception

createBroadcastAction

protected Action 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 class SendActionManager
Returns:
broadcast action; may be null if broadcast is not required

createSendMenu

public JMenu createSendMenu()
Constructs a menu with a sensible name and icon.

Returns:
new menu

getSendAction

protected Action getSendAction(Client client)
Description copied from class: SendActionManager
Returns an action which can perform a single-client send associated with this object. If it implements equals (and hashCode) intelligently there will be efficiency advantages. The enabled status of such actions will be managed by this object.

Specified by:
getSendAction in class SendActionManager
Parameters:
client - recipient client
Returns:
action which sends to the given client


Copyright © 2008 AstroGrid. All Rights Reserved.