|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectUI.GEVAControl
UI.GEVAPropertyControl
UI.GEVAChoiceProperty
public class GEVAChoiceProperty
A name value control whose value is a drop down list. Supports special types for boolean values, group values, and enumerations. Boolean values always write true or false to the file, but can display using more suitable names. Alternative values are set in the params ("hi,bye" - if hi is selected, true is output, bye=false) Group values are enumerations that also show a named control group Enumerated values are set in params, interleaved with the control group ("name1,controlGroup1,name2,controlGroup2...") Enumerations are values that are written to the file as they appear in the params ("name1,name2...")
Field Summary | |
---|---|
static java.lang.String |
PT_BOOL
Constructor type. |
static java.lang.String |
PT_ENUM
Constructor type. |
static java.lang.String |
PT_GROUP
Constructor type. |
Fields inherited from class UI.GEVAPropertyControl |
---|
initial, params |
Fields inherited from class UI.GEVAControl |
---|
comment, dirtyListener, name, parent, title, type |
Constructor Summary | |
---|---|
GEVAChoiceProperty(GEVADirtyListener dirtyListener,
GEVAPropertyContainer parent,
java.lang.String type,
java.lang.String title,
java.lang.String name,
java.lang.String comment,
java.lang.String initial,
java.lang.String params)
Create a drop-down control |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
|
java.awt.Component |
getComponent(int index)
Abstract way for a container to know about its child's awt components. |
java.lang.String |
getText()
Get the value of teh control, using a text string |
boolean |
load(java.util.Properties properties)
A control should override this to get its properties. |
boolean |
save(java.util.Properties properties)
A control should override this to set its properties. |
void |
setEnabled(boolean enabled)
Make this control enabled or disabled. |
void |
setText(java.lang.String text)
Set the value of the control, using a text string |
boolean |
valid()
|
void |
validate()
Get this control to validate itself |
Methods inherited from class UI.GEVAPropertyControl |
---|
addInvalidReason, countComponents, getParam, getParam, getParamBoolean, getParamBoolean, getParamDouble, getParamDouble, getParamEqual, getParamInt, getParamInt, resetInvalidReason, setVisible, setVisibleControlGroup |
Methods inherited from class UI.GEVAControl |
---|
addActionListener, fireActionEvent, getComment, getComponent, getName, getParent, getTitle, getType, isType, removeActionListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PT_BOOL
public static final java.lang.String PT_GROUP
public static final java.lang.String PT_ENUM
Constructor Detail |
---|
public GEVAChoiceProperty(GEVADirtyListener dirtyListener, GEVAPropertyContainer parent, java.lang.String type, java.lang.String title, java.lang.String name, java.lang.String comment, java.lang.String initial, java.lang.String params)
dirtyListener
- GUI that listens to dirty eventsparent
- Container for this controltype
- Can be PT_BOOL, PT_GROUP, or PT_ENUM. If PT_BOOL, saved
value will be either true or false (regardless of params value (see
params)). If PT_GROUP, params must include a GEVAControlGroup name after
each entry. This named group will be shown when the entry is selected,
else hidden. PT_GROUP also saves the value as it appears in params
If this is PT_ENUM, the drop-down displays and saves the values
exactly as they appear in paramstitle
- The title to show in the GUI of this controlname
- The name used when saving this to the properties filecomment
- A tooltipinitial
- The initially selected entryparams
- Comma separated list of entries to add to the drop-down.
If type is PT_BOOL params is a comma separated pair of names that relate
to a true/false output. If not specified, it default to "true,false". If
given, only the first two entries are used. e.g. "a,b,c" will show the
drop-donw with just entries a and b. If fewer than two entries is given,
the remaining are padded with the "true,false" values. e.g. "a" shows as
a and false. When loading or saving, the values are output/input as
true and false regardless of what they appear as to the user. e.g.
"yes, no" shows yes and no to the user, but saves/loads as true and
false respectively. If type is PT_GROUP params is a a comma separated
list of "entry,group" pairs (e.g. "fit,fitopts,fat,fatopts"), where
'entry' is the text that is displayed in the drop-down, and 'group' is
the name of a group of controls. The named group must be added to the
book container that this control is a [grand-]child of (see
GEVABookContainer.addControlGroup). When 'entry' is selected from the
drop-down, its related 'group' is shown and all others (in this drop-
down) are hidden. When loading/saving, the entry selected, as it appears,
is used for the input/output value. If type is PT_ENUM params is a
comma separated list of entries that are displayed and loaded/saved as
isMethod Detail |
---|
public void setEnabled(boolean enabled)
GEVAControl
setEnabled
in class GEVAControl
enabled
- true to enabled, false to disablepublic boolean load(java.util.Properties properties)
GEVAControl
load
in class GEVAControl
properties
- The properties of a loaded properties filepublic boolean save(java.util.Properties properties)
GEVAControl
save
in class GEVAControl
properties
- The properties of a loaded properties filepublic java.awt.Component getComponent(int index)
GEVAControl
getComponent
in class GEVAPropertyControl
index
- The index of the component to get
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
public boolean valid()
public void validate()
GEVAControl
validate
in class GEVAControl
public java.lang.String getText()
GEVAControl
getText
in class GEVAControl
public void setText(java.lang.String text)
GEVAControl
setText
in class GEVAControl
text
- The value to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |