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 the `createMessage(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(Component parent, GuiHubConnector connector, ListModel clientListModel)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Action`
`createBroadcastAction()`
Must be implemented by concrete subclasses.
`protected abstract 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`

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

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

## Constructor Details

### IndividualCallActionManager

public IndividualCallActionManager(Component parent, GuiHubConnector connector, ListModel clientListModel)
Constructor.

Parameters:
  `parent` - parent component
  `connector` - hub connector
  `clientListModel` - list model containing only those clients which are suitable recipients; all elements must be `Client`s

## Method Details

### createMessage

protected abstract Map createMessage(Client client) throws 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 by `AbstractCallActionManager.getSendAction(org.astrogrid.samp.Client)`.

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

### createBroadcastAction

public 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