Class GuiCoordContent

java.lang.Object
uk.ac.starlink.topcat.plot2.GuiCoordContent

public class GuiCoordContent extends Object
Aggregates user-supplied information about a coordinate value used as input for a plot. The dataLabels and colDatas arrays both correspond to (and have the same array size as) the Inputs arrays for the coord.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    GuiCoordContent(uk.ac.starlink.ttools.plot2.data.Coord coord, String[] dataLabels, uk.ac.starlink.table.ColumnData[] colDatas, uk.ac.starlink.table.DomainMapper[] domainMappers, String[] valueIds)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    uk.ac.starlink.table.ColumnData[]
    Returns the column data objects for user input variables.
    uk.ac.starlink.ttools.plot2.data.Coord
    Returns the coordinate definition.
    static String
    getCoordLabel(String userCoordName, GuiCoordContent[] contents)
    Utility method to interrogate a list of GuiCoordContent objects to get a suitable coordinate label (for instance for use as an axis label) for one of the coordinates in a plot.
    static uk.ac.starlink.ttools.plot2.task.CoordSpec[]
    Utility method to generate a mapping from user coordinate names to their string specifications, given a set of GuiCoordContents.
    Returns the labels describing user input variables.
    uk.ac.starlink.table.DomainMapper[]
    Returns the domain mapper objects corresponding to the user input variables.
    Returns value identifiers for user input variables.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GuiCoordContent

      public GuiCoordContent(uk.ac.starlink.ttools.plot2.data.Coord coord, String[] dataLabels, uk.ac.starlink.table.ColumnData[] colDatas, uk.ac.starlink.table.DomainMapper[] domainMappers, String[] valueIds)
      Constructor.
      Parameters:
      coord - plot coordinate definition
      dataLabels - array of strings naming quantities for the user variables constituting the coord value; these are typically the values typed in by the user
      colDatas - array of column data arrays supplying values for the user variables constituting the coord value
      domainMappers - array of DomainMappers used to decode values from the user variables
      valueIds - array of strings identifying the values returned by the column datas; if these values change, the numeric content of the colDatas can be expected to change
  • Method Details

    • getCoord

      public uk.ac.starlink.ttools.plot2.data.Coord getCoord()
      Returns the coordinate definition.
      Returns:
      coord definition
    • getDataLabels

      public String[] getDataLabels()
      Returns the labels describing user input variables.
      Returns:
      nUserInfo-element array of user variable labels
    • getColDatas

      public uk.ac.starlink.table.ColumnData[] getColDatas()
      Returns the column data objects for user input variables.
      Returns:
      nUserInfo-element array of column data objects
    • getValueIds

      public String[] getValueIds()
      Returns value identifiers for user input variables. If these values change, the numeric values supplied by the column datas may change.
      Returns:
      value identifiers
    • getDomainMappers

      public uk.ac.starlink.table.DomainMapper[] getDomainMappers()
      Returns the domain mapper objects corresponding to the user input variables.
      Returns:
      nUserInfo-element array of domain mappers
    • getCoordSpecs

      public static uk.ac.starlink.ttools.plot2.task.CoordSpec[] getCoordSpecs(GuiCoordContent[] contents)
      Utility method to generate a mapping from user coordinate names to their string specifications, given a set of GuiCoordContents.
      Parameters:
      contents - objects specifying selected coordinate values
      Returns:
      userInfo name->coord specifier map conveying the same information
      See Also:
    • getCoordLabel

      public static String getCoordLabel(String userCoordName, GuiCoordContent[] contents)
      Utility method to interrogate a list of GuiCoordContent objects to get a suitable coordinate label (for instance for use as an axis label) for one of the coordinates in a plot. This is not bulletproof because the user coordinate name is not guaranteed unique, but it will probably work as required.
      Parameters:
      userCoordName - user input coordinate name
      contents - list of GuiCoordContent values associated with a plot; null is permitted, and will give a null result
      Returns:
      string that the user will recognise as applying to userCoordName for plots generated by this control, or null if no result is found
      See Also:
      • Coord.getInputs()