Package uk.ac.starlink.topcat.plot2
Class FormControl
java.lang.Object
uk.ac.starlink.topcat.plot2.FormControl
- All Implemented Interfaces:
Control
- Direct Known Subclasses:
ModeFormControl
,SimpleFormControl
Control for providing coordinate and configuration information
additional to base position coords and config.
Combining the information gathered from this control with
base config and coords provides enough to generate a PlotLayer.
- Since:
- 15 Mar 2013
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addActionListener
(ActionListener listener) Adds a listener to be messaged when the state of this control changes in a way which might affect the plot layer it would create.uk.ac.starlink.ttools.plot2.PlotLayer
createLayer
(uk.ac.starlink.ttools.plot2.DataGeom geom, uk.ac.starlink.ttools.plot2.data.DataSpec dataSpec, RowSubset subset) Creates a plot layer given the current state of this control and some additional information.Returns an object which will forward actions to listeners registered with this panel.protected abstract uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[]
Returns the keys defining the additional configuration required by this control.Returns an icon to represent this control, visible in the stack.Returns a short string to label this control, visible in the stack.protected abstract JComponent
Returns the panel into which the user enters additional coordinate information required for this control, if any.abstract uk.ac.starlink.ttools.plot2.config.ConfigMap
Returns the additional configuration entered by the user in this control.abstract GuiCoordContent[]
Returns the data and metadata for the additional coordinates entered by the user in this control.getPanel()
Returns the GUI component that is the business end of this control.protected abstract uk.ac.starlink.ttools.plot2.Plotter
<?> Returns the Plotter object which generates plot layers from the information provided by this controlReturns the style panel currently in use.void
removeActionListener
(ActionListener listener) Removes a previously added listener.protected abstract void
setTable
(TopcatModel tcModel) Performs implementation-specific configuration of this control for a given TopcatModel.void
setTable
(TopcatModel tcModel, SubsetConfigManager subManager, SubsetStack subStack) Configures this control for use with a given TopcatModel.void
submitReports
(Map<RowSubset, uk.ac.starlink.ttools.plot2.ReportMap> reports) Accepts plot reports generated by plotting layers.
-
Constructor Details
-
FormControl
Constructor.- Parameters:
baseConfigger
- provides global configuration info
-
-
Method Details
-
getCoordPanel
Returns the panel into which the user enters additional coordinate information required for this control, if any.- Returns:
- coordinate entry panel
-
getPlotter
protected abstract uk.ac.starlink.ttools.plot2.Plotter<?> getPlotter()Returns the Plotter object which generates plot layers from the information provided by this control- Returns:
- plotter
-
getConfigKeys
protected abstract uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[] getConfigKeys()Returns the keys defining the additional configuration required by this control.- Returns:
- config keys
-
getPanel
Description copied from interface:Control
Returns the GUI component that is the business end of this control. It will typically contain components for user interaction. -
getExtraCoordContents
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.- Returns:
- extra coordinate information, or null if incomplete
-
getExtraConfig
public abstract uk.ac.starlink.ttools.plot2.config.ConfigMap getExtraConfig()Returns the additional configuration entered by the user in this control.- Returns:
- extra config information
-
setTable
Configures this control for use with a given TopcatModel. The subset manager is supplied as well to provide subset-specific configuration defaults.- Parameters:
tcModel
- topcat modelsubManager
- subset manager with info about the row subsets fortcModel
subStack
- subset stack controlling/displaying subset visibility
-
setTable
Performs implementation-specific configuration of this control for a given TopcatModel.- Parameters:
tcModel
- new topcat model to install
-
getStylePanel
Returns the style panel currently in use.- Returns:
- style panel
-
createLayer
public uk.ac.starlink.ttools.plot2.PlotLayer createLayer(uk.ac.starlink.ttools.plot2.DataGeom geom, uk.ac.starlink.ttools.plot2.data.DataSpec dataSpec, RowSubset subset) Creates a plot layer given the current state of this control and some additional information.- Parameters:
geom
- data position geometrydataSpec
- data specification, which must contain any data required by this control's extra coords and be set up for the given subsetsubset
- row subset in the current table for which the layer is to be plotted- Returns:
- new plot layer, may be null in case of incorrect GUI config
-
getActionForwarder
Returns an object which will forward actions to listeners registered with this panel.- Returns:
- action forwarder
-
addActionListener
Adds a listener to be messaged when the state of this control changes in a way which might affect the plot layer it would create.- Specified by:
addActionListener
in interfaceControl
- Parameters:
listener
- listener to add
-
removeActionListener
Removes a previously added listener.- Specified by:
removeActionListener
in interfaceControl
- Parameters:
listener
- to remove
-
getControlLabel
Description copied from interface:Control
Returns a short string to label this control, visible in the stack.- Specified by:
getControlLabel
in interfaceControl
- Returns:
- label
-
getControlIcon
Description copied from interface:Control
Returns an icon to represent this control, visible in the stack.- Specified by:
getControlIcon
in interfaceControl
- Returns:
- icon
-
submitReports
Accepts plot reports generated by plotting layers. The supplied map is indexed by RowSubset.- Parameters:
reports
- map of row subsets to plot reports
-