Class FormLayerControl
java.lang.Object
uk.ac.starlink.topcat.plot2.TabberControl
uk.ac.starlink.topcat.plot2.FormLayerControl
- All Implemented Interfaces:
Control, LayerControl
- Direct Known Subclasses:
MultiFormLayerControl, SingleFormLayerControl
Plot layer control which manages coordinates and subsets in a common way
for multiple layers defined by one or more forms.
It provides a tab for common coordinates (including table)
and a tab for configuring subset-specific defaults.
Concrete subclasses must provide their form panels.
- Since:
- 8 Jan 2014
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedFormLayerControl(PlotTypeGui<?, ?> plotTypeGui, PositionCoordPanel posCoordPanel, ListModel<TopcatModel> tablesModel, uk.ac.starlink.ttools.plot2.config.Specifier<ZoneId> zsel, boolean autoPopulate, NextSupplier nextSupplier, TopcatListener tcListener, Icon controlIcon) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the controls in the form control list which are contributing to the plot.Returns a short string to label this control, visible in the stack.getCoordLabel(String userCoordName) Returns a text label associated with one of the user coords for this control, typically the name of the column or expression supplying the data.protected abstract FormControl[]Returns a list of all the form controls, active or not, currently managd by this layer control.getLayers(uk.ac.starlink.ttools.plot2.Ganger<?, ?> ganger) Returns the layers contributed by this control.uk.ac.starlink.ttools.plot2.LegendEntry[]Returns legend entries associated with this control.getLegendLabel(RowSubset rset) Returns the label to use in the legend for a given row subset controlled by this control.uk.ac.starlink.ttools.plot2.Plotter<?>[]Returns a list of the plotters that will be used by this control to create layers.Returns the panel in which positional coordinates are entered.Returns this control's per-subset configuration manager.Returns this control's selectable stack of subsets.Returns the selection widget for choosing which table this control is working with.Returns the table for which this control is currently making plots.uk.ac.starlink.ttools.plot2.config.Specifier<ZoneId> Returns a specifier that determines which zone of a multi-zone plot this control's layers will be displayed in.booleanIndicates whether this control will yield any layers in its current state.protected abstract booleanIndicates whether a given form control is contributing the the plot on behalf of this layer control.voidsetTopcatModel(TopcatModel tcModel) Sets in the GUI the topcat model for which this control is making plots.voidsubmitReports(Map<LayerId, uk.ac.starlink.ttools.plot2.ReportMap> reports, uk.ac.starlink.ttools.plot2.Ganger<?, ?> ganger) Accepts report information generated by plotting layers.Methods inherited from class TabberControl
addActionListener, addControlTab, addZoneTab, getActionForwarder, getControlIcon, getPanel, getTabber, removeActionListenerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Control
addActionListener, getControlIcon, getPanel, removeActionListener
-
Constructor Details
-
FormLayerControl
protected FormLayerControl(PlotTypeGui<?, ?> plotTypeGui, PositionCoordPanel posCoordPanel, ListModel<TopcatModel> tablesModel, uk.ac.starlink.ttools.plot2.config.Specifier<ZoneId> zsel, boolean autoPopulate, NextSupplier nextSupplier, TopcatListener tcListener, Icon controlIcon) Constructor.- Parameters:
plotTypeGui- plot typeposCoordPanel- panel for entering table and basic positional coordinatestablesModel- list of available tableszsel- zone id specifier, may be null for single-zone plotsautoPopulate- if true, when the table is changed an attempt will be made to initialise the coordinate fields with some suitable valuesnextSupplier- manages global dispensing for some style optionstcListener- listener for TopcatEvents; this manager will arrange for it to listen to whatever is the currently selected TopcatModelcontrolIcon- icon for control stack
-
-
Method Details
-
getControlLabel
Description copied from interface:ControlReturns a short string to label this control, visible in the stack.- Specified by:
getControlLabelin interfaceControl- Overrides:
getControlLabelin classTabberControl- Returns:
- label
-
getPositionCoordPanel
Returns the panel in which positional coordinates are entered.- Returns:
- positional coordinate panel
-
getSubsetManager
Returns this control's per-subset configuration manager.- Returns:
- subset manager
-
getSubsetStack
Returns this control's selectable stack of subsets.- Returns:
- subset stack
-
getFormControls
Returns a list of all the form controls, active or not, currently managd by this layer control.- Returns:
- list of all form controls
-
isControlActive
Indicates whether a given form control is contributing the the plot on behalf of this layer control.- Parameters:
fc- form control managed by this layer control- Returns:
- true iff fc is active (contributing to plot)
-
getPlotters
public uk.ac.starlink.ttools.plot2.Plotter<?>[] getPlotters()Description copied from interface:LayerControlReturns a list of the plotters that will be used by this control to create layers.- Specified by:
getPlottersin interfaceLayerControl- Returns:
- list of active plotters
-
hasLayers
public boolean hasLayers()Description copied from interface:LayerControlIndicates whether this control will yield any layers in its current state. It returns true ifgetLayerswill return a non-empty array. False positives are best avoided, but permitted.- Specified by:
hasLayersin interfaceLayerControl- Returns:
- true if there is a non-zero number of layers
-
getLayers
Description copied from interface:LayerControlReturns the layers contributed by this control.- Specified by:
getLayersin interfaceLayerControl- Parameters:
ganger- ganger within which layers will be used- Returns:
- layers
-
getLegendEntries
public uk.ac.starlink.ttools.plot2.LegendEntry[] getLegendEntries()Description copied from interface:LayerControlReturns legend entries associated with this control.- Specified by:
getLegendEntriesin interfaceLayerControl- Returns:
- legend entries
-
getLegendLabel
-
getZoneSpecifier
Description copied from interface:LayerControlReturns a specifier that determines which zone of a multi-zone plot this control's layers will be displayed in. If this control is known to be used in a single-zone context, null should be returned.- Specified by:
getZoneSpecifierin interfaceLayerControl- Returns:
- zone id specifier, or null
-
getTableSelector
Description copied from interface:LayerControlReturns the selection widget for choosing which table this control is working with. If this control does not use a table, null is returned. The assumption is (currently) that a given control uses a maximum of one table.- Specified by:
getTableSelectorin interfaceLayerControl- Returns:
- table selector, or null
-
submitReports
public void submitReports(Map<LayerId, uk.ac.starlink.ttools.plot2.ReportMap> reports, uk.ac.starlink.ttools.plot2.Ganger<?, ?> ganger) Description copied from interface:LayerControlAccepts report information generated by plotting layers. The submitted map may contain entries unrelated to this layer. Null map values are permitted, with the same meaning as an empty map.- Specified by:
submitReportsin interfaceLayerControl- Parameters:
reports- per-layer plot reports for layers generated on behalf of this and possibly other controlsganger- ganger within which layers will be used
-
getActiveFormControls
Returns the controls in the form control list which are contributing to the plot. Controls that the user has deactivated (unchecked) are ignored.- Returns:
- list of active form controls
-
getCoordLabel
Description copied from interface:LayerControlReturns a text label associated with one of the user coords for this control, typically the name of the column or expression supplying the data. Null may be returned if there's no good answer.- Specified by:
getCoordLabelin interfaceLayerControl- Parameters:
userCoordName- name of one of the user value infos of an input coord for this control- Returns:
- text label associated with user coordinate
-
setTopcatModel
Sets in the GUI the topcat model for which this control is making plots.- Parameters:
tcModel- new topcat model
-
getTopcatModel
Returns the table for which this control is currently making plots.- Returns:
- topcat model
-