uk.ac.starlink.topcat.activate
Class SampSender

java.lang.Object
  extended by uk.ac.starlink.topcat.activate.SampSender

public class SampSender
extends Object

Takes care of sending SAMP messages from activation methods.

It does a similar job to its predecessor SendManager, which it cannibalises, but unlike that class it provides support for synchronous message sending (call/callAll), with result strings handed back to the calling code rather than just discarded or pushed through the logging system.

Since:
27 Mar 2018
Author:
Mark Taylor

Constructor Summary
SampSender(String mtype)
          Constructor.
 
Method Summary
 Outcome activateMessage(Map message)
          Invoked to perform an activation action which involves sending a SAMP message to this sender's currently selected target client(s).
 ListModel getClientListModel()
          Returns a list of the clients that are current possible targets for this sender's messages (subscribed to the relevant MType).
 ComboBoxModel getClientSelectionModel()
          Returns a ComboBoxModel listing clients that are subscribed to this sender's MType.
 org.astrogrid.samp.gui.GuiHubConnector getConnector()
          Returns this sender's hub connector.
 TopcatSampControl getSampControl()
          Returns this sender's Samp control.
 String getUnavailableText()
          Returns a message explaining why this sender can't do any useful work at the moment.
 boolean isAvailable()
          Indicates whether this sender has a chance of working.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SampSender

public SampSender(String mtype)
Constructor. The supplied MType determines what the offered list of recipient clients will contain.

Parameters:
mtype - message type to which this sender is sensitive
Method Detail

isAvailable

public boolean isAvailable()
Indicates whether this sender has a chance of working.

Returns:
false if this will never work

getClientListModel

public ListModel getClientListModel()
Returns a list of the clients that are current possible targets for this sender's messages (subscribed to the relevant MType). If this list is empty, then the sender can't currently do any useful work.

Returns:
listmodel containing appropriately-subscribed clients

getClientSelectionModel

public ComboBoxModel getClientSelectionModel()
Returns a ComboBoxModel listing clients that are subscribed to this sender's MType.

Returns:
client selection list

getSampControl

public TopcatSampControl getSampControl()
Returns this sender's Samp control.

Returns:
samp control object

getConnector

public org.astrogrid.samp.gui.GuiHubConnector getConnector()
Returns this sender's hub connector.

Returns:
connector object

activateMessage

public Outcome activateMessage(Map message)
Invoked to perform an activation action which involves sending a SAMP message to this sender's currently selected target client(s).

Parameters:
message - message to send
Returns:
outcome

getUnavailableText

public String getUnavailableText()
Returns a message explaining why this sender can't do any useful work at the moment. If it can, null is returned.

Returns:
unavailablity message, or null if all is working


Copyright © 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.