Interface Specifier<V>
-
- All Known Implementing Classes:
BinSizer.BinSizerSpecifier
,ChooserColorSpecifier
,ComboBoxSpecifier
,ConversionSpecifier
,MultiSpecifierPanel
,SliderSpecifier
,SpecifierPanel
,TextFieldSpecifier
,ToggleSpecifier
,UnitRangeSpecifier
public interface Specifier<V>
Can acquire a typed value from the GUI.- Since:
- 5 Mar 2013
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addActionListener(java.awt.event.ActionListener listener)
Adds a listener which will be informed when the user interacts with the graphical component to cause a (potential) change in the value.javax.swing.JComponent
getComponent()
Returns the graphical component that the user can interact with to supply a value.V
getSpecifiedValue()
Returns the typed value currently specified by the graphical component.boolean
isXFill()
Whether the GUI component should fill the available width of a panel.void
removeActionListener(java.awt.event.ActionListener listener)
Removes a listener previously added byaddActionListener
.void
setSpecifiedValue(V 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.
-
-
-
Method Detail
-
getComponent
javax.swing.JComponent getComponent()
Returns the graphical component that the user can interact with to supply a value. It should be line-like (not tall).The returned component should preferably honour the JComponent
setEnabled
/isEnabled
methods.- Returns:
- specifier component
-
getSpecifiedValue
V getSpecifiedValue()
Returns the typed value currently specified by the graphical component.- Returns:
- specified value
-
setSpecifiedValue
void setSpecifiedValue(V value)
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
-
submitReport
void submitReport(ReportMap report)
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
-
addActionListener
void addActionListener(java.awt.event.ActionListener listener)
Adds a listener which will be informed when the user interacts with the graphical component to cause a (potential) change in the value.- Parameters:
listener
- listener to add
-
removeActionListener
void removeActionListener(java.awt.event.ActionListener listener)
Removes a listener previously added byaddActionListener
.- Parameters:
listener
- listener to remove
-
isXFill
boolean isXFill()
Whether the GUI component should fill the available width of a panel. This rendering hint should on the whole this should be true for expandable components, and false for fixed size components. Components should have a fixed vertical size in any case.- Returns:
- true for horizontally expandable components
-
-