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

Variable Index

 o current
The current choice.

Constructor Index

 o ChoiceWidget()
Default constructor.
 o ChoiceWidget(int, String[])
Constructor for constructing a choiceWidget with a given number of choices.

Method Index

 o addChoice(String)
Append a choice to the list of possible choices.
 o getChildProperties(PropertyList)
Get the properties for the children of this widget.
 o getChoice(int)
Get the choice at the given position.
 o getChoiceCount()
Get the number of choices.
 o getChoices()
Get the choices, these are the strings that represent the choices on screen.
 o getIntegerValue()
Get the current choice.
 o getName(int)
Get the name at the given position.
 o getNames()
Get the names of the choices.
 o getProperties(PropertyList)
Get the properties of this widget.
 o getStringValue()
Get the current choice.
 o getText()
Get the current choice.
 o getValue()
Get the current choice.
 o getValueIndex(String)
Get index of a value.
 o insertChoiceAt(String, int)
Insert a choice before the choice at the position.
 o paramString(StringBuffer)
Debugging.
 o removeAllChoices()
Remove all the choices from this widget.
 o removeChoice(String)
Remove the first choice with the given name.
 o removeChoiceAt(int)
Remove the choice with the given index.
 o setChoices(String)
Set choices from a comma seperated list.
 o setChoices(String[])
Set the choices by specifying the strings that appear on screen.
 o setChoices(String[], String[])
Set the choices by specifying the choices and the names by which they can be referenced.
 o setChoices(Vector)
Set the choices by specifying a Vector containing the strings that represent the choices.
 o setProperties(PropertyList)
Set the properties of this widget.
 o setText(String)
Set the choice.
 o setValue(int)
Set the current choice given the index.
 o setValue(Object)
Set the current choice.
 o setValue(String)
Set the current choice.

Variables

 o current
  public int current
The current choice. No choice is represented by -1.
See Also:
getIntegerValue, getStringValue, getValue, setValue, getChoiceCount

Constructors

 o ChoiceWidget
  public ChoiceWidget()
Default constructor.
 o ChoiceWidget
  public ChoiceWidget(int nchoices,
                      String choices[])
Constructor for constructing a choiceWidget with a given number of choices.

Methods

 o getProperties
  public void getProperties(PropertyList list)
Get the properties of this widget.
Overrides:
getProperties in class Widget
 o getChildProperties
  public void getChildProperties(PropertyList list)
Get the properties for the children of this widget.
Overrides:
getChildProperties in class Widget
 o setProperties
  public void setProperties(PropertyList list)
Set the properties of this widget.
Overrides:
setProperties in class Widget
 o getChoiceCount
  public int getChoiceCount()
Get the number of choices.
See Also:
current
 o getValueIndex
  public int getValueIndex(String value)
Get index of a value.
See Also:
getStringValue
 o getIntegerValue
  public int getIntegerValue()
Get the current choice. This will return -1 if no choice is selected.
See Also:
current
 o getStringValue
  public String getStringValue()
Get the current choice.
See Also:
current, getValueIndex
 o getValue
  public Object getValue()
Get the current choice.
Overrides:
getValue in class Widget
See Also:
current, getText
 o setValue
  public void setValue(Object value)
Set the current choice.
Overrides:
setValue in class Widget
See Also:
current
 o setValue
  public void setValue(String value)
Set the current choice.
See Also:
current, setText
 o setValue
  public void setValue(int value)
Set the current choice given the index.
See Also:
current
 o getText
  public String getText()
Get the current choice.
Overrides:
getText in class Widget
See Also:
getStringValue
 o setText
  public void setText(String value)
Set the choice.
Overrides:
setText in class Widget
See Also:
setValue
 o getChoices
  public String[] getChoices()
Get the choices, these are the strings that represent the choices on screen.
 o getChoice
  public String getChoice(int pos)
Get the choice at the given position.
 o 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.
 o getName
  public String getName(int pos)
Get the name at the given position.
 o addChoice
  public void addChoice(String newChoice)
Append a choice to the list of possible choices. of this choice widget.
 o insertChoiceAt
  public void insertChoiceAt(String newChoice,
                             int index)
Insert a choice before the choice at the position. with the given index.
 o removeChoice
  public void removeChoice(String oldChoice)
Remove the first choice with the given name.
 o removeChoiceAt
  public void removeChoiceAt(int index)
Remove the choice with the given index.
 o removeAllChoices
  public void removeAllChoices()
Remove all the choices from this widget.
 o 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.
 o setChoices
  public void setChoices(Vector choices)
Set the choices by specifying a Vector containing the strings that represent the choices.
 o setChoices
  public void setChoices(String choices[])
Set the choices by specifying the strings that appear on screen.
 o 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.
 o paramString
  public void paramString(StringBuffer buf)
Debugging.
Overrides:
paramString in class Widget

All Packages  Class Hierarchy  This Package  Previous  Next  Index