public abstract class SpecifierPanel<V> extends Object implements Specifier<V>
Modifier | Constructor and Description |
---|---|
protected |
SpecifierPanel(boolean isXFill)
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.
|
protected abstract JComponent |
createComponent()
Abstract method called lazily during
getComponent
to obtain the graphical component used by this specifier. |
protected void |
fireAction()
Notifies all the registered action listeners of a non-specific event.
|
protected ActionListener |
getActionForwarder()
Returns a listener which will take ActionEvents and forward them
to any listeners registered with this panel.
|
protected ChangeListener |
getChangeForwarder()
Returns a listener which will take ChangeEvents and forward them
to any listeners registered with this panel.
|
JComponent |
getComponent()
Returns the graphical component that the user can interact with
to supply a value.
|
boolean |
isXFill()
Whether the GUI component should fill the available width of a panel.
|
void |
removeActionListener(ActionListener listener)
Removes a listener previously added by
addActionListener . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSpecifiedValue, setSpecifiedValue, submitReport
protected SpecifierPanel(boolean isXFill)
isXFill
- true if the graphical component should expand to fill
the available horizontal spacepublic boolean isXFill()
Specifier
protected abstract JComponent createComponent()
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.public JComponent getComponent()
Specifier
The returned component should preferably honour the JComponent
setEnabled
/isEnabled
methods.
getComponent
in interface Specifier<V>
public void addActionListener(ActionListener listener)
Specifier
addActionListener
in interface Specifier<V>
listener
- listener to addpublic void removeActionListener(ActionListener listener)
Specifier
addActionListener
.removeActionListener
in interface Specifier<V>
listener
- listener to removeprotected ActionListener getActionForwarder()
In general any input component which forms part of this panel's
GUI should have as a listener the result of
getActionForwarder
or getChangeForwarder
,
so that changes in their state are propagated to listeners
of this specifier.
protected ChangeListener getChangeForwarder()
In general any input component which forms part of this panel's
GUI should have as a listener the result of
getActionForwarder
or getChangeForwarder
,
so that changes in their state are propagated to listeners
of this specifier.
protected void fireAction()
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.