Package uk.ac.starlink.topcat.interop
Class SampCommunicator
java.lang.Object
uk.ac.starlink.topcat.interop.SampCommunicator
- All Implemented Interfaces:
TopcatCommunicator
TopcatCommunicator implementation based on SAMP.
- Since:
- 4 Sep 2008
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConnectionListener(ChangeListener listener) Adds a listener which will be notified any time that connection status may have changed.Returns an object which can be used to display images.createImageTransmitter(DensityWindow densWin) Returns an object that can send the density map currently displayed in the density plot window to other applications as a FITS image.Optionally returns a panel which can be displayed in the control window to show communications status.createResourceListTransmitter(uk.ac.starlink.vo.RegistryPanel regPanel, String resourceType) Returns an object that can send the currently displayed resources from a registry panel.Returns an object which can be used to send messages highlighting single table rows.Returns an object which can be used to send messages drawing attention to particular sky positions.Returns an object which can be used to display spectra.Returns an object which can be used to send messages selecting table row subsets.createSubsetTransmitter(TopcatModel tcModel, SubsetWindow subWin) Returns an object that can send the RowSubset currently selected in a given subset window to other applications as a row selection on a commonly-known table.createWindowAction(Component parent) Constructs an action which will display a control window for this communicator.org.astrogrid.samp.gui.GuiHubConnectorReturns the SAMP HubConnector used by this object.Action[]Returns a list of actions suitable for insertion in a general purpose menu associated with interoperability functionality (register/unregister etc).Returns the name of the protocol over which this object is implemented.Returns the TopcatSampControl object used by this object.Returns an object that can send send the currently selected table from TOPCAT to other applications.booleanIndicates (without attempting a connection) whether a hub connection is currently in force.voidAccording to the policy of this communicator, this method may start a hub if none is already running.sanitizeMap(Map<?, ?> map) Makes sure that a map is SAMP-friendly.booleanMust be called before any of the actions provided by this object are used.voidstartHub(boolean external) Attempts to start a messaging hub suitable for use with this object.
-
Constructor Details
-
SampCommunicator
Constructor.- Parameters:
controlWindow- TOPCAT control window- Throws:
IOException
-
-
Method Details
-
getProtocolName
Description copied from interface:TopcatCommunicatorReturns the name of the protocol over which this object is implemented.- Specified by:
getProtocolNamein interfaceTopcatCommunicator- Returns:
- protocol name
-
setActive
public boolean setActive()Description copied from interface:TopcatCommunicatorMust be called before any of the actions provided by this object are used. May initiate communication with the messaging system etc.- Specified by:
setActivein interfaceTopcatCommunicator- Returns:
- true iff there is a current connection
-
getTableTransmitter
Description copied from interface:TopcatCommunicatorReturns an object that can send send the currently selected table from TOPCAT to other applications.- Specified by:
getTableTransmitterin interfaceTopcatCommunicator- Returns:
- table transmitter
-
createImageTransmitter
Description copied from interface:TopcatCommunicatorReturns an object that can send the density map currently displayed in the density plot window to other applications as a FITS image.- Specified by:
createImageTransmitterin interfaceTopcatCommunicator- Parameters:
densWin- density plot window- Returns:
- new image transmitter
-
createSubsetTransmitter
Description copied from interface:TopcatCommunicatorReturns an object that can send the RowSubset currently selected in a given subset window to other applications as a row selection on a commonly-known table.- Specified by:
createSubsetTransmitterin interfaceTopcatCommunicator- Parameters:
tcModel- tablesubWin- subset window- Returns:
- new subset transmitter
-
createResourceListTransmitter
public Transmitter createResourceListTransmitter(uk.ac.starlink.vo.RegistryPanel regPanel, String resourceType) Description copied from interface:TopcatCommunicatorReturns an object that can send the currently displayed resources from a registry panel.- Specified by:
createResourceListTransmitterin interfaceTopcatCommunicator- Parameters:
regPanel- registry panel componentresourceType- resource subtype - must match the appropriate voresource.loadlist.* MType subtype- Returns:
- new resource list transmitter
-
createSkyPointActivity
Description copied from interface:TopcatCommunicatorReturns an object which can be used to send messages drawing attention to particular sky positions.- Specified by:
createSkyPointActivityin interfaceTopcatCommunicator- Returns:
- new activity object
-
createRowActivity
Description copied from interface:TopcatCommunicatorReturns an object which can be used to send messages highlighting single table rows.- Specified by:
createRowActivityin interfaceTopcatCommunicator- Returns:
- new activity object
-
createSubsetActivity
Description copied from interface:TopcatCommunicatorReturns an object which can be used to send messages selecting table row subsets.- Specified by:
createSubsetActivityin interfaceTopcatCommunicator- Returns:
- new activity object
-
createSpectrumActivity
Description copied from interface:TopcatCommunicatorReturns an object which can be used to display spectra.- Specified by:
createSpectrumActivityin interfaceTopcatCommunicator- Returns:
- new activity object
-
createImageActivity
Description copied from interface:TopcatCommunicatorReturns an object which can be used to display images. Note this may include options apart from interop-type ones (display in local viewers).- Specified by:
createImageActivityin interfaceTopcatCommunicator- Returns:
- new activity object
-
getInteropActions
Description copied from interface:TopcatCommunicatorReturns a list of actions suitable for insertion in a general purpose menu associated with interoperability functionality (register/unregister etc).- Specified by:
getInteropActionsin interfaceTopcatCommunicator- Returns:
- action list
-
startHub
Description copied from interface:TopcatCommunicatorAttempts to start a messaging hub suitable for use with this object.- Specified by:
startHubin interfaceTopcatCommunicator- Parameters:
external- true to run hub in external JVM, false to run it in the current one- Throws:
IOException
-
maybeStartHub
Description copied from interface:TopcatCommunicatorAccording to the policy of this communicator, this method may start a hub if none is already running.- Specified by:
maybeStartHubin interfaceTopcatCommunicator- Throws:
IOException
-
createWindowAction
Description copied from interface:TopcatCommunicatorConstructs an action which will display a control window for this communicator.- Specified by:
createWindowActionin interfaceTopcatCommunicator- Parameters:
parent- parent component- Returns:
- communicator control window, or null if none is available
-
isConnected
public boolean isConnected()Description copied from interface:TopcatCommunicatorIndicates (without attempting a connection) whether a hub connection is currently in force.- Specified by:
isConnectedin interfaceTopcatCommunicator- Returns:
- whether hub is connected
-
addConnectionListener
Description copied from interface:TopcatCommunicatorAdds a listener which will be notified any time that connection status may have changed.- Specified by:
addConnectionListenerin interfaceTopcatCommunicator- Parameters:
listener- listener to add
-
getConnector
public org.astrogrid.samp.gui.GuiHubConnector getConnector()Returns the SAMP HubConnector used by this object.- Returns:
- connector
-
getSampControl
Returns the TopcatSampControl object used by this object.- Returns:
- samp control
-
createInfoPanel
Description copied from interface:TopcatCommunicatorOptionally returns a panel which can be displayed in the control window to show communications status.- Specified by:
createInfoPanelin interfaceTopcatCommunicator- Returns:
- status component, or null if unimplemented
-
sanitizeMap
Makes sure that a map is SAMP-friendly. Any entries which are not are simply discarded.
-