|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.config.ConversionSpecifier<I,O>
public abstract class ConversionSpecifier<I,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.
Constructor Summary | |
---|---|
protected |
ConversionSpecifier(Specifier<I> baseSpec)
Constructor. |
Method Summary | |
---|---|
void |
addActionListener(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. |
JComponent |
getComponent()
Returns the graphical component that the user can interact with to supply a value. |
O |
getSpecifiedValue()
Returns the typed value currently specified by the graphical component. |
protected abstract O |
inToOut(I inValue)
Converts a value from input (base) to output type. |
boolean |
isXFill()
Whether the GUI component should fill the available width of a panel. |
protected abstract I |
outToIn(O outValue)
Converts a value from output to input (base) type. |
void |
removeActionListener(ActionListener listener)
Removes a listener previously added by addActionListener . |
void |
setSpecifiedValue(O outValue)
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 java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ConversionSpecifier(Specifier<I> baseSpec)
baseSpec
- specifier on which this one is basedMethod Detail |
---|
protected abstract O inToOut(I inValue)
inValue
- input type value
protected abstract I outToIn(O outValue)
outValue
- output type value
public JComponent getComponent()
Specifier
The returned component should preferably honour the JComponent
setEnabled
/isEnabled
methods.
getComponent
in interface Specifier<O>
public O getSpecifiedValue()
Specifier
getSpecifiedValue
in interface Specifier<O>
public void setSpecifiedValue(O outValue)
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.
setSpecifiedValue
in interface Specifier<O>
outValue
- new valuepublic void addActionListener(ActionListener listener)
Specifier
addActionListener
in interface Specifier<O>
listener
- listener to addpublic void removeActionListener(ActionListener listener)
Specifier
addActionListener
.
removeActionListener
in interface Specifier<O>
listener
- listener to removepublic void submitReport(ReportMap report)
Specifier
submitReport
in interface Specifier<O>
report
- report of a plot partially specified by this objectpublic boolean isXFill()
Specifier
isXFill
in interface Specifier<O>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |