Package uk.ac.starlink.topcat.plot2
Class SubsetConfigManager
java.lang.Object
uk.ac.starlink.topcat.plot2.SubsetConfigManager
Maintains one configuration component each for a group of RowSubsets.
The configuration items are split into two types; normal ones and
ones that are centrally managed so that each time a new one is requested
it has a different default. A typical usage is to allow a different
default colour to be associated with each subset.
- Since:
- 15 Mar 2013
- Author:
- Mark Taylor
-
Constructor Summary
ConstructorsConstructorDescriptionSubsetConfigManager(NextSupplier nextSupplier, uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[] otherKeys) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionListener(ActionListener listener) Adds a listener to be notified whenever the state of one of this manager's configuration components changes.getConfigger(RowSubset.Key rsKey) Lazily constructs and returns a SubsetConfigger for a given subset.Returns the GUI configuration component for a given row subset.uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[]Returns the config keys managed by this manager.booleanhasConfigger(RowSubset.Key rsKey) Indicates whether this manager currently has an initialised configuration object for the given subset.voidremoveActionListener(ActionListener listener) Removes a previously added listener.voidsetConfig(RowSubset.Key rsKey, uk.ac.starlink.ttools.plot2.config.ConfigMap config) Adjusts the configuration for a given row subset managed by this object.
-
Constructor Details
-
SubsetConfigManager
public SubsetConfigManager(NextSupplier nextSupplier, uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[] otherKeys) Constructor.- Parameters:
nextSupplier- manages dispensing different objects of the same typeotherKeys- keys for config items not handled by the nextSupplier that should be handled by this managers configgers
-
-
Method Details
-
getConfigKeys
public uk.ac.starlink.ttools.plot2.config.ConfigKey<?>[] getConfigKeys()Returns the config keys managed by this manager. -
hasConfigger
Indicates whether this manager currently has an initialised configuration object for the given subset. If not, then callinggetConfiggerwould construct and initialise such an object.- Parameters:
rsKey- row subset identifier- Returns:
- true iff getConfigger would do actual work
-
getConfigger
Lazily constructs and returns a SubsetConfigger for a given subset.- Parameters:
rsKey- identifier of subset for which the configger is required- Returns:
- configger
-
setConfig
Adjusts the configuration for a given row subset managed by this object.- Parameters:
rsKey- identifier of subset whose configuration characteristcics are to be changedconfig- configuration options to be set; any irrelevant entries are ignored
-
getConfiggerComponent
Returns the GUI configuration component for a given row subset.- Parameters:
rsKey- row subset identifier- Returns:
- configuration component
-
addActionListener
Adds a listener to be notified whenever the state of one of this manager's configuration components changes.- Parameters:
listener- listener to add
-
removeActionListener
Removes a previously added listener.- Parameters:
listener- to remove
-