public class ComboBoxSpecifier<V> extends SpecifierPanel<V>
Constructor and Description |
---|
ComboBoxSpecifier(java.util.Collection<V> options)
Constructs a specifier selecting from a given collection of options.
|
ComboBoxSpecifier(javax.swing.JComboBox comboBox)
Constructs a specifier with a given combo box and default options.
|
ComboBoxSpecifier(javax.swing.JComboBox comboBox,
boolean customStringify,
boolean allowAny)
Constructs a specifier with a given combo box, and optional custom
labelling and setting restrictions.
|
ComboBoxSpecifier(V[] options)
Constructs a specifier selecting from a given array of options.
|
Modifier and Type | Method and Description |
---|---|
protected javax.swing.JComponent |
createComponent()
Abstract method called lazily during
getComponent
to obtain the graphical component used by this specifier. |
javax.swing.JComboBox |
getComboBox()
Returns this specifier's combo box.
|
V |
getSpecifiedValue()
Returns the typed value currently specified by the graphical component.
|
void |
setSpecifiedValue(V value)
Sets the typed value represented by the graphical component.
|
java.lang.String |
stringify(V value)
May be used to turn typed values into text labels for the
combo box.
|
void |
submitReport(ReportMap report)
Accepts information about a completed plot that was drawn with
input from this specifier.
|
addActionListener, fireAction, getActionForwarder, getChangeForwarder, getComponent, isXFill, removeActionListener
public ComboBoxSpecifier(javax.swing.JComboBox comboBox, boolean customStringify, boolean allowAny)
comboBox
- combo box instance with appropriate options
(must all be assignable from V)customStringify
- if true, this object's stringify
method is used to provide combo box textallowAny
- if true, then the setSpecifiedValue
method is allowed to set any value; otherwise,
it is restricted to the options in the combo boxpublic ComboBoxSpecifier(javax.swing.JComboBox comboBox)
comboBox
- combo box instance with appropriate options
(must all be assignable from V)public ComboBoxSpecifier(java.util.Collection<V> options)
options
- optionspublic ComboBoxSpecifier(V[] options)
options
- optionspublic java.lang.String stringify(V value)
value
- typed valueprotected javax.swing.JComponent createComponent()
SpecifierPanel
getComponent
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.createComponent
in class SpecifierPanel<V>
public V getSpecifiedValue()
Specifier
public void setSpecifiedValue(V value)
Specifier
getSpecifiedValue
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.
value
- new valuepublic void submitReport(ReportMap report)
Specifier
report
- report of a plot partially specified by this objectpublic javax.swing.JComboBox getComboBox()
Copyright © 2017 Central Laboratory of the Research Councils. All Rights Reserved.