public abstract class ConversionSpecifier<I,O> extends Object implements Specifier<O>
I
)
and output (O
) types must be provided.Modifier | Constructor and Description |
---|---|
protected |
ConversionSpecifier(Specifier<I> baseSpec)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected abstract O inToOut(I inValue)
inValue
- input type valueprotected abstract I outToIn(O outValue)
outValue
- output type valuepublic 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
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.