Package uk.ac.starlink.topcat.plot2

# Class ModeFormControl

java.lang.Object
uk.ac.starlink.topcat.plot2.FormControl
uk.ac.starlink.topcat.plot2.ModeFormControl

All Implemented Interfaces:
  `Control`

public class ModeFormControl extends FormControl
FormControl implementation for a collection of ModePlotters.

A Mode selector is presented at the top to determine the actual plotter used. The style config and non-positional coordinate information required is then divided into two parts: those keys which are common to all the modes, and those keys which are specific to the currently selected mode. The common ones share common specifier components so that the values don't change if the mode changes, while the specific ones appear in a mode-specific location (near the mode selector) only for the mode they apply to. From a programmatic point of view, it can be treated just like a normal FormControl.

Since:
  15 Mar 2013
Author:
  Mark Taylor

## Constructor Summary

Constructors
Constructor
Description
`ModeFormControl(Configger baseConfigger, uk.ac.starlink.ttools.plot2.layer.ModePlotter<?>[] plotters, uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[] subsetKeys, uk.ac.starlink.ttools.plot2.data.Coord[] excludeCoords)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[]`
`getConfigKeys()`
Returns the keys defining the additional configuration required by this control.
`String`
`getControlLabel()`
Returns a short string to label this control, visible in the stack.
`JComponent`
`getCoordPanel()`
Returns the panel into which the user enters additional coordinate information required for this control, if any.
`uk.ac.starlink.ttools.plot2.config.ConfigMap`
`getExtraConfig()`
Returns the additional configuration entered by the user in this control.
`GuiCoordContent[]`
`getExtraCoordContents()`
Returns the data and metadata for the additional coordinates entered by the user in this control.
`protected uk.ac.starlink.ttools.plot2.Plotter<?>`
`getPlotter()`
Returns the Plotter object which generates plot layers from the information provided by this control
`void`
`setMode(uk.ac.starlink.ttools.plot2.layer.ModePlotter.Mode mode)`
Sets the current mode for this control.
`protected void`
`setTable(TopcatModel tcModel)`
Performs implementation-specific configuration of this control for a given TopcatModel.

### Methods inherited from class uk.ac.starlink.topcat.plot2.FormControl

`addActionListener, createLayer, getActionForwarder, getControlIcon, getPanel, getStylePanel, removeActionListener, setTable, submitReports`

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

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

## Constructor Details

### ModeFormControl

public ModeFormControl(Configger baseConfigger, uk.ac.starlink.ttools.plot2.layer.ModePlotter<?>[] plotters, uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[] subsetKeys, uk.ac.starlink.ttools.plot2.data.Coord[] excludeCoords)
Constructor.

Parameters:
  `baseConfigger` - provides global configuration info
  `plotters` - family of plotters with different modes but the same form, for which this control gathers configuration
  `subsetKeys` - config keys which are managed on a per-subset basis by some other component
  `excludeCoords` - coordinates that may belong to the plotters but are taken care of elsewhere, and so should not be presented in this control

## Method Details

### getControlLabel

public String getControlLabel()
Description copied from interface: `Control`
Returns a short string to label this control, visible in the stack.

Specified by:
  `getControlLabel` in interface `Control`
Overrides:
  `getControlLabel` in class `FormControl`
Returns:
  label

### getExtraCoordContents

public GuiCoordContent[] getExtraCoordContents()
Description copied from class: `FormControl`
Returns the data and metadata for the additional coordinates entered by the user in this control. If these constitute insufficient information to generate a plot (not all required coords have been filled in), null is returned.

Specified by:
  `getExtraCoordContents` in class `FormControl`
Returns:
  extra coordinate information, or null if incomplete

### getExtraConfig

public uk.ac.starlink.ttools.plot2.config.ConfigMap getExtraConfig()
Description copied from class: `FormControl`
Returns the additional configuration entered by the user in this control.

Specified by:
  `getExtraConfig` in class `FormControl`
Returns:
  extra config information

### setTable

protected void setTable(TopcatModel tcModel)
Description copied from class: `FormControl`
Performs implementation-specific configuration of this control for a given TopcatModel.

Specified by:
  `setTable` in class `FormControl`
Parameters:
  `tcModel` - new topcat model to install

### setMode

public void setMode(uk.ac.starlink.ttools.plot2.layer.ModePlotter.Mode mode)
Sets the current mode for this control.

Parameters:
  `mode` - new mode

### getPlotter

protected uk.ac.starlink.ttools.plot2.Plotter<?> getPlotter()
Description copied from class: `FormControl`
Returns the Plotter object which generates plot layers from the information provided by this control

Specified by:
  `getPlotter` in class `FormControl`
Returns:
  plotter

### getConfigKeys

public uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[] getConfigKeys()
Description copied from class: `FormControl`
Returns the keys defining the additional configuration required by this control.

Specified by:
  `getConfigKeys` in class `FormControl`
Returns:
  config keys

### getCoordPanel

public JComponent getCoordPanel()
Description copied from class: `FormControl`
Returns the panel into which the user enters additional coordinate information required for this control, if any.

Specified by:
  `getCoordPanel` in class `FormControl`
Returns:
  coordinate entry panel