Package uk.ac.starlink.topcat.interop

## Class TopcatSampControl

- java.lang.Object
- - uk.ac.starlink.topcat.interop.TopcatSampControl

-     public class TopcatSampControl
      extends java.lang.Object

  Provides TOPCAT's SAMP functionality.
  Since:
    29 Aug 2008
  Author:
    Mark Taylor

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TopcatSampControl​(org.astrogrid.samp.client.HubConnector hubConnector, ControlWindow controlWindow)` | Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `java.util.Map` | `createRowMessage​(TopcatModel tcModel, long lrow)` | Creates a message suitable for sending a row highlight SAMP message to other clients.
    `java.util.Map` | `createSubsetMessage​(TopcatModel tcModel, RowSubset rset)` | Creates a message suitable for sending a row list selection SAMP message to other clients.
    `ControlWindow` | `getControlWindow()` | Returns the control window which owns this connector.
    `java.lang.String` | `getTableId​(TopcatModel tcModel)` | Returns a public reference ID which may be used to the current state of a given TOPCAT table.

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

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

- - ### Constructor Detail

    - #### TopcatSampControl

          public TopcatSampControl​(org.astrogrid.samp.client.HubConnector hubConnector,
                                   ControlWindow controlWindow)
                            throws java.io.IOException

      Constructor.
      Parameters:
        `controlWindow` - TOPCAT top-level window
      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### getControlWindow

          public ControlWindow getControlWindow()

      Returns the control window which owns this connector.
      Returns:
        control window

    - #### getTableId

          public java.lang.String getTableId​(TopcatModel tcModel)

      Returns a public reference ID which may be used to the current state of a given TOPCAT table. For now, "state" refers to the combination of the table and its row sequence, though other items may become important if SAMP messages arise which require consistency of other attributes.
      Parameters:
        `tcModel` - table to identify
      Returns:
        opaque ID string

    - #### createSubsetMessage

          public java.util.Map createSubsetMessage​(TopcatModel tcModel,
                                                   RowSubset rset)

      Creates a message suitable for sending a row list selection SAMP message to other clients. It is sensibly done here because this class keeps track of which tables have been labelled with which IDs in communications with other SAMP clients.
      Parameters:
        `tcModel` - table
        `rset` - row subset of tcModel to send
      Returns:
        table.select.rowList message

    - #### createRowMessage

          public java.util.Map createRowMessage​(TopcatModel tcModel,
                                                long lrow)

      Creates a message suitable for sending a row highlight SAMP message to other clients.
      Parameters:
        `tcModel` - table
        `lrow` - index of row in tcModel to highlight
      Returns:
        table.highlight.row message, or null if no suitable message can be constructed

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