Package uk.ac.starlink.topcat.plot2
Class LayerControlAction
java.lang.Object
javax.swing.AbstractAction
uk.ac.starlink.topcat.BasicAction
uk.ac.starlink.topcat.plot2.LayerControlAction
- All Implemented Interfaces:
ActionListener
,Serializable
,Cloneable
,EventListener
,Action
Action for adding a layer control to the plot stack.
- Since:
- 25 Jul 2013
- Author:
- Mark Taylor
- See Also:
-
Field Summary
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
-
Constructor Summary
ConstructorsConstructorDescriptionLayerControlAction
(String name, Icon layerIcon, String descrip, uk.ac.starlink.ttools.plot2.Plotter<?> plotter, ControlStack stack) Constructs a LayerControlAction from name, icon and description.LayerControlAction
(uk.ac.starlink.ttools.plot2.Plotter<?> plotter, ControlStack stack) Constructs a LayerControlAction from a Plotter. -
Method Summary
Modifier and TypeMethodDescriptionvoid
abstract LayerControl
Creates a layer control for this action's plotter.static LayerControlAction
createPlotterAction
(PlotTypeGui<?, ?> plotTypeGui, uk.ac.starlink.ttools.plot2.Plotter<?> plotter, ControlStack stack, ListModel<TopcatModel> tablesModel, ZoneFactory zfact, NextSupplier nextSupplier, TopcatListener tcListener, MultiConfigger baseConfigger) Attempts to return an instance of this class corresponding to a given plotter.uk.ac.starlink.ttools.plot2.Plotter
<?> Returns the single plotter associated with this action, if any.grabTable
(TopcatModel tcModel) Allows this action to provide a layer control for a particular table if it is specially suited for it.Methods inherited from class uk.ac.starlink.topcat.BasicAction
create, getEventWindow
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
Constructor Details
-
LayerControlAction
public LayerControlAction(String name, Icon layerIcon, String descrip, uk.ac.starlink.ttools.plot2.Plotter<?> plotter, ControlStack stack) Constructs a LayerControlAction from name, icon and description.- Parameters:
name
- action namelayerIcon
- icon representing the type of layer the action will add; it may get doctored to generate the icon for this actiondescrip
- action descriptionplotter
- single plotter associated with this layer control, may be nullstack
- plot stack
-
LayerControlAction
Constructs a LayerControlAction from a Plotter.- Parameters:
plotter
- plotter which will be added to the stackstack
- plot stack
-
-
Method Details
-
createLayerControl
Creates a layer control for this action's plotter.- Returns:
- new layer control
-
grabTable
Allows this action to provide a layer control for a particular table if it is specially suited for it. Under normal circumstances, this method should return null, which is what the default implementation does. However, if this control considers that it's likely to be more suitable than all other controls for plotting the given table, it should return a LayerControl instance configured to plot that table.- Parameters:
tcModel
- table that could be plotted- Returns:
- null, or a control configured to plot the table
-
actionPerformed
-
getPlotter
public uk.ac.starlink.ttools.plot2.Plotter<?> getPlotter()Returns the single plotter associated with this action, if any. For instances with no single plotter, null is returned.- Returns:
- plotter for this action, or null
-
createPlotterAction
public static LayerControlAction createPlotterAction(PlotTypeGui<?, ?> plotTypeGui, uk.ac.starlink.ttools.plot2.Plotter<?> plotter, ControlStack stack, ListModel<TopcatModel> tablesModel, ZoneFactory zfact, NextSupplier nextSupplier, TopcatListener tcListener, MultiConfigger baseConfigger) Attempts to return an instance of this class corresponding to a given plotter. If no suitable implementation is available, null is returned.- Parameters:
plotTypeGui
- plot typeplotter
- plotter to provide an action forstack
- stack to which controls are to be addedtablesModel
- list of available tableszfact
- zone id factorynextSupplier
- manages global dispensing for some style optionstcListener
- listener for TopcatEventsbaseConfigger
- configuration source for some global config options- Returns:
- new action to add plotter control to stack, or null
-