|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectUI.GEVAControl
UI.GEVAPropertyControl
UI.GEVANumberProperty
public class GEVANumberProperty
A name value control that handles numeric inputs. Type can be PT_INT or PT_FLOAT and validates that the value input can be converted to an int or double respectively. Also supports params of "increment,minimum,maximum", where fields can be left blank if not needed e.g. (",,10"). Default for unspecified fields are, increment: 1 for int, 0.1 for float, minimum: -max value for type, maximum: +max value for type.
| Field Summary | |
|---|---|
static java.lang.String |
PT_FLOAT
Constructor type. |
static java.lang.String |
PT_INT
Constructor type. |
| Fields inherited from class UI.GEVAPropertyControl |
|---|
initial, params |
| Fields inherited from class UI.GEVAControl |
|---|
comment, dirtyListener, name, parent, title, type |
| Constructor Summary | |
|---|---|
GEVANumberProperty(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 numeric input with spinner controls for mouse entry |
|
| Method Summary | |
|---|---|
void |
changedUpdate(javax.swing.event.DocumentEvent 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 |
void |
insertUpdate(javax.swing.event.DocumentEvent event)
|
boolean |
load(java.util.Properties properties)
A control should override this to get its properties. |
void |
removeUpdate(javax.swing.event.DocumentEvent event)
|
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 |
void |
stateChanged(javax.swing.event.ChangeEvent event)
|
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 java.lang.String PT_INT
public static java.lang.String PT_FLOAT
| Constructor Detail |
|---|
public GEVANumberProperty(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_INT or PT_FLOAT. Used when validating the control,
it is parsed to the specified typetitle - The title to show in the GUI of this controlname - The name used when saving this to the properties filecomment - A tooltipinitial - The initial valueparams - Range and step amounts in the format "step,minimum,maximum".
If minimum/maximum are not specified, the min/max of the type are used.
If step is not speicified +1 is used for int and +0.1 is used for float.
When the control's spinners are used, the number increments by 'step'
amount and will not be allowed to go outside the range [minimum..maximum]
inclusive. If the user types a value that is outside the minimum/maximum
range, an error message is displayed| Method Detail |
|---|
public void setEnabled(boolean enabled)
GEVAControl
setEnabled in class GEVAControlenabled - true to enabled, false to disablepublic boolean load(java.util.Properties properties)
GEVAControl
load in class GEVAControlproperties - The properties of a loaded properties filepublic boolean save(java.util.Properties properties)
GEVAControl
save in class GEVAControlproperties - The properties of a loaded properties filepublic java.awt.Component getComponent(int index)
GEVAControl
getComponent in class GEVAPropertyControlindex - The index of the component to get
public void stateChanged(javax.swing.event.ChangeEvent event)
stateChanged in interface javax.swing.event.ChangeListenerpublic void insertUpdate(javax.swing.event.DocumentEvent event)
insertUpdate in interface javax.swing.event.DocumentListenerpublic void removeUpdate(javax.swing.event.DocumentEvent event)
removeUpdate in interface javax.swing.event.DocumentListenerpublic void changedUpdate(javax.swing.event.DocumentEvent event)
changedUpdate in interface javax.swing.event.DocumentListenerpublic boolean valid()
public void validate()
GEVAControl
validate in class GEVAControlpublic java.lang.String getText()
GEVAControl
getText in class GEVAControlpublic void setText(java.lang.String text)
GEVAControl
setText in class GEVAControltext - The value to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||