Class MultiSpecifierPanel<T>
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.config.SpecifierPanel<T>
-
- uk.ac.starlink.ttools.plot2.config.MultiSpecifierPanel<T>
-
- All Implemented Interfaces:
Specifier<T>
public class MultiSpecifierPanel<T> extends SpecifierPanel<T>
SpecifierPanel subclass that puts a number of alternative SpecifierPanels alongside each other and lets the user interact with any one of them to perform a selection.- Since:
- 3 Feb 2017
- Author:
- Mark Taylor
-
-
Constructor Summary
Constructors Constructor Description MultiSpecifierPanel(boolean isXFill, T dflt, java.util.List<Specifier<T>> specifiers)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.swing.JComponent
createComponent()
Abstract method called lazily duringgetComponent
to obtain the graphical component used by this specifier.T
getSpecifiedValue()
Returns the typed value currently specified by the graphical component.void
setSpecifiedValue(T value)
Sets the typed value represented by the graphical component.void
submitReport(ReportMap report)
Accepts information about a completed plot that was drawn with input from this specifier.-
Methods inherited from class uk.ac.starlink.ttools.plot2.config.SpecifierPanel
addActionListener, fireAction, getActionForwarder, getChangeForwarder, getComponent, isXFill, removeActionListener
-
-
-
-
Constructor Detail
-
MultiSpecifierPanel
public MultiSpecifierPanel(boolean isXFill, T dflt, java.util.List<Specifier<T>> specifiers)
Constructor.- Parameters:
isXFill
- true if the graphical component should expand to fill the available horizontal spacedflt
- default valuespecifiers
- list of alternative specifier instances
-
-
Method Detail
-
createComponent
protected javax.swing.JComponent createComponent()
Description copied from class:SpecifierPanel
Abstract method called lazily duringgetComponent
to obtain the graphical component used by this specifier. It will be called a maximum of once. It is not necessary that the component actually be created in this method, for instance it may be created at construction time if that's more convenient.- Specified by:
createComponent
in classSpecifierPanel<T>
- Returns:
- graphical component
-
setSpecifiedValue
public void setSpecifiedValue(T value)
Description copied from interface:Specifier
Sets the typed value represented by the graphical component. Calling this method ought to make it clear to the user what value it is set at; in any case a subsequent call ofgetSpecifiedValue
should yield the same result.However if a value is set which is of the correct type but cannot be represented by this specifier, results are unpredictable.
- Parameters:
value
- new value
-
getSpecifiedValue
public T getSpecifiedValue()
Description copied from interface:Specifier
Returns the typed value currently specified by the graphical component.- Returns:
- specified value
-
submitReport
public void submitReport(ReportMap report)
Description copied from interface:Specifier
Accepts information about a completed plot that was drawn with input from this specifier. In many cases, the implementation of this method will be a no-op, but it gives this object a chance to update its state or its component's appearance based on the way the plot was actually drawn, which may provide information not otherwise available to this object.- Parameters:
report
- report of a plot partially specified by this object
-
-