BioLegato 0.7.3 Core API

org.biolegato.core.pcdmenu.widgets
Class ChoiceList

java.lang.Object
  extended by org.biolegato.core.pcdmenu.widgets.ListWidget
      extended by org.biolegato.core.pcdmenu.widgets.ChoiceList
All Implemented Interfaces:
Widget

public class ChoiceList
extends ListWidget

A wrapper class used to abstract choice lists within command windows.

Author:
Graham Alvare, Brian Fristensky

Field Summary
protected  javax.swing.JList choice_list
          The combobox contianing the data.
 
Fields inherited from class org.biolegato.core.pcdmenu.widgets.ListWidget
choices, label, value
 
Constructor Summary
ChoiceList(java.lang.String label, java.util.Map<java.lang.String,java.lang.String> choices, java.lang.String value)
          Creates a new instance of GDEComboBox (represents "choice_list" in GDE menu files).
 
Method Summary
 void close()
          Closes the open object
 java.awt.Component display()
          Displays the choice list
 java.lang.Object getNewDefault()
          This function is used to maintain user variable settings from window to window.
static java.lang.String getType()
          Returns the name of this type of variable.
 java.lang.Object getValue()
          Returns the value of the variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

choice_list

protected javax.swing.JList choice_list
The combobox contianing the data.

Constructor Detail

ChoiceList

public ChoiceList(java.lang.String label,
                  java.util.Map<java.lang.String,java.lang.String> choices,
                  java.lang.String value)
Creates a new instance of GDEComboBox (represents "choice_list" in GDE menu files).

Parameters:
data - the data to create the combobox with.
Method Detail

getType

public static java.lang.String getType()
Returns the name of this type of variable.

Returns:
the name of the variable type "choice_list".

getNewDefault

public java.lang.Object getNewDefault()
This function is used to maintain user variable settings from window to window. Each time a runwindow is closed, this function is called to ensure that the next time the user opens the runwindow, the value of this variable will default to the same value the user picked the last time the runwindow was open.

Returns:
the new default value for the variable

getValue

public java.lang.Object getValue()
Returns the value of the variable.

Returns:
the current value of the widget.

display

public java.awt.Component display()
Displays the choice list

Returns:
the choice list widget

close

public void close()
Closes the open object


BioLegato 0.7.3 Core API

Copyright © 2008-2010 University of Manitoba.