class org.aswing.JStepper extends Component
Interfaces | |||
![]() | EditableComponent |
|
A component that combine a input text and two arrow button to let user change a number value step by step.
@author paling
![]() | Show Events | Hide Events
|
Class Fields
static function DEFAULT_VALUE_PARSER(:String): Int
The default parser parse a int value from the string, if NaN, 0 will be returned.
static function DEFAULT_VALUE_TRANSLATOR(:Int): String
The default translator translate a int value to a integer string representation.
Instance Fields
function new(?columns:Int = 3): Void
Creates a stepper with the specified columns input text.
Defalut model is a instance of DefaultBoundedRangeModel
@see org.aswing.DefaultBoundedRangeModel
columns | (optional)the number of columns to use to calculate the input text preferred width |
function addActionListener(listener:Dynamic ->Void?priority:Int = 0, ?useWeakReference:Bool = false): Void
Adds a action listener to this stepper. Adjuster fire a AWEvent.ACT
event when user finished a adjusting.
* @param listener the listener
* @param priority the priority
* @param useWeakReference Determines whether the reference to the listener is strong or weak.
* @see org.aswing.event.AWEvent#ACT
function addStateListener(listener:Dynamic ->Void?priority:Int = 0, ?useWeakReference:Bool = false): Void
Adds a listener to listen the stepper's state change event. @see org.aswing.event.InteractiveEvent#STATE_CHANGED
listener | the listener |
priority | the priority |
useWeakReference | Determines whether the reference to the listener is strong or weak. |
Returns the "extent" -- the range of values "covered" by the knob. @see #setExtent() @see BoundedRangeModel#getExtent()
returns | an int representing the extent |
function getMaximum(): Int
Returns the maximum value supported by the slider. @see #setMaximum() @see BoundedRangeModel#getMaximum()
returns | the maximum value supported by the slider |
function getMinimum(): Int
Returns the minimum value supported by the slider (usually zero). @see #setMinimum() @see BoundedRangeModel#getMinimum()
returns | the minimum value supported by the slider |
Returns the slider's value. @see #setValue() @see BoundedRangeModel#getValue()
returns | the slider's value property. |
function getValueIsAdjusting(): Bool
True if the slider knob is being dragged.
returns | the value of the model's valueIsAdjusting property |
function removeActionListener(listener:Dynamic ->Void): Void
Removes a action listener. @see org.aswing.event.AWEvent#ACT
listener | the listener to be removed. |
function removeStateListener(listener:Dynamic ->Void): Void
Removes a state listener. @see org.aswing.event.InteractiveEvent#STATE_CHANGED
listener | the listener to be removed. |
function setExtent(extent:Int): Void
Sets the size of the range "covered" by the knob. Most look and feel implementations will change the value by this amount if the user clicks on either side of the knob.
@see #getExtent() @see BoundedRangeModel#setExtent()
function setMaximum(maximum:Int): Void
Sets the model's maximum property. @see #getMaximum() @see BoundedRangeModel#setMaximum()
maximum | the maximum to set. |
function setMinimum(minimum:Int): Void
Sets the model's minimum property. @see #getMinimum() @see BoundedRangeModel#setMinimum()
minimum | the minimum to set. |
function setValue(value:Int, ?programmatic:Bool = true): Void
Sets the slider's value. This method just forwards the value to the model. @see #getValue() @see BoundedRangeModel#setValue()
value | the value to set. |
function setValueIsAdjusting(b:Bool): Void
Sets the model's valueIsAdjusting property. Slider look and feel implementations should set this property to true when a knob drag begins, and to false when the drag ends. The slider model will not generate ChangeEvents while valueIsAdjusting is true. @see BoundedRangeModel#setValueIsAdjusting()
function setValues(newValue:Int, newExtent:Int, newMin:Int, newMax:Int): Void
Sets the four BoundedRangeModel properties after forcing the arguments to obey the usual constraints: "minimum le value le value+extent le maximum" ("le" means less or equals)
function valueParser(:String): Int
A function(String):int to parse the value from the string in the input text.
Generally, if you changed parser, you should change a right valueTranslator to suit it.
function valueTranslator(:Int): String
A function(int):String to translator the value to the string representation in the input text.
Generally, if you changed translator, you should change a right valueParser to suit it.