Package uk.ac.starlink.topcat.activate
Interface ActivatorConfigurator
- All Known Implementing Classes:
AbstractActivatorConfigurator
,ChoiceConfigurator
,Hips2fitsConfigurator
,SkyPosConfigurator
,UrlColumnConfigurator
public interface ActivatorConfigurator
Defines a GUI component that the user can interact with to specify
an activation action. This is a GUI factory for Activator instances.
- Since:
- 23 Jan 2018
- Author:
- Mark Taylor
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addActionListener
(ActionListener listener) Adds a listener that will be informed when the GUI state changes in such a way that the result ofgetActivator
orgetConfigMessage
may change.Constructs an activator in accordance with the current state of this GUI.Returns a short status message for display to the user.getPanel()
Returns the GUI component with which the user can interact.Indicates whether an activator created by the current state of this configurator is known to be harmless.getState()
Returns an object that contains the current state of this configurator.void
removeActionListener
(ActionListener listener) Removes a previously added listener.void
setState
(ConfigState state) Restores the state of this object from a given state object.
-
Method Details
-
getPanel
JComponent getPanel()Returns the GUI component with which the user can interact.- Returns:
- configuration panel
-
getActivator
Activator getActivator()Constructs an activator in accordance with the current state of this GUI. If the current state not an adequate specification, null may be returned. In that case, the getConfigMessage method should generally provide an explanation.This method may be called often, so should be cheap to invoke. The idea is that it will be called immediately before the activator is used, so the returned object may fix, rather than arrange to gather at a later date, information acquired from the GUI.
- Returns:
- currently configured activator, or null
- See Also:
-
getConfigMessage
String getConfigMessage()Returns a short status message for display to the user. This is supposed to be a comment, if one is needed, on the current state of the configuration.As a rule, exactly one of this method and the
getActivator
should return null. If there is no activator, this method should return some reason why the configuration is incorrect or incomplete, and otherwise it should return null.- Returns:
- message, typically indicating configuration problems, or null
-
addActionListener
Adds a listener that will be informed when the GUI state changes in such a way that the result ofgetActivator
orgetConfigMessage
may change.- Parameters:
listener
- listener to add
-
removeActionListener
Removes a previously added listener.- Parameters:
listener
- listener to remove
-
getState
ConfigState getState()Returns an object that contains the current state of this configurator. This includes options selected by the user, but does not include any description of the table on which this configurator is working.- Returns:
- configuration state
-
setState
Restores the state of this object from a given state object.- Parameters:
state
- stored state
-
getSafety
Safety getSafety()Indicates whether an activator created by the current state of this configurator is known to be harmless.Implementations should be cautious; if some slightly adjusted state might be dangerous, false could be returned as well (that's why this method is on ActivatorConfigurator and not Activator itself).
- Returns:
- safety status of the currently configured state
-