uk.ac.starlink.topcat.plot2
Class GuiCoordContent

java.lang.Object
  extended by 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:
CoordPanel

Constructor Summary
GuiCoordContent(uk.ac.starlink.ttools.plot2.data.Coord coord, String[] dataLabels, uk.ac.starlink.table.ColumnData[] colDatas)
          Constructor.
 
Method Summary
 uk.ac.starlink.table.ColumnData[] getColDatas()
          Returns the column data objects for user input variables.
 uk.ac.starlink.ttools.plot2.data.Coord getCoord()
          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.
 String[] getDataLabels()
          Returns the labels describing user input variables.
static Map<String,String> getInputValues(GuiCoordContent[] contents)
          Utility method to generate a mapping from user coordinate names to their string specifications, given a set of GuiCoordContents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GuiCoordContent

public GuiCoordContent(uk.ac.starlink.ttools.plot2.data.Coord coord,
                       String[] dataLabels,
                       uk.ac.starlink.table.ColumnData[] colDatas)
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
Method Detail

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

getInputValues

public static Map<String,String> getInputValues(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:
LayerCommand.getInputValues()

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()


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