Class ConversionSpecifier<I,O>
java.lang.Object
uk.ac.starlink.ttools.plot2.config.ConversionSpecifier<I,O>
- All Implemented Interfaces:
Specifier<O>
Specifier implementation that adapts an existing one to dispense
values of a different parameterised type.
Implementations of methods to convert between the input (
I)
and output (O) types must be provided.- Since:
- 13 Feb 2014
- Author:
- Mark Taylor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionListener(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.Returns the graphical component that the user can interact with to supply a value.Returns the typed value currently specified by the graphical component.protected abstract OConverts a value from input (base) to output type.booleanisXFill()Whether the GUI component should fill the available width of a panel.protected abstract IConverts a value from output to input (base) type.voidremoveActionListener(ActionListener listener) Removes a listener previously added byaddActionListener.voidsetSpecifiedValue(O outValue) Sets the typed value represented by the graphical component.voidsubmitReport(ReportMap report) Accepts information about a completed plot that was drawn with input from this specifier.
-
Constructor Details
-
ConversionSpecifier
-
-
Method Details
-
inToOut
-
outToIn
-
getComponent
Description copied from interface:SpecifierReturns 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/isEnabledmethods.- Specified by:
getComponentin interfaceSpecifier<I>- Returns:
- specifier component
-
getSpecifiedValue
Description copied from interface:SpecifierReturns the typed value currently specified by the graphical component.- Specified by:
getSpecifiedValuein interfaceSpecifier<I>- Returns:
- specified value
-
setSpecifiedValue
Description copied from interface:SpecifierSets 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 ofgetSpecifiedValueshould 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.
- Specified by:
setSpecifiedValuein interfaceSpecifier<I>- Parameters:
outValue- new value
-
addActionListener
Description copied from interface:SpecifierAdds a listener which will be informed when the user interacts with the graphical component to cause a (potential) change in the value.- Specified by:
addActionListenerin interfaceSpecifier<I>- Parameters:
listener- listener to add
-
removeActionListener
Description copied from interface:SpecifierRemoves a listener previously added byaddActionListener.- Specified by:
removeActionListenerin interfaceSpecifier<I>- Parameters:
listener- listener to remove
-
submitReport
Description copied from interface:SpecifierAccepts 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.- Specified by:
submitReportin interfaceSpecifier<I>- Parameters:
report- report of a plot partially specified by this object
-
isXFill
public boolean isXFill()Description copied from interface:SpecifierWhether 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.
-