FvInputComponent Use a JSlider as input component.
Example using classic instanciation
var input : FvSliderInput = new FvSliderInput( true ); // rounded bounded range enabled. input.setMinimum( 1900 ); input.setMaximum( 2100 ); input.setValue( ( new Date() ).getFullYear() ); FvInputComponentDialog.show( input, "Choose your year", this, _onInputResult );
Example using static create() instanciation
var slider : JSlider = new JSlider( JSlider.HORIZONTAL ); slider.setMajorTickSpacing( 20 ); slider.setMinorTickSpacing( 1 ); var input : FvSliderInput = FvSliderInput.create( slider ); input.setMinimum( 1900 ); input.setMaximum( 2100 ); input.setValue( ( new Date() ).getFullYear() ); FvInputComponentDialog.show( input, "Choose your year", this, _onInputResult );
public function FvSliderInput(orientation:Number, rounded:Boolean)Constructor.
Constructs a default horizontal JSlider with :
orientation | the slider's orientation to either JSlider.VERTICAL or JSlider.HORIZONTAL. |
rounded | If true use a DefaultIntegerBoundedRangeModel
as slider model.Otherwise use the default DefaultBoundedRangeModel one. |
static public TRICK_INTERSPACE:Numberstatic public function create(slider:JSlider):FvSliderInput
Creates and returns a FvSliderInput with passed-in slider
component.
public function setModel(model:BoundedRangeModel):VoidSets the model that handles the slider's four fundamental properties: minimum, maximum, value, extent.
public function setOrientation(orientation:Number):VoidSet the slider's orientation.
orientation | the orientation to either JSlider.VERTICAL or JSlider.HORIZONTAL |
public function getOrientation():NumberReturn this slider's orientation.
JSlider.VERTICAL or JSlider.HORIZONTAL
public function getContainer():ComponentReturns JSlider component to add into a FvInputComponentDialog dialog.
getContainer() in fvaswing.components.input.FvInputComponent