class org.aswing.JSlider extends Component
Interfaces | |||
![]() | Orientable |
|
A component that lets the user graphically select a value by sliding
a knob within a bounded interval. The slider can show both
major tick marks and minor tick marks between them. The number of
values between the tick marks is controlled with
this.majorTickSpacing
and this.minorTickSpacing
.
@author paling
![]() | Show Events | Hide Events
|
Class Fields
Instance Fields
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 BoundedRangeModel#extent
var isInverted:Bool
True to reverse the value-range shown for the slider and false to put the value range in the normal order.
var majorTickSpacing:Int
The major tick spacing.
The number that is passed-in represents the distance, measured in values, between each major tick mark.
If you have a slider with a range from 0 to 50 and the major tick spacing is set to 10, you will get major ticks next to the following values: 0, 10, 20, 30, 40, 50.
var minorTickSpacing:Int
The minor tick spacing.
The number that is passed-in represents the distance, measured in values, between each minor tick mark.
If you have a slider with a range from 0 to 50 and the minor tick spacing is set to 10, you will get minor ticks next to the following values: 0, 10, 20, 30, 40, 50.
var showValueTip:Bool
Whether to show a tip for the value when user slide the thumb.
This is related to the LAF, different LAF may have different display for this.
Default value is false. @see #valueTip
var snapToTicks:Bool
Specifying true makes the knob (and the data value it represents) resolve to the closest tick mark next to where the user positioned the knob.
The slider's value. It just forwards the value to the model. @see #setValue() @see BoundedRangeModel#setValue()
A Tip component to show the value tip.
By default there will be a JToolTip
instance created for this.
function new(?orientation:Int = 0, ?min:Int = 0, ?max:Int = 100, ?value:Int = 50): Void
Creates a slider with the specified orientation, value, extent, minimum, and maximum. The "extent" is the size of the viewable area. It is also known as the "visible amount".
orientation | the slider's orientation to either VERTICAL or HORIZONTAL. |
min | the min value |
max | the max value |
value | the selected value |
function addStateListener(listener:Dynamic ->Void?priority:Int = 0, ?useWeakReference:Bool = false): Void
Adds a listener to listen the slider'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. |
function removeStateListener(listener:Dynamic ->Void): Void
Removes a state listener. @see org.aswing.event.InteractiveEvent#STATE_CHANGED
listener | the listener to be removed. |