Packageardisia.components.gauges
Classpublic class LinearGaugeBase
InheritanceLinearGaugeBase Inheritance GaugeBase Inheritance spark.components.supportClasses.SliderBase
Subclasses HLinearGauge, VLinearGauge

Base class for the Linear gauges.

Design Notes

Extending the Flex SDK Slider requires a large amount of code hacks to get the added functionality to work properly. Consider recoding the sliders from scratch.



Public Properties
 PropertyDefined By
 Inheritededitable : Boolean
Whether the value can be changed via user interaction.
GaugeBase
 InheritedlabelDefaultPrecision : Number
Default precision for the number formatter if a labelsFormatFunction is not provided.
GaugeBase
 InheritedlabelsFormatFunction : Function
The callback function used to format the labels.
GaugeBase
 InheritedmajorTickCount : int
The number of major ticks to display.
GaugeBase
  maximumRangeValue : Number
The maximum allowed numerical difference between the values of each thumb.
LinearGaugeBase
  minimumRangeValue : Number
The minimum allowed numerical difference between the values of each thumb.
LinearGaugeBase
 InheritedminorTickCount : int
The number of minor ticks to display between major ticks.
GaugeBase
  showRange : Boolean
Display a draggable button between the thumbs.
LinearGaugeBase
  showThumbLabels : Boolean
True to display labels along with the thumbs.
LinearGaugeBase
 InheritedshowTickLabels : Boolean
True to display labels along with the major ticks.
GaugeBase
 InheritedshowTicks : Boolean
True to display ticks.
GaugeBase
  useMultiThumbs : Boolean
True to display 2 thumbs.
LinearGaugeBase
  values : ArrayCollection
Array of thumb values, sorted numerically from the smaller to the larger value.
LinearGaugeBase
Public Methods
 MethodDefined By
 Inherited
dispose():void
Remove the component from the display list and prepare the component for garbage collection.
GaugeBase
  
setValues(newValue:Number, multiNewValue:Number):void
Update the "values" property and updates bindings without invalidating properties.
LinearGaugeBase
Protected Methods
 MethodDefined By
  
[override]
LinearGaugeBase
  
[override]
LinearGaugeBase
  
eventSwallower(event:Event):void
Swallows an event and immediately stops propagation.
LinearGaugeBase
  
flipThumbs():MouseEvent
If multiple thumbs are displayed, switches each thumb's position with one another.
LinearGaugeBase
 Inherited
formatLabelText(value:Number):Object
Format the value to a human readable String.
GaugeBase
  
multiThumbInstanceHandler(event:Event):void
Handles events on the multiThumb instance
LinearGaugeBase
  
rangeThumbInstanceHandler(event:Event):void
LinearGaugeBase
  
setValue(value:Number):void
[override]
LinearGaugeBase
  
Update the multi thumb skin parts.
LinearGaugeBase
  
Update the range thumb skin part.
LinearGaugeBase
  
Update the thumb labels skin parts.
LinearGaugeBase
 Inherited
Update the tick labels skin parts.
GaugeBase
  
validateRange(proposedValue:Number):Number
Ensures that the proposed value will not exceed min/max range bounds.
LinearGaugeBase
Events
 Event Summary Defined By
  Dispatched at the end of a range button drag.LinearGaugeBase
  Dispatched during range button dragging.LinearGaugeBase
  Dispatched at the beginning of range button drag.LinearGaugeBase
  Dispatched when the value(s) change.LinearGaugeBase
Styles
 Style Description Defined By
 InheritedType: Number CSS Inheritance: no
The number of pixels to offset the labels from the tick marks.
GaugeBase
 InheritedType: uint Format: Color CSS Inheritance: no
The color of the major ticks.
GaugeBase
 InheritedType: String CSS Inheritance: no
The shape of the major tick mark: line or circle.
GaugeBase
 InheritedType: Number CSS Inheritance: no
The length of the major tick.
GaugeBase
 InheritedType: Number CSS Inheritance: no
The thickness of major tick strokes or the radius of the circle.
GaugeBase
 InheritedType: uint Format: Color CSS Inheritance: no
The color of the minor ticks.
GaugeBase
 InheritedType: String CSS Inheritance: no
The shape of the minor tick mark: line or circle.
GaugeBase
 InheritedType: Number CSS Inheritance: no
The length of the minor tick.
GaugeBase
 InheritedType: Number CSS Inheritance: no
The thickness of minor tick strokes or the radius of the circle.
GaugeBase
  
thumbLabelOffset
Type: Number CSS Inheritance: no
Offset applied to the thumb labels.
LinearGaugeBase
 InheritedType: Number CSS Inheritance: no
The number of pixels to offset the tick marks from the track.
GaugeBase
Skin Parts

This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.


 Skin Part Description Defined By
 Inherited
labelsFactoryPart:mx.core.IFactory
Required: false Part Type: Dynamic
Factory that creates the labels that are displayed along with the major ticks. Used by both the linear and radial gauges.

The IFactory must return an object of type Label
GaugeBase
  
multiThumbFactoryPart:mx.core.IFactory
Required: false Part Type: Dynamic
Factory that creates the optional second, multi thumb.

The IFactory must return an object of type ButtonBase
LinearGaugeBase
  
rangeThumbFactoryPart:mx.core.IFactory
Required: false Part Type: Dynamic
Factory that creates the optional, draggable, button that fills the range between the thumb buttons. Only exists if there are multiple thumbs and if the "showRange" property is true.

The IFactory must return an object of type ButtonBase
LinearGaugeBase
  
thumbLabelsFactoryPart:mx.core.IFactory
Required: false Part Type: Dynamic
Factory that creates the labels that are displayed along with the thumbs.

The IFactory must return an object of type Label
LinearGaugeBase
Skin States

To skin the component, implement a skin that defines the following states. Although you must implement all skin states, a skin state can be empty. An empty skin state specifies no changes to the default skin state.


 Skin State Description Defined By
 Inherited State used when the control is disabled, but the component should not be displayed as disabled. Useful to statically present information via a slider. For example: a thermometer to show fundraising totals. GaugeBase
Property Detail
maximumRangeValueproperty
maximumRangeValue:Number

The maximum allowed numerical difference between the values of each thumb. In other words, the maximum allowable difference between values[0] and values[1].

Only relevant if the "useMultiThumbs" property is true.

The default value is Number.MAX_VALUE.


Implementation
    public function get maximumRangeValue():Number
    public function set maximumRangeValue(value:Number):void
minimumRangeValueproperty 
minimumRangeValue:Number

The minimum allowed numerical difference between the values of each thumb. In other words, the minimum allowable difference between values[0] and values[1].

Only relevant if the "useMultiThumbs" property is true.

Express as a positive number.

The default value is 0.


Implementation
    public function get minimumRangeValue():Number
    public function set minimumRangeValue(value:Number):void
showRangeproperty 
showRange:Boolean

Display a draggable button between the thumbs. Only relevant if the "useMultiThumbs" property is true.

The default value is true.


Implementation
    public function get showRange():Boolean
    public function set showRange(value:Boolean):void
showThumbLabelsproperty 
showThumbLabels:Boolean

True to display labels along with the thumbs.

The default value is true.


Implementation
    public function get showThumbLabels():Boolean
    public function set showThumbLabels(value:Boolean):void
useMultiThumbsproperty 
useMultiThumbs:Boolean

True to display 2 thumbs. False to create only 1 thumb like a vanilla slider.

Must be true to display the range button.

The default value is false.


Implementation
    public function get useMultiThumbs():Boolean
    public function set useMultiThumbs(value:Boolean):void
valuesproperty 
values:ArrayCollection

Array of thumb values, sorted numerically from the smaller to the larger value.

If the "useMultiThumbs" property is true, this array will be of length 2, otherwise it will be of length 1 by simply returning an array of length 1, the "value".

The default value is ArrayCollection.

This property can be used as the source for data binding.


Implementation
    public function get values():ArrayCollection
    public function set values(value:ArrayCollection):void
Method Detail
commitProperties()method
override protected function commitProperties():void

createChildren()method 
override protected function createChildren():void

eventSwallower()method 
protected function eventSwallower(event:Event):void

Swallows an event and immediately stops propagation.

Parameters

event:Event — the Event to swallow

flipThumbs()method 
protected function flipThumbs():MouseEvent

If multiple thumbs are displayed, switches each thumb's position with one another.

Necessary to extend the Flex SDK SliderBase instead of rolling slider code from scratch.

Returns
MouseEvent — a mouse event
multiThumbInstanceHandler()method 
protected function multiThumbInstanceHandler(event:Event):void

Handles events on the multiThumb instance

Parameters

event:Event — the Event that triggered the handler

rangeThumbInstanceHandler()method 
protected function rangeThumbInstanceHandler(event:Event):void

Parameters

event:Event

setValue()method 
override protected function setValue(value:Number):void

Parameters

value:Number

setValues()method 
public function setValues(newValue:Number, multiNewValue:Number):void

Update the "values" property and updates bindings without invalidating properties.

Ranges are not validated here.

Parameters

newValue:Number — the Number to set the "value" property to
 
multiNewValue:Number — the value to set the "multiThumbValue" value to

updateMultiThumbPart()method 
protected function updateMultiThumbPart():void

Update the multi thumb skin parts.

updateRangeThumbFactoryPart()method 
protected function updateRangeThumbFactoryPart():void

Update the range thumb skin part.

updateThumbLabels()method 
protected function updateThumbLabels():void

Update the thumb labels skin parts.

validateRange()method 
protected function validateRange(proposedValue:Number):Number

Ensures that the proposed value will not exceed min/max range bounds.

Changes the value as necessary.

Parameters

proposedValue:Number — number to verify

Returns
Number — adjusted value
Event Detail
rangeDragEnd Event
Event Object Type: ardisia.components.gauges.events.GaugeEvent
GaugeEvent.type property = ardisia.components.gauges.events.GaugeEvent

Dispatched at the end of a range button drag.

rangeDragging Event  
Event Object Type: ardisia.components.gauges.events.GaugeEvent
GaugeEvent.type property = ardisia.components.gauges.events.GaugeEvent

Dispatched during range button dragging.

rangeDragStart Event  
Event Object Type: ardisia.components.gauges.events.GaugeEvent
GaugeEvent.type property = ardisia.components.gauges.events.GaugeEvent

Dispatched at the beginning of range button drag.

valuesCommit Event  
Event Object Type: ardisia.components.gauges.events.GaugeEvent
GaugeEvent.type property = ardisia.components.gauges.events.GaugeEvent

Dispatched when the value(s) change.