![]() | [using it] | Interface Manipulation Package v4.0 (2008-06-25) | ![]() | ©copyright | ![]() |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
imp.gui.IComponent
imp.gui.NumberInput
public class NumberInput
Defines a numeric input.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.BaselineResizeBehavior |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Method Summary | |
---|---|
double |
getValue()
Gets the last input value. |
NumberInput |
next(boolean loop,
boolean increment)
Increments the value from one step and return this. |
void |
outputValue(double value)
Called when a value is output. |
void |
outputValue(String value)
Called when a value is output. |
NumberInput |
setMax(double max)
Sets the display max value, default is 1 and return this. |
NumberInput |
setMin(double min)
Sets the display min value, default is 0 and return this. |
NumberInput |
setSlider(boolean slider)
Sets the slider and return this. |
NumberInput |
setStep(double step)
Sets the display step value, default is 0 (no step value) and return this. |
NumberInput |
setValue(double value)
Sets the default value and return this. |
Methods inherited from class imp.gui.IComponent |
---|
getBgcolor, getColor, getTextFont, getTitle, getTooltip, grab, refresh, setBgcolor, setColor, setHeight, setTextFont, setTitle, setTooltip, setWidth |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public double getValue()
public NumberInput next(boolean loop, boolean increment)
loop
- [optional, default is true] If true: when a bound is attained jump to the other bound, if false: when a bound is attained stop.increment
- [optional, default is true] If true: increment the value from one step, if false: decrement the value from one step.public void outputValue(double value)
value
- The output value.public void outputValue(String value)
value
- The output value as string.public NumberInput setMax(double max)
public NumberInput setMin(double min)
public NumberInput setSlider(boolean slider)
slider
- If true a slider allows to adjust the value (default).public NumberInput setStep(double step)
public NumberInput setValue(double value)
value
- The default value.