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

public abstract class UniformCallActionManager extends AbstractCallActionManager
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

Constructors
Constructor
Description
`UniformCallActionManager(Component parent, GuiHubConnector connector, String mtype, String sendType)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected Action`
`createBroadcastAction()`
Must be implemented by concrete subclasses.
`protected abstract Map`
`createMessage()`
Generates the message which is sent to one or all clients by this object's actions.
`protected Map`
`createMessage(Client client)`
Implemented simply by calling `createMessage()`.
`JMenu`
`createSendMenu()`
Returns a new targetted send menu with a title suitable for this object.
`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.AbstractCallActionManager

`createResultHandler, createTag, dispose, registerHandler`

### Methods inherited from class org.astrogrid.samp.gui.SendActionManager

`createSendMenu, createTargetAction, createTargetSelector, disposeSendMenu, getBroadcastAction, getBroadcastIcon, getClientListModel, getConnector, getSendIcon, setEnabled, updateState`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### UniformCallActionManager

public UniformCallActionManager(Component parent, GuiHubConnector 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 Details

### 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`

### createMessage

protected Map createMessage(Client client) throws Exception
Implemented simply by calling `createMessage()`.

Specified by:
  `createMessage` in class `AbstractCallActionManager`
Parameters:
  `client` - target
Returns:
  message
Throws:
  `Exception`

### createBroadcastAction

protected Action createBroadcastAction()
Description copied from class: `AbstractCallActionManager`
Must be implemented by concrete subclasses.

Specified by:
  `createBroadcastAction` in class `AbstractCallActionManager`
Returns:
  broadcast action; may be null if broadcast is not required

### createSendMenu

public JMenu createSendMenu()
Returns a new targetted send menu with a title suitable for this object.

Returns:
  new send menu

### getSendAction

public 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.

Overrides:
  `getSendAction` in class `AbstractCallActionManager`
Parameters:
  `client` - recipient client
Returns:
  action which sends to the given client