Class marimba.gui.ChoiceWidget
All Packages Class Hierarchy This Package Previous Next Index
Class marimba.gui.ChoiceWidget
java.lang.Object
|
+----marimba.gui.Widget
|
+----marimba.gui.ChoiceWidget
- public class ChoiceWidget
- extends Widget
A generic widget which provides multiple choices.
This can be represented as a list or as a menu.
- Version:
- 1.17, 01/16/97
- Author:
- Arthur van Hoff, Klaas Waslander
-
current
- The current choice.
-
ChoiceWidget()
- Default constructor.
-
ChoiceWidget(int, String[])
- Constructor for constructing a choiceWidget with
a given number of choices.
-
addChoice(String)
- Append a choice to the list of possible choices.
-
getChildProperties(PropertyList)
- Get the properties for the children of this widget.
-
getChoice(int)
- Get the choice at the given position.
-
getChoiceCount()
- Get the number of choices.
-
getChoices()
- Get the choices, these are the strings that represent
the choices on screen.
-
getIntegerValue()
- Get the current choice.
-
getName(int)
- Get the name at the given position.
-
getNames()
- Get the names of the choices.
-
getProperties(PropertyList)
- Get the properties of this widget.
-
getStringValue()
- Get the current choice.
-
getText()
- Get the current choice.
-
getValue()
- Get the current choice.
-
getValueIndex(String)
- Get index of a value.
-
insertChoiceAt(String, int)
- Insert a choice before the choice at the position.
-
paramString(StringBuffer)
- Debugging.
-
removeAllChoices()
- Remove all the choices from this widget.
-
removeChoice(String)
- Remove the first choice with the given name.
-
removeChoiceAt(int)
- Remove the choice with the given index.
-
setChoices(String)
- Set choices from a comma seperated list.
-
setChoices(String[])
- Set the choices by specifying the strings
that appear on screen.
-
setChoices(String[], String[])
- Set the choices by specifying the choices and the
names by which they can be referenced.
-
setChoices(Vector)
- Set the choices by specifying a Vector
containing the strings that represent
the choices.
-
setProperties(PropertyList)
- Set the properties of this widget.
-
setText(String)
- Set the choice.
-
setValue(int)
- Set the current choice given the index.
-
setValue(Object)
- Set the current choice.
-
setValue(String)
- Set the current choice.
current
public int current
- The current choice. No choice is represented by -1.
- See Also:
- getIntegerValue, getStringValue, getValue, setValue, getChoiceCount
ChoiceWidget
public ChoiceWidget()
- Default constructor.
ChoiceWidget
public ChoiceWidget(int nchoices,
String choices[])
- Constructor for constructing a choiceWidget with
a given number of choices.
getProperties
public void getProperties(PropertyList list)
- Get the properties of this widget.
- Overrides:
- getProperties in class Widget
getChildProperties
public void getChildProperties(PropertyList list)
- Get the properties for the children of this widget.
- Overrides:
- getChildProperties in class Widget
setProperties
public void setProperties(PropertyList list)
- Set the properties of this widget.
- Overrides:
- setProperties in class Widget
getChoiceCount
public int getChoiceCount()
- Get the number of choices.
- See Also:
- current
getValueIndex
public int getValueIndex(String value)
- Get index of a value.
- See Also:
- getStringValue
getIntegerValue
public int getIntegerValue()
- Get the current choice. This will return -1 if
no choice is selected.
- See Also:
- current
getStringValue
public String getStringValue()
- Get the current choice.
- See Also:
- current, getValueIndex
getValue
public Object getValue()
- Get the current choice.
- Overrides:
- getValue in class Widget
- See Also:
- current, getText
setValue
public void setValue(Object value)
- Set the current choice.
- Overrides:
- setValue in class Widget
- See Also:
- current
setValue
public void setValue(String value)
- Set the current choice.
- See Also:
- current, setText
setValue
public void setValue(int value)
- Set the current choice given the index.
- See Also:
- current
getText
public String getText()
- Get the current choice.
- Overrides:
- getText in class Widget
- See Also:
- getStringValue
setText
public void setText(String value)
- Set the choice.
- Overrides:
- setText in class Widget
- See Also:
- setValue
getChoices
public String[] getChoices()
- Get the choices, these are the strings that represent
the choices on screen.
getChoice
public String getChoice(int pos)
- Get the choice at the given position.
getNames
public String[] getNames()
- Get the names of the choices. If a name exists for
a choice that name is used for accessing a choice.
getName
public String getName(int pos)
- Get the name at the given position.
addChoice
public void addChoice(String newChoice)
- Append a choice to the list of possible choices.
of this choice widget.
insertChoiceAt
public void insertChoiceAt(String newChoice,
int index)
- Insert a choice before the choice at the position.
with the given index.
removeChoice
public void removeChoice(String oldChoice)
- Remove the first choice with the given name.
removeChoiceAt
public void removeChoiceAt(int index)
- Remove the choice with the given index.
removeAllChoices
public void removeAllChoices()
- Remove all the choices from this widget.
setChoices
public void setChoices(String list)
- Set choices from a comma seperated list.
Every choice can consist of a "choice/name" pair, where
the choice is used for the onscreen representation of the
choice and the name the choice represents in the code.
setChoices
public void setChoices(Vector choices)
- Set the choices by specifying a Vector
containing the strings that represent
the choices.
setChoices
public void setChoices(String choices[])
- Set the choices by specifying the strings
that appear on screen.
setChoices
public void setChoices(String choices[],
String names[])
- Set the choices by specifying the choices and the
names by which they can be referenced. The strings
from the choices array appear on screen, the strings
in the names array are used to reference those choices.
paramString
public void paramString(StringBuffer buf)
- Debugging.
- Overrides:
- paramString in class Widget
All Packages Class Hierarchy This Package Previous Next Index