Packageardisia.components.rotaryField
Classpublic class RotaryField
InheritanceRotaryField Inheritance spark.components.supportClasses.SkinnableComponent
Implements mx.managers.IFocusManagerComponent

Field used to select an angle from 0 to 360 degrees. Use the "angleOffset" property to change what direction 0 degrees points towards on the ellipse.

Handles focus, keyboard, and mouse interaction.

Listen for the "change" event to detect changes in the "value" property. "value" is also a bindable property.

.

View the technical documentation on the Ardisia Labs website for more information.



Public Properties
 PropertyDefined By
  angleOffset : Number = -90
The offset for where 0 degrees appears on the wheel.
RotaryField
  isWheelOpen : Boolean
[read-only] True if the wheel is currently displayed.
RotaryField
  snapInterval : Number
The snapInterval for the "value" property.
RotaryField
  value : Number
The commited numerical value.
RotaryField
  wheelInstance : SkinnableContainer
Wheel instance.
RotaryField
Public Methods
 MethodDefined By
  
commitValue(proposedValue:Number, dispatchChange:Boolean = false):void
Commits the value and dispatches the "change" event.
RotaryField
Protected Methods
 MethodDefined By
  
closeWheel():void
Hides the wheel and dispatches the "close" event.
RotaryField
  
eventHandler(event:Event):void
Handles events for the control.
RotaryField
  
getMouseAngle():Number
Based on the current mouse position, gets the angle relative to the center of the wheel.
RotaryField
  
getNearestValue(value:Number):Number
Returns the angle to the closest snap interval and bounded to the range 0 (less than or equal to) value (less than or equal to) 360.
RotaryField
  
openButtonPartHandler(event:Event):void
Handles events on the openButtonPart.
RotaryField
  
openWheel():void
Creates and displays the wheel and dispatches the "open" event.
RotaryField
  
textInputPartHandler(event:Event):void
Handles events on the textInputPart.
RotaryField
  
Updates the TextInput skin part.
RotaryField
  
updateWheelThumb(angle:Number):void
Updates the wheel thumb position.
RotaryField
  
wheelFactoryPartHandler(event:Event):void
Handles events on the wheelFactoryPart.
RotaryField
Events
 Event Summary Defined By
  Dispatched when the "value" property changes due to user interaction.RotaryField
  Dispatched when the rotary wheel is closed (hidden).RotaryField
  Dispatched when the rotary wheel is opened (displayed).RotaryField
  Dispatched when the "value" property changes.RotaryField
Styles
 Style Description Defined By
  
paddingBottom
Type: Number Format: Length CSS Inheritance: no
Bottom padding for the text field. The default value is 3.
RotaryField
  
paddingLeft
Type: Number Format: Length CSS Inheritance: no
Left padding for the text field. The default value is 3.
RotaryField
  
paddingRight
Type: Number Format: Length CSS Inheritance: no
Right padding for the text field. The default value is 3.
RotaryField
  
paddingTop
Type: Number Format: Length CSS Inheritance: no
Top padding for the text field. The default value is 5.
RotaryField
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
  
openButtonPart:spark.components.supportClasses.ButtonBase
Required: true Part Type: Static
The button that pops up the wheel.
RotaryField
  
textInputPart:spark.components.TextInput
Required: true Part Type: Static
TextInput that allows the user to directly change the value via keyboard interaction.
RotaryField
  
wheelFactoryPart:mx.core.IFactory
Required: true Part Type: Static
The rotary wheel factory.
RotaryField
  
wheelThumbFactoryPart:mx.core.IFactory
Required: true Part Type: Dynamic
The factory for the thumb of the rotary wheel used to select an angle.

The IFactory must return an object of type IVisualElement
RotaryField
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
  
disabled
RotaryField
  
normal
RotaryField
  
open
Skin state when the rotary wheel is visible. RotaryField
Property Detail
angleOffsetproperty
public var angleOffset:Number = -90

The offset for where 0 degrees appears on the wheel.

The flash based coordinate system has 0 degrees at due east. Most people think of north as 0 degrees. This is why the default angleOffset value is -90.

Positive increases in angle move the angle in a clockwise direction.

The default value is -90.

isWheelOpenproperty 
isWheelOpen:Boolean  [read-only]

True if the wheel is currently displayed.

The default value is false.


Implementation
    public function get isWheelOpen():Boolean
snapIntervalproperty 
snapInterval:Number

The snapInterval for the "value" property.

The default value is 1.


Implementation
    public function get snapInterval():Number
    public function set snapInterval(value:Number):void
valueproperty 
value:Number

The commited numerical value.

This property is bindable and bound to "valueCommit" events.

The default value is 0.

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


Implementation
    public function get value():Number
    public function set value(value:Number):void
wheelInstanceproperty 
public var wheelInstance:SkinnableContainer

Wheel instance.

Method Detail
closeWheel()method
protected function closeWheel():void

Hides the wheel and dispatches the "close" event.

commitValue()method 
public function commitValue(proposedValue:Number, dispatchChange:Boolean = false):void

Commits the value and dispatches the "change" event. Will bound the value to the minimum and maximum values and apply the snapInterval.

Parameters

proposedValue:Number — Number
 
dispatchChange:Boolean (default = false) — Boolean true to dispatch a "change" event to signify the update is due to user interaction

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

Handles events for the control.

Parameters

event:Event — the Event that triggered the handler

getMouseAngle()method 
protected function getMouseAngle():Number

Based on the current mouse position, gets the angle relative to the center of the wheel.

Returns
Number
getNearestValue()method 
protected function getNearestValue(value:Number):Number

Returns the angle to the closest snap interval and bounded to the range 0 (less than or equal to) value (less than or equal to) 360.

Parameters

value:Number — the Number to parse

Returns
Number — the parsed Number
openButtonPartHandler()method 
protected function openButtonPartHandler(event:Event):void

Handles events on the openButtonPart.

Parameters

event:Event — the Event that triggered the handler

openWheel()method 
protected function openWheel():void

Creates and displays the wheel and dispatches the "open" event.

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

Handles events on the textInputPart.

Parameters

event:Event — the Event that triggered the handler

updateTextInputPart()method 
protected function updateTextInputPart():void

Updates the TextInput skin part.

updateWheelThumb()method 
protected function updateWheelThumb(angle:Number):void

Updates the wheel thumb position.

Parameters

angle:Number — the angle in degrees at which to position the thumb

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

Handles events on the wheelFactoryPart.

Parameters

event:Event — the Event that triggered the handler

Event Detail
change Event
Event Object Type: ardisia.components.rotaryField.events.RotaryFieldEvent
RotaryFieldEvent.type property = ardisia.components.rotaryField.events.RotaryFieldEvent

Dispatched when the "value" property changes due to user interaction.

close Event  
Event Object Type: ardisia.components.rotaryField.events.RotaryFieldEvent
RotaryFieldEvent.type property = ardisia.components.rotaryField.events.RotaryFieldEvent

Dispatched when the rotary wheel is closed (hidden).

open Event  
Event Object Type: ardisia.components.rotaryField.events.RotaryFieldEvent
RotaryFieldEvent.type property = ardisia.components.rotaryField.events.RotaryFieldEvent

Dispatched when the rotary wheel is opened (displayed).

valueCommit Event  
Event Object Type: mx.events.FlexEvent
FlexEvent.type property = mx.events.FlexEvent

Dispatched when the "value" property changes.