|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
edu.neu.ccs.gui.RadioPanel
edu.neu.ccs.gui.OptionsView
A
for selection of one out of various indexed and labeled choices
represented by TypedViewJRadioButtons.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JPanel |
JPanel.AccessibleJPanel |
| Nested classes inherited from class javax.swing.JComponent |
JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
static String |
DEFAULT_INDEX
Bound property name for the default index property. |
protected int |
defaultValue
Default selection for this view. |
protected InputProperties |
properties
Property list for this view object. |
| Fields inherited from class edu.neu.ccs.gui.RadioPanel |
BACKGROUND, buttonGroup, commonactions, DEFAULT_SELECTION, defaultLayout, defaultViewState, labelButtonMap, labelIndexMap, modelButtonMap, OPTION_COUNT, SELECTED_BUTTON, SELECTED_INDEX, SELECTED_LABEL, SET_LABEL_TEXT |
| Fields inherited from class javax.swing.JPanel |
|
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface edu.neu.ccs.gui.TypedView |
DATA_TYPE |
| Fields inherited from interface edu.neu.ccs.gui.Displayable |
DEFAULT_VIEW_STATE, VIEW_STATE |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
OptionsView()
The default constructor. |
|
OptionsView(LayoutManager layout)
Constructs a panel with the given layout manager. |
|
OptionsView(String[] strings)
Constructs a panel containing radio buttons labeled with the given array of strings. |
|
OptionsView(String[] strings,
ActionListener action)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listener becomes a listener for all buttons. |
|
OptionsView(String[] strings,
ActionListener[] actions)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listeners become listeners for the corresponding buttons. |
|
OptionsView(String[] strings,
ActionListener[] actions,
int selection)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listeners become listeners for the corresponding buttons; the given selection is the index of the button that is initially selected. |
|
OptionsView(String[] strings,
ActionListener[] actions,
int selection,
LayoutManager layout)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listeners become listeners for the corresponding buttons; the given selection is the index of the button that is initially selected; the given layout manager is used to layout the buttons. |
|
OptionsView(String[] strings,
ActionListener[] actions,
LayoutManager layout)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listeners become listeners for the corresponding buttons; the given layout manager is used to layout the buttons. |
|
OptionsView(String[] strings,
ActionListener action,
int selection)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listener becomes a listener for all buttons; the given selection is the index of the button that is initially selected. |
|
OptionsView(String[] strings,
ActionListener action,
int selection,
LayoutManager layout)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listener becomes a listener for all buttons; the given selection is the index of the button that is initially selected; the given layout manager is used to layout the buttons. |
|
OptionsView(String[] strings,
ActionListener action,
LayoutManager layout)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listener becomes a listener for all buttons; the given layout manager is used to layout the buttons. |
|
OptionsView(String[] strings,
int selection)
Constructs a panel containing radio buttons labeled with the given array of strings; the given selection is the index of the button that is initially selected. |
|
OptionsView(String[] strings,
int selection,
LayoutManager layout)
Constructs a panel containing radio buttons labeled with the given array of strings; the given selection is the index of the button that is initially selected; the given layout manager is used to layout the buttons. |
|
OptionsView(String[] strings,
LayoutManager layout)
Constructs a panel containing radio buttons labeled with the given array of strings; the given layout manager is used to layout the buttons. |
|
| Method Summary | |
Stringable |
demandObject()
Returns an XInt object whose state is set to the index
of the currently selected option. |
Class |
getDataType()
Returns the XInt class object. |
int |
getDefaultIndex()
Returns the default index. |
String |
getDefaultLabel()
Returns the button label of the default index, or null if there are no options in this view. |
String |
getDefaultViewState()
Returns a String representation of the default index. |
InputProperties |
getInputProperties()
Returns the input properties for this view. |
String |
getViewState()
Returns a String representation of the index of the
currently selected option. |
Stringable |
requestObject()
Returns an XInt object whose state is set to the index
of the currently selected option. |
boolean |
setDefaultIndex(int index)
Sets the default index. |
boolean |
setDefaultLabel(String label)
Sets the default index to the index of the given button label. |
void |
setDefaultViewState(String state)
Sets the default index to the index represented by the given String state. |
void |
setInputProperties(InputProperties p)
Sets the input properties for this view to the provided input properties. |
void |
setViewState(String state)
Sets the currently selected option to the option at the index represented by the given String state. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface edu.neu.ccs.gui.Displayable |
reset, setEnabled |
| Field Detail |
public static final String DEFAULT_INDEX
protected int defaultValue
protected InputProperties properties
| Constructor Detail |
public OptionsView()
The default constructor.
Other constructors:
- OptionsView(LayoutManager)
- OptionsView(String[])
- OptionsView(String[], LayoutManager)
- OptionsView(String[], int)
- OptionsView(String[], int, LayoutManager)
- OptionsView(String[], ActionListener)
- OptionsView(String[], ActionListener, LayoutManager)
- OptionsView(String[], ActionListener, int)
- OptionsView(String[], ActionListener, int, LayoutManager)
- OptionsView(String[], ActionListener[])
- OptionsView(String[], ActionListener[], LayoutManager)
- OptionsView(String[], ActionListener[], int)
- OptionsView(String[], ActionListener[], int, LayoutManager)
public OptionsView(LayoutManager layout)
Constructs a panel with the given layout manager.
If the given layout manager is null, then a
TableLayout with WEST alignment
and VERTICAL orientation will be used.
layout - the layout manager for the panelOptionsView()public OptionsView(String[] strings)
Constructs a panel containing radio buttons labeled with the given array of strings.
The strings in the array of strings should be distinct as duplicate strings will be ignored.
If the strings array is null or of length
zero, the panel will be initialized with no buttons.
strings - the array of labels for the radio buttonsOptionsView()
public OptionsView(String[] strings,
LayoutManager layout)
Constructs a panel containing radio buttons labeled with the given array of strings; the given layout manager is used to layout the buttons.
The strings in the array of strings should be distinct as duplicate strings will be ignored.
If the strings array is null or of length
zero, the panel will be initialized with no buttons.
strings - the array of labels for the radio buttonslayout - the layout manager for the panelOptionsView()
public OptionsView(String[] strings,
int selection)
Constructs a panel containing radio buttons labeled with the given array of strings; the given selection is the index of the button that is initially selected.
The strings in the array of strings should be distinct as duplicate strings will be ignored.
If the initial selection index is invalid and if there are buttons in the panel then the selection index will be set to 0.
If the strings array is null or of length
zero, the panel will be initialized with no buttons.
strings - the array of labels for the radio buttonsselection - the index of the button selected by defaultOptionsView()
public OptionsView(String[] strings,
int selection,
LayoutManager layout)
Constructs a panel containing radio buttons labeled with the given array of strings; the given selection is the index of the button that is initially selected; the given layout manager is used to layout the buttons.
The strings in the array of strings should be distinct as duplicate strings will be ignored.
If the initial selection index is invalid and if there are buttons in the panel then the selection index will be set to 0.
If the strings array is null or of length
zero, the panel will be initialized with no buttons.
strings - the array of labels for the radio buttonsselection - the index of the button selected by defaultlayout - the layout manager for the panelOptionsView()
public OptionsView(String[] strings,
ActionListener action)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listener becomes a listener for all buttons.
The strings in the array of strings should be distinct as duplicate strings will be ignored.
If the strings array is null or of length
zero, the panel will be initialized with no buttons.
strings - the array of labels for the radio buttonsaction - the action listener that will listen for selectionOptionsView()
public OptionsView(String[] strings,
ActionListener action,
LayoutManager layout)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listener becomes a listener for all buttons; the given layout manager is used to layout the buttons.
The strings in the array of strings should be distinct as duplicate strings will be ignored.
If the strings array is null or of length
zero, the panel will be initialized with no buttons.
If the given layout manager is null, then a
TableLayout with WEST alignment
and VERTICAL orientation will be used.
strings - the array of labels for the radio buttonsaction - the action listener that will listen for selectionlayout - the layout manager for the panelOptionsView()
public OptionsView(String[] strings,
ActionListener action,
int selection)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listener becomes a listener for all buttons; the given selection is the index of the button that is initially selected.
The strings in the array of strings should be distinct as duplicate strings will be ignored.
If the initial selection index is invalid and if there are buttons in the panel then the selection index will be set to 0.
If the strings array is null or of length
zero, the panel will be initialized with no buttons.
strings - the array of labels for the radio buttonsaction - the action listener that will listen for selectionselection - the index of the button selected by defaultOptionsView()
public OptionsView(String[] strings,
ActionListener action,
int selection,
LayoutManager layout)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listener becomes a listener for all buttons; the given selection is the index of the button that is initially selected; the given layout manager is used to layout the buttons.
The strings in the array of strings should be distinct as duplicate strings will be ignored.
If the initial selection index is invalid and if there are buttons in the panel then the selection index will be set to 0.
If the strings array is null or of length
zero, the panel will be initialized with no buttons.
If the given layout manager is null, then a
TableLayout with WEST alignment
and VERTICAL orientation will be used.
strings - the array of labels for the radio buttonsaction - the action listener that will listen for selectionselection - the index of the button selected by defaultlayout - the layout manager for the panelOptionsView()
public OptionsView(String[] strings,
ActionListener[] actions)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listeners become listeners for the corresponding buttons.
The strings in the array of strings should be distinct as duplicate strings will be ignored.
If the strings array is null or of length
zero, the panel will be initialized with no buttons.
strings - the array of labels for the radio buttonsactions - the action listeners that will listen for selectionOptionsView()
public OptionsView(String[] strings,
ActionListener[] actions,
LayoutManager layout)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listeners become listeners for the corresponding buttons; the given layout manager is used to layout the buttons.
The strings in the array of strings should be distinct as duplicate strings will be ignored.
If the strings array is null or of length
zero, the panel will be initialized with no buttons.
If the given layout manager is null, then a
TableLayout with WEST alignment
and VERTICAL orientation will be used.
strings - the array of labels for the radio buttonsactions - the action listeners that will listen for selectionlayout - the layout manager for the panelOptionsView()
public OptionsView(String[] strings,
ActionListener[] actions,
int selection)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listeners become listeners for the corresponding buttons; the given selection is the index of the button that is initially selected.
The strings in the array of strings should be distinct as duplicate strings will be ignored.
If the initial selection index is invalid and if there are buttons in the panel then the selection index will be set to 0.
If the strings array is null or of length
zero, the panel will be initialized with no buttons.
strings - the array of labels for the radio buttonsactions - the action listeners that will listen for selectionselection - the index of the button selected by defaultOptionsView()
public OptionsView(String[] strings,
ActionListener[] actions,
int selection,
LayoutManager layout)
Constructs a panel containing radio buttons labeled with the given array of strings; the given action listeners become listeners for the corresponding buttons; the given selection is the index of the button that is initially selected; the given layout manager is used to layout the buttons.
The strings in the array of strings should be distinct as duplicate strings will be ignored.
If the initial selection index is invalid and if there are buttons in the panel then the selection index will be set to 0.
If the strings array is null or of length
zero, the panel will be initialized with no buttons.
If the given layout manager is null, then a
TableLayout with WEST alignment
and VERTICAL orientation will be used.
strings - the array of labels for the radio buttonsactions - the action listeners that will listen for selectionselection - the index of the button selected by defaultlayout - the layout manager for the panelOptionsView()| Method Detail |
public Stringable demandObject()
XInt object whose state is set to the index
of the currently selected option.
demandObject in interface TypedViewStringable model objectrequestObject(),
TypedViewpublic Stringable requestObject()
XInt object whose state is set to the index
of the currently selected option.
requestObject in interface TypedViewStringable model objectdemandObject(),
TypedViewpublic void setInputProperties(InputProperties p)
TypedViewSets the input properties for this view to the provided input properties.
If the given input properties list is null, the
property list for this view is set to the base property list
containing default property values.
setInputProperties in interface TypedViewp - the new input properties for the viewTypedView.getInputProperties()public InputProperties getInputProperties()
TypedView
getInputProperties in interface TypedViewTypedView.setInputProperties(InputProperties)public Class getDataType()
XInt class object.
getDataType in interface TypedViewTypedViewpublic void setViewState(String state)
Sets the currently selected option to the option at the index
represented by the given String state.
If the String state does not represent an integer
or if it represents an integer that is not a valid index, then the
currently selected option is not changed.
Overrides the inherited method that considers the view state as
a String representing the button label rather than as
a String representing the button index.
setViewState in interface DisplayablesetViewState in class RadioPanelstate - a String representation of the indexgetViewState(),
Displayablepublic String getViewState()
Returns a String representation of the index of the
currently selected option.
Overrides the inherited method that considers the view state as
a String representing the button label rather than as
a String representing the button index.
getViewState in interface DisplayablegetViewState in class RadioPanelStringsetViewState(String),
Displayablepublic void setDefaultViewState(String state)
Sets the default index to the index represented by the given
String state.
If the String state does not represent an integer
or if it represents an integer that is not a valid index, then the
default index is not changed.
Overrides the inherited method that considers the view state as
a String representing the button label rather than as
a String representing the button index.
setDefaultViewState in interface DisplayablesetDefaultViewState in class RadioPanelstate - a String representation of the default indexRadioPanel.reset(),
Displayablepublic String getDefaultViewState()
Returns a String representation of the default index.
Overrides the inherited method that considers the view state as
a String representing the button label rather than as
a String representing the button index.
getDefaultViewState in interface DisplayablegetDefaultViewState in class RadioPanelStringsetDefaultViewState(String),
RadioPanel.reset()public boolean setDefaultIndex(int index)
Sets the default index.
If the given index is invalid, the default index is not changed.
index - the default index
getDefaultIndex(),
setDefaultLabel(String)public int getDefaultIndex()
Returns the default index.
setDefaultIndex(int),
getDefaultLabel()public boolean setDefaultLabel(String label)
Sets the default index to the index of the given button label.
If the given label is invalid, then does nothing.
label - the button label corresponding to the default index
getDefaultLabel(),
setDefaultIndex(int)public String getDefaultLabel()
Returns the button label of the default index,
or null if there are no options in this view.
setDefaultLabel(String),
getDefaultIndex()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||