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
public abstract class FormControl extends java.lang.Object implements Control
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 Modifier Constructor Description protectedFormControl(Configger baseConfigger)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddActionListener(java.awt.event.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.PlotLayercreateLayer(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.java.awt.event.ActionListenergetActionForwarder()Returns an object which will forward actions to listeners registered with this panel.protected abstract uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[]getConfigKeys()Returns the keys defining the additional configuration required by this control.javax.swing.IcongetControlIcon()Returns an icon to represent this control, visible in the stack.java.lang.StringgetControlLabel()Returns a short string to label this control, visible in the stack.protected abstract javax.swing.JComponentgetCoordPanel()Returns the panel into which the user enters additional coordinate information required for this control, if any.abstract uk.ac.starlink.ttools.plot2.config.ConfigMapgetExtraConfig()Returns the additional configuration entered by the user in this control.abstract GuiCoordContent[]getExtraCoordContents()Returns the data and metadata for the additional coordinates entered by the user in this control.javax.swing.JComponentgetPanel()Returns the GUI component that is the business end of this control.protected abstract uk.ac.starlink.ttools.plot2.Plotter<?>getPlotter()Returns the Plotter object which generates plot layers from the information provided by this controlFormStylePanelgetStylePanel()Returns the style panel currently in use.voidremoveActionListener(java.awt.event.ActionListener listener)Removes a previously added listener.protected abstract voidsetTable(TopcatModel tcModel)Performs implementation-specific configuration of this control for a given TopcatModel.voidsetTable(TopcatModel tcModel, SubsetConfigManager subManager, SubsetStack subStack)Configures this control for use with a given TopcatModel.voidsubmitReports(java.util.Map<RowSubset,uk.ac.starlink.ttools.plot2.ReportMap> reports)Accepts plot reports generated by plotting layers.
-
-
-
Constructor Detail
-
FormControl
protected FormControl(Configger baseConfigger)
Constructor.- Parameters:
baseConfigger- provides global configuration info
-
-
Method Detail
-
getCoordPanel
protected abstract javax.swing.JComponent 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
public javax.swing.JComponent getPanel()
Description copied from interface:ControlReturns the GUI component that is the business end of this control. It will typically contain components for user interaction.
-
getExtraCoordContents
public abstract GuiCoordContent[] 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
public void setTable(TopcatModel tcModel, SubsetConfigManager subManager, SubsetStack subStack)
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 fortcModelsubStack- subset stack controlling/displaying subset visibility
-
setTable
protected abstract void setTable(TopcatModel tcModel)
Performs implementation-specific configuration of this control for a given TopcatModel.- Parameters:
tcModel- new topcat model to install
-
getStylePanel
public FormStylePanel 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
public java.awt.event.ActionListener getActionForwarder()
Returns an object which will forward actions to listeners registered with this panel.- Returns:
- action forwarder
-
addActionListener
public void addActionListener(java.awt.event.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.- Specified by:
addActionListenerin interfaceControl- Parameters:
listener- listener to add
-
removeActionListener
public void removeActionListener(java.awt.event.ActionListener listener)
Removes a previously added listener.- Specified by:
removeActionListenerin interfaceControl- Parameters:
listener- to remove
-
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- Returns:
- label
-
getControlIcon
public javax.swing.Icon getControlIcon()
Description copied from interface:ControlReturns an icon to represent this control, visible in the stack.- Specified by:
getControlIconin interfaceControl- Returns:
- icon
-
submitReports
public void submitReports(java.util.Map<RowSubset,uk.ac.starlink.ttools.plot2.ReportMap> reports)
Accepts plot reports generated by plotting layers. The supplied map is indexed by RowSubset.- Parameters:
reports- map of row subsets to plot reports
-
-