public class DeviceButtonGroup extends Device
Device.ActionSet
Modifier and Type | Field | Description |
---|---|---|
protected java.util.ArrayList<IAction> |
buttonActions |
|
protected javax.swing.ButtonGroup |
buttonGroup |
|
protected javax.swing.JPanel |
buttonPanel |
|
protected java.util.ArrayList<javax.swing.JRadioButton> |
buttons |
|
protected int |
cols |
|
protected java.util.HashMap<java.lang.String,java.lang.Integer> |
labelHash |
|
protected IAction |
targetAction |
controller, unit
Constructor | Description |
---|---|
DeviceButtonGroup(Controller controller,
int cols) |
Modifier and Type | Method | Description |
---|---|---|
javax.swing.JRadioButton |
addButton(java.lang.String label,
IAction action) |
Adds a radio button with the given label, which (when selected) performs
the given action.
|
java.awt.Component |
graphic() |
|
boolean |
isSelected(java.lang.String label) |
Returns true if the button of the given label is selected.
|
void |
setLabel(java.lang.String label) |
Sets the label for the group of radio buttons
|
protected void |
setSelected(int i) |
Selects ith radio button.
|
void |
setSelected(java.lang.String label) |
Selects the button with the given label.
|
doAction, getController, getDimension, getPostAction, getPreAction, getUnit, setController, setPostAction, setPreAction, setUnit
protected final javax.swing.ButtonGroup buttonGroup
protected final java.util.ArrayList<javax.swing.JRadioButton> buttons
protected final java.util.ArrayList<IAction> buttonActions
protected final java.util.HashMap<java.lang.String,java.lang.Integer> labelHash
protected final javax.swing.JPanel buttonPanel
protected final int cols
protected IAction targetAction
public DeviceButtonGroup(Controller controller, int cols)
public void setLabel(java.lang.String label)
public javax.swing.JRadioButton addButton(java.lang.String label, IAction action)
public boolean isSelected(java.lang.String label)
public void setSelected(java.lang.String label)
protected void setSelected(int i)