|
||||||||||
| 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.StringObjectRadioPanel
A view based on RadioPanel for the selection of an object
using an associated string in a StringObjectMap.
It is invalid to modify the items in this view after construction by using methods of the base class.
| 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 | |
protected StringObjectMap |
pairmap
The internal two way map. |
| 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.StringObjectView |
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 edu.neu.ccs.gui.Displayable |
DEFAULT_VIEW_STATE, VIEW_STATE |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
StringObjectRadioPanel()
The default constructor. |
|
StringObjectRadioPanel(Object[][] pairs)
The constructor that uses a pairs array to construct the internal two way map. |
|
StringObjectRadioPanel(Object[][] pairs,
ActionListener action)
The constructor that uses a pairs array to construct the internal two way map; and provides the action listener to perform when an option is selected. |
|
StringObjectRadioPanel(Object[][] pairs,
ActionListener action,
int selection)
The constructor that uses a pairs array to construct the internal two way map; provides the action listener to perform when an option is selected; and provides the initial selection string. |
|
StringObjectRadioPanel(Object[][] pairs,
ActionListener action,
int selection,
LayoutManager layout)
The constructor that uses a pairs array to construct the internal two way map; provides the action listener to perform when an option is selected; provides the initial selection string; and provides the layout manager. |
|
StringObjectRadioPanel(StringObjectMap map)
The constructor that copies the given string-object map to construct the internal string-object map. |
|
StringObjectRadioPanel(StringObjectMap map,
ActionListener action)
The constructor that copies the given string-object map to construct the internal string-object map; and provides the action listener to perform when an option is selected. |
|
StringObjectRadioPanel(StringObjectMap map,
ActionListener action,
int selection)
The constructor that copies the given string-object map to construct the internal string-object map; provides the action listener to perform when an option is selected; and provides the initial selection string. |
|
StringObjectRadioPanel(StringObjectMap map,
ActionListener action,
int selection,
LayoutManager layout)
The constructor that copies the given string-object map to construct the internal string-object map; provides the action listener to perform when an option is selected; provides the initial selection string; and provides the layout manager. |
|
StringObjectRadioPanel(StringObjectPair[] pairs)
The constructor that uses a pairs array to construct the internal two way map. |
|
StringObjectRadioPanel(StringObjectPair[] pairs,
ActionListener action)
The constructor that uses a pairs array to construct the internal two way map; and provides the action listener to perform when an option is selected. |
|
StringObjectRadioPanel(StringObjectPair[] pairs,
ActionListener action,
int selection)
The constructor that uses a pairs array to construct the internal two way map; provides the action listener to perform when an option is selected; and provides the initial selection string. |
|
StringObjectRadioPanel(StringObjectPair[] pairs,
ActionListener action,
int selection,
LayoutManager layout)
The constructor that uses a pairs array to construct the internal two way map; provides the action listener to perform when an option is selected; provides the initial selection string; and provides the layout manager. |
|
| Method Summary | |
void |
addPair(String string,
Object object)
Adds the new pair with the given string and object. |
void |
addPair(StringObjectPair pair)
Adds the new string-object pair. |
void |
addPairs(Object[][] pairs)
Adds the new pairs. |
void |
addPairs(StringObjectMap map)
Adds the new map. |
void |
addPairs(StringObjectPair[] pairs)
Adds the new pairs. |
Object |
getSelectedObject()
Returns the object corresponding to the currently selected string in the view. |
String |
getSelectedString()
Returns the currently selected string in the view. |
protected void |
initializeSORadioPanel(StringObjectPair[] pairs,
ActionListener action,
int selection,
LayoutManager layout)
The initializer. |
void |
setSelectedObject(Object object)
Sets the view to the string corresponding to the given object. |
void |
setSelectedString(String string)
Sets the view to the string provided that the string is in the internal map. |
| 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.StringObjectView |
addActionListener, removeActionListener |
| Field Detail |
protected StringObjectMap pairmap
| Constructor Detail |
public StringObjectRadioPanel()
The default constructor.
Other constructors:
- StringObjectRadioPanel(Object[][])
- StringObjectRadioPanel(Object[][], ActionListener)
- StringObjectRadioPanel(Object[][], ActionListener, int)
- StringObjectRadioPanel(Object[][], ActionListener, int, LayoutManager)
- StringObjectRadioPanel(StringObjectPair[])
- StringObjectRadioPanel(StringObjectPair[], ActionListener)
- StringObjectRadioPanel(StringObjectPair[], ActionListener, int)
- StringObjectRadioPanel(StringObjectPair[], ActionListener, int, LayoutManager)
- StringObjectRadioPanel(StringObjectMap)
- StringObjectRadioPanel(StringObjectMap, ActionListener)
- StringObjectRadioPanel(StringObjectMap, ActionListener, int)
- StringObjectRadioPanel(StringObjectMap, ActionListener, int, LayoutManager)
public StringObjectRadioPanel(Object[][] pairs)
The constructor that uses a pairs array to construct the internal two way map.
pairs - the string-object pairs to addStringObjectRadioPanel()
public StringObjectRadioPanel(Object[][] pairs,
ActionListener action)
The constructor that uses a pairs array to construct the internal two way map; and provides the action listener to perform when an option is selected.
pairs - the string-object pairs to addaction - the action listener to perform when an option is selectedStringObjectRadioPanel()
public StringObjectRadioPanel(Object[][] pairs,
ActionListener action,
int selection)
The constructor that uses a pairs array to construct the internal two way map; provides the action listener to perform when an option is selected; and provides the initial selection string.
pairs - the string-object pairs to addaction - the action listener to perform when an option is selectedselection - the desired preferred selectionStringObjectRadioPanel()
public StringObjectRadioPanel(Object[][] pairs,
ActionListener action,
int selection,
LayoutManager layout)
The constructor that uses a pairs array to construct the internal two way map; provides the action listener to perform when an option is selected; provides the initial selection string; and provides the layout manager.
pairs - the string-object pairs to addaction - the action listener to perform when an option is selectedselection - the desired preferred selectionlayout - the layout managerStringObjectRadioPanel()public StringObjectRadioPanel(StringObjectPair[] pairs)
The constructor that uses a pairs array to construct the internal two way map.
pairs - the string-object pairs to addStringObjectRadioPanel()
public StringObjectRadioPanel(StringObjectPair[] pairs,
ActionListener action)
The constructor that uses a pairs array to construct the internal two way map; and provides the action listener to perform when an option is selected.
pairs - the string-object pairs to addaction - the action listener to perform when an option is selectedStringObjectRadioPanel()
public StringObjectRadioPanel(StringObjectPair[] pairs,
ActionListener action,
int selection)
The constructor that uses a pairs array to construct the internal two way map; provides the action listener to perform when an option is selected; and provides the initial selection string.
pairs - the string-object pairs to addaction - the action listener to perform when an option is selectedselection - the desired preferred selectionStringObjectRadioPanel()
public StringObjectRadioPanel(StringObjectPair[] pairs,
ActionListener action,
int selection,
LayoutManager layout)
The constructor that uses a pairs array to construct the internal two way map; provides the action listener to perform when an option is selected; provides the initial selection string; and provides the layout manager.
pairs - the string-object pairs to addaction - the action listener to perform when an option is selectedselection - the desired preferred selectionlayout - the layout managerStringObjectRadioPanel()public StringObjectRadioPanel(StringObjectMap map)
The constructor that copies the given string-object map to construct the internal string-object map.
map - the string-object map to addStringObjectRadioPanel()
public StringObjectRadioPanel(StringObjectMap map,
ActionListener action)
The constructor that copies the given string-object map to construct the internal string-object map; and provides the action listener to perform when an option is selected.
map - the string-object map to addaction - the action listener to perform when an option is selectedStringObjectRadioPanel()
public StringObjectRadioPanel(StringObjectMap map,
ActionListener action,
int selection)
The constructor that copies the given string-object map to construct the internal string-object map; provides the action listener to perform when an option is selected; and provides the initial selection string.
map - the string-object map to addaction - the action listener to perform when an option is selectedselection - the desired preferred selectionStringObjectRadioPanel()
public StringObjectRadioPanel(StringObjectMap map,
ActionListener action,
int selection,
LayoutManager layout)
The constructor that copies the given string-object map to construct the internal string-object map; provides the action listener to perform when an option is selected; provides the initial selection string; and provides the layout manager.
map - the string-object map to addaction - the action listener to perform when an option is selectedselection - the desired preferred selectionlayout - the layout managerStringObjectRadioPanel()| Method Detail |
protected final void initializeSORadioPanel(StringObjectPair[] pairs,
ActionListener action,
int selection,
LayoutManager layout)
pairs - the string-object pairs to addaction - the action listener to perform when an option is selectedselection - the desired preferred selectionlayout - the layout managerpublic final String getSelectedString()
Returns the currently selected string in the view.
getSelectedString in interface StringObjectViewgetSelectedObject()public final Object getSelectedObject()
Returns the object corresponding to the currently selected string in the view.
getSelectedObject in interface StringObjectViewgetSelectedString()public final void setSelectedString(String string)
Sets the view to the string provided that the string is in the internal map.
Does nothing if the string is null
or is not in the internal map.
Does nothing if the view state will be unchanged.
setSelectedString in interface StringObjectViewstring - the string to use to set the viewsetSelectedObject(Object)public final void setSelectedObject(Object object)
Sets the view to the string corresponding to the given object.
Does nothing if the object is null
or is not in the internal map.
setSelectedObject in interface StringObjectViewobject - the object to use to set the viewsetSelectedString(String)
public final void addPair(String string,
Object object)
Adds the new pair with the given string and object.
string - the stringobject - the objectaddPair(StringObjectPair)public final void addPair(StringObjectPair pair)
Adds the new string-object pair.
pair - the string-object pairpublic final void addPairs(Object[][] pairs)
Adds the new pairs.
pairs - the string-object pairs to addaddPairs(StringObjectPair[]),
addPairs(StringObjectMap)public final void addPairs(StringObjectPair[] pairs)
Adds the new pairs.
pairs - the string-object pairs to addaddPairs(Object[][]),
addPairs(StringObjectMap)public final void addPairs(StringObjectMap map)
Adds the new map.
map - the string-object map to addaddPairs(Object[][]),
addPairs(StringObjectPair[])
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||