Package | ardisia.components.gauges |
Class | public class LinearGaugeBase |
Inheritance | LinearGaugeBase GaugeBase spark.components.supportClasses.SliderBase |
Subclasses | HLinearGauge, VLinearGauge |
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.
Property | Defined By | ||
---|---|---|---|
editable : Boolean
Whether the value can be changed via user interaction. | GaugeBase | ||
labelDefaultPrecision : Number
Default precision for the number formatter if a labelsFormatFunction
is not provided. | GaugeBase | ||
labelsFormatFunction : Function
The callback function used to format the labels. | GaugeBase | ||
majorTickCount : 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 | ||
minorTickCount : 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 | ||
showTickLabels : Boolean
True to display labels along with the major ticks. | GaugeBase | ||
showTicks : 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 |
Method | Defined By | ||
---|---|---|---|
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 |
Method | Defined By | ||
---|---|---|---|
commitProperties():void [override] | LinearGaugeBase | ||
createChildren():void [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 | ||
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 | ||
updateMultiThumbPart():void
Update the multi thumb skin parts. | LinearGaugeBase | ||
updateRangeThumbFactoryPart():void
Update the range thumb skin part. | LinearGaugeBase | ||
updateThumbLabels():void
Update the thumb labels skin parts. | LinearGaugeBase | ||
updateTickLabels():void
Update the tick labels skin parts. | GaugeBase | ||
validateRange(proposedValue:Number):Number
Ensures that the proposed value will not exceed min/max range bounds. | LinearGaugeBase |
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 |
Style | Description | Defined By | ||
---|---|---|---|---|
Type: Number CSS Inheritance: no The number of pixels to offset the labels from the tick marks. | GaugeBase | |||
Type: uint Format: Color CSS Inheritance: no The color of the major ticks. | GaugeBase | |||
Type: String CSS Inheritance: no The shape of the major tick mark: line or circle. | GaugeBase | |||
Type: Number CSS Inheritance: no The length of the major tick. | GaugeBase | |||
Type: Number CSS Inheritance: no The thickness of major tick strokes or the radius of the circle. | GaugeBase | |||
Type: uint Format: Color CSS Inheritance: no The color of the minor ticks. | GaugeBase | |||
Type: String CSS Inheritance: no The shape of the minor tick mark: line or circle. | GaugeBase | |||
Type: Number CSS Inheritance: no The length of the minor tick. | GaugeBase | |||
Type: 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 | ||
Type: Number CSS Inheritance: no The number of pixels to offset the tick marks from the track. | GaugeBase |
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 | ||
---|---|---|---|---|
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 |
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.
maximumRangeValue | property |
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
.
public function get maximumRangeValue():Number
public function set maximumRangeValue(value:Number):void
minimumRangeValue | property |
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
.
public function get minimumRangeValue():Number
public function set minimumRangeValue(value:Number):void
showRange | property |
showRange:Boolean
Display a draggable button between the thumbs. Only relevant if the "useMultiThumbs" property is true.
The default value is true
.
public function get showRange():Boolean
public function set showRange(value:Boolean):void
showThumbLabels | property |
showThumbLabels:Boolean
True to display labels along with the thumbs.
The default value is true
.
public function get showThumbLabels():Boolean
public function set showThumbLabels(value:Boolean):void
useMultiThumbs | property |
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
.
public function get useMultiThumbs():Boolean
public function set useMultiThumbs(value:Boolean):void
values | property |
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.
public function get values():ArrayCollection
public function set values(value:ArrayCollection):void
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.
ReturnsMouseEvent — 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
|
Number — adjusted value
|
rangeDragEnd | Event |
ardisia.components.gauges.events.GaugeEvent
ardisia.components.gauges.events.GaugeEvent
Dispatched at the end of a range button drag.
rangeDragging | Event |
ardisia.components.gauges.events.GaugeEvent
ardisia.components.gauges.events.GaugeEvent
Dispatched during range button dragging.
rangeDragStart | Event |
ardisia.components.gauges.events.GaugeEvent
ardisia.components.gauges.events.GaugeEvent
Dispatched at the beginning of range button drag.
valuesCommit | Event |
ardisia.components.gauges.events.GaugeEvent
ardisia.components.gauges.events.GaugeEvent
Dispatched when the value(s) change.