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)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[]
getConfigKeys()
Returns the keys defining the additional configuration required by this control.java.lang.String
getControlLabel()
Returns a short string to label this control, visible in the stack.javax.swing.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 controlvoid
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
-
-
-
-
Constructor Detail
-
ModeFormControl
public ModeFormControl(Configger baseConfigger, uk.ac.starlink.ttools.plot2.layer.ModePlotter<?>[] plotters, uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[] subsetKeys)
Constructor.- Parameters:
baseConfigger
- provides global configuration infoplotters
- family of plotters with different modes but the same form, for which this control gathers configurationsubsetKeys
- config keys which are managed on a per-subset basis by some other component
-
-
Method Detail
-
getControlLabel
public java.lang.String getControlLabel()
Description copied from interface:Control
Returns a short string to label this control, visible in the stack.- Specified by:
getControlLabel
in interfaceControl
- Overrides:
getControlLabel
in classFormControl
- 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 classFormControl
- 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 classFormControl
- 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 classFormControl
- 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 classFormControl
- 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 classFormControl
- Returns:
- config keys
-
getCoordPanel
public javax.swing.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 classFormControl
- Returns:
- coordinate entry panel
-
-