public class G9ButtonGroup extends ButtonGroup implements FocusListener, G9ValueState, ActionListener
| Modifier and Type | Class and Description |
|---|---|
static class |
G9ButtonGroup.ComponentGroup
Since the radio button group some times needs to be considered
as a Swing component, this class can act on behalf of the radio
group.
|
| Modifier and Type | Field and Description |
|---|---|
protected EventListenerList |
listenerList
List of event listeners
|
protected EventListenerList |
vcListeners
list of value changed listeners
|
buttons| Constructor and Description |
|---|
G9ButtonGroup()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(ActionEvent e) |
void |
add(AbstractButton b) |
void |
addActionListener(ActionListener listener)
Adds an action listener to the group of listeners that should get
notified when an action event occurs.
|
void |
addFocusListener(FocusListener listener)
Adds a focus listener to the list of listeners that should be notified
when a focus event occurs.
|
void |
addValueChangedListener(G9ValueChangedListener listener)
Adds a change listener to this component.
|
JComponent |
asComponent()
Returns a component view of this group
|
void |
clear()
Clears the radio button group.
|
void |
display(Object o)
Updates the displayed value of the component, without
affecting the state of the component.
|
void |
fireActionEvent(ActionEvent e)
Fires an action event, notifying any registred listeneres interrested in
this type of event.
|
void |
fireFocusEvent(FocusEvent e)
Fires a focus event, notifying any registred listeners interrested
in this typeof event.
|
protected void |
fireG9ValueChangedEvent(int id,
Object oldValue,
Object newValue)
Fires a g9 value changed event.
|
void |
focusGained(FocusEvent e) |
void |
focusLost(FocusEvent e) |
Object |
getInitialValue()
Returns the initial displayed value.
|
boolean |
isChanged()
Checks if the currently displayed value is the same as the initial
value.
|
boolean |
isClear()
Check if the radio group is clear, viz.
|
void |
resetState()
Forces the currently displayed value to be considered the old value.
|
void |
setInitialValue(Object value)
Sets the initial value to be the specified value.
|
void |
updateSelection()
Updates initial selected value of this group.
|
clearSelection, getButtonCount, getElements, getSelection, isSelected, remove, setSelectedprotected EventListenerList vcListeners
protected EventListenerList listenerList
public JComponent asComponent()
public void add(AbstractButton b)
add in class ButtonGrouppublic void focusGained(FocusEvent e)
focusGained in interface FocusListenerpublic void clear()
public void focusLost(FocusEvent e)
focusLost in interface FocusListenerpublic void addValueChangedListener(G9ValueChangedListener listener)
G9ValueStateaddValueChangedListener in interface G9ValueStatelistener - the listener to addpublic void addActionListener(ActionListener listener)
listener - the action listenerpublic void addFocusListener(FocusListener listener)
listener - the focus listenerpublic void fireActionEvent(ActionEvent e)
e - the action event to fire.public void fireFocusEvent(FocusEvent e)
e - the focus event to fire.protected void fireG9ValueChangedEvent(int id,
Object oldValue,
Object newValue)
id - the type of eventoldValue - the old valuenewValue - the new valuepublic void resetState()
G9ValueStateresetState in interface G9ValueStatepublic boolean isChanged()
G9ValueStateisChanged in interface G9ValueStatetrue if the displayed value differs from the
initial value.public boolean isClear()
true if no selection is made.public void updateSelection()
public void display(Object o)
G9ValueStatedisplay in interface G9ValueStateo - the new value to displaypublic Object getInitialValue()
G9ValueStategetInitialValue in interface G9ValueStatepublic void setInitialValue(Object value)
G9ValueStatesetInitialValue in interface G9ValueStatevalue - the (new) initial value.public void actionPerformed(ActionEvent e)
actionPerformed in interface ActionListenerCopyright © 2006–2018 Esito AS. All rights reserved.