uk.ac.starlink.topcat.interop
Class TopcatPlasticListener

java.lang.Object
  extended by uk.ac.starlink.plastic.HubManager
      extended by uk.ac.starlink.topcat.interop.TopcatPlasticListener
All Implemented Interfaces:
org.votech.plastic.PlasticListener

public class TopcatPlasticListener
extends uk.ac.starlink.plastic.HubManager

Implements the PlasticListener interface on behalf of the TOPCAT application. Will attempt to unregister with the hub on finalization or JVM shutdown.

Since:
8 Feb 2006
Author:
Mark Taylor
See Also:
PLASTIC

Field Summary
 
Fields inherited from interface org.votech.plastic.PlasticListener
CURRENT_VERSION
 
Constructor Summary
TopcatPlasticListener(ControlWindow controlWindow)
          Constructs a new listener which will react appropriately to messages from the hub.
 
Method Summary
 ComboBoxModel createPlasticComboBoxModel(URI messageId)
          Returns a ComboBoxModel which selects applications registered with this hub manager; only those which support a given message are included.
 uk.ac.starlink.plastic.PlasticTransmitter createSubsetTransmitter(TopcatModel tcModel, SubsetWindow subSelector)
          Returns a new PlasticTransmitter which will transmit subsets to one or more listeners.
 uk.ac.starlink.plastic.PlasticTransmitter createTableTransmitter()
          Returns a new PlasticTransmitter which will transmit tables to one or more listeners.
 Object doPerform(URI sender, URI message, List args)
          Does the work for processing a hub message.
 boolean highlightRow(TopcatModel tcModel, long lrow, URI[] recipients)
          Transmits a request for listening applications to highlight a given table row.
 void pointAt(double ra2000, double dec2000, URI[] recipients)
          Broadcasts a request for listening applications to point at a given sky position.
 void transmitSubset(TopcatModel tcModel, RowSubset rset, URI[] recipients)
          Sends a row subset to a specific list of PLASTIC listeners.
 
Methods inherited from class uk.ac.starlink.plastic.HubManager
checkArgs, createURI, finalize, getApplicationListModel, getHub, getHubStartAction, getHubWatchAction, getRegisterAction, getRegisteredId, getRegisterToggle, perform, register, setAutoRegister, unregister
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopcatPlasticListener

public TopcatPlasticListener(ControlWindow controlWindow)
Constructs a new listener which will react appropriately to messages from the hub.

Parameters:
controlWindow - control window into which accepted tables will be loaded etc
Method Detail

doPerform

public Object doPerform(URI sender,
                        URI message,
                        List args)
                 throws IOException
Does the work for processing a hub message.

Specified by:
doPerform in class uk.ac.starlink.plastic.HubManager
Parameters:
sender - sender ID
message - message ID (determines the action required)
args - message argument list
Returns:
return value requested by message
Throws:
IOException

createPlasticComboBoxModel

public ComboBoxModel createPlasticComboBoxModel(URI messageId)
Returns a ComboBoxModel which selects applications registered with this hub manager; only those which support a given message are included. This listener is excluded.

Parameters:
messageId - message which must be supported
Returns:
selection model

createTableTransmitter

public uk.ac.starlink.plastic.PlasticTransmitter createTableTransmitter()
Returns a new PlasticTransmitter which will transmit tables to one or more listeners.

Returns:
new table transmitter

createSubsetTransmitter

public uk.ac.starlink.plastic.PlasticTransmitter createSubsetTransmitter(TopcatModel tcModel,
                                                                         SubsetWindow subSelector)
Returns a new PlasticTransmitter which will transmit subsets to one or more listeners.

Parameters:
subSelector - SubsetWindow which supplies the currently selected subset (SubsetWindow.getSelectedSubset())

transmitSubset

public void transmitSubset(TopcatModel tcModel,
                           RowSubset rset,
                           URI[] recipients)
                    throws IOException
Sends a row subset to a specific list of PLASTIC listeners. It uses the ivo://votech.org/votable/showObjects message.

Parameters:
tcModel - topcat model
rset - row subset within tcModel
recipients - listeners to receive it; null means do a broadcast
Throws:
IOException

highlightRow

public boolean highlightRow(TopcatModel tcModel,
                            long lrow,
                            URI[] recipients)
                     throws IOException
Transmits a request for listening applications to highlight a given table row.

Parameters:
tcModel - topcat model of table to broadcast
lrow - row index within tcModel
recipients - array of plastic IDs for target applications; if null, broadcast will be to all
Returns:
true iff message was broadcast successfully
Throws:
IOException

pointAt

public void pointAt(double ra2000,
                    double dec2000,
                    URI[] recipients)
             throws IOException
Broadcasts a request for listening applications to point at a given sky position.

Parameters:
ra2000 - right ascension J2000.0 in degrees
dec2000 - declination J2000.0 in degrees
recipients - array of plastic IDs for target applications; if null, broadcast will be to all
Throws:
IOException


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