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
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.StringgetControlLabel()Returns a short string to label this control, visible in the stack.javax.swing.JComponentgetCoordPanel()Returns the panel into which the user enters additional coordinate information required for this control, if any.uk.ac.starlink.ttools.plot2.config.ConfigMapgetExtraConfig()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 controlvoidsetMode(uk.ac.starlink.ttools.plot2.layer.ModePlotter.Mode mode)Sets the current mode for this control.protected voidsetTable(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, uk.ac.starlink.ttools.plot2.data.Coord[] excludeCoords)
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 componentexcludeCoords- coordinates that may belong to the plotters but are taken care of elsewhere, and so should not be presented in this control
-
-
Method Detail
-
getControlLabel
public java.lang.String getControlLabel()
Description copied from interface:ControlReturns a short string to label this control, visible in the stack.- Specified by:
getControlLabelin interfaceControl- Overrides:
getControlLabelin classFormControl- Returns:
- label
-
getExtraCoordContents
public GuiCoordContent[] getExtraCoordContents()
Description copied from class:FormControlReturns 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:
getExtraCoordContentsin classFormControl- Returns:
- extra coordinate information, or null if incomplete
-
getExtraConfig
public uk.ac.starlink.ttools.plot2.config.ConfigMap getExtraConfig()
Description copied from class:FormControlReturns the additional configuration entered by the user in this control.- Specified by:
getExtraConfigin classFormControl- Returns:
- extra config information
-
setTable
protected void setTable(TopcatModel tcModel)
Description copied from class:FormControlPerforms implementation-specific configuration of this control for a given TopcatModel.- Specified by:
setTablein 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:FormControlReturns the Plotter object which generates plot layers from the information provided by this control- Specified by:
getPlotterin classFormControl- Returns:
- plotter
-
getConfigKeys
public uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[] getConfigKeys()
Description copied from class:FormControlReturns the keys defining the additional configuration required by this control.- Specified by:
getConfigKeysin classFormControl- Returns:
- config keys
-
getCoordPanel
public javax.swing.JComponent getCoordPanel()
Description copied from class:FormControlReturns the panel into which the user enters additional coordinate information required for this control, if any.- Specified by:
getCoordPanelin classFormControl- Returns:
- coordinate entry panel
-
-