Class fvaswing.components.input.FvListInput

Implemented Interfaces

FvInputComponent

Description

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 );
 

See Also

Field Index

TRICK_INTERSPACE

Method Index

new FvListInput()
create(), getContainer(), getMaximum(), getMinimum(), getModel(), getOrientation(), getValue(), isValid(), setMaximum(), setMinimum(), setModel(), setOrientation(), setValue(), toString()

Constructor Detail

FvListInput

public function FvListInput(orientation:Number, rounded:Boolean)

Constructor.

Constructs a default horizontal JSlider with :

  • setMajorTickSpacing( 20 )
  • setMinorTickSpacing( 1 )
  • setSnapToTicks( true )
  • setPaintTrack( true )
  • setShowValueTip( true )

Parameters

orientationthe slider's orientation to either JSlider.VERTICAL or JSlider.HORIZONTAL.
roundedIf true use a DefaultIntegerBoundedRangeModel as slider model.
Otherwise use the default DefaultBoundedRangeModel one.

Field Detail

TRICK_INTERSPACE

static public TRICK_INTERSPACE:Number
gap value between 2 slider tricks. ( default is 10 )

Method Detail

create

static public function create(slider:JSlider):FvListInput

Creates and returns a FvSliderInput with passed-in slider component.

setModel

public function setModel(model:BoundedRangeModel):Void

Sets the model that handles the slider's four fundamental properties: minimum, maximum, value, extent.

Parameters

getModel

public function getModel():BoundedRangeModel

Returns slider data model.

setOrientation

public function setOrientation(orientation:Number):Void

Set the slider's orientation.

Parameters

orientationthe orientation to either JSlider.VERTICAL or JSlider.HORIZONTAL

getOrientation

public function getOrientation():Number

Return this slider's orientation.

Return

JSlider.VERTICAL or JSlider.HORIZONTAL

setMinimum

public function setMinimum(n:Number):Void

Sets the slider's minimum property.

Parameters

getMinimum

public function getMinimum():Number

Returns the minimum value supported by the slider.

setMaximum

public function setMaximum(n:Number):Void

Sets the slider's maximum property.

Parameters

getMaximum

public function getMaximum():Number

Returns the maximum value supported by the slider.

getContainer

public function getContainer():Component

Returns JSlider component to add into a FvInputComponentDialog dialog.

Specified By

getContainer() in fvaswing.components.input.FvInputComponent

setValue

public function setValue(n:Number):Void

Sets slider value.

getValue

public function getValue()

Returns textfield text.

Specified By

getValue() in fvaswing.components.input.FvInputComponent

isValid

public function isValid():Boolean

Returns true if input is valid.

Specified By

isValid() in fvaswing.components.input.FvInputComponent

toString

public function toString():String

Returns string representation.