| Style |
Defined By |
|
AllowDeselect : boolean
|
ToggleButtonElement
|
When false, the ToggleButton cannot be de-selected by the user and the "selectedOver" and "selectedDown" states are not used,
as with the case for most tab or radio button type elements.
|
|
|
Alpha : Number
|
CanvasElement
|
Alpha value to use when rendering this component. Allowable values are between 0 and 1 with
0 being transparent and 1 being opaque. This causes the element to perform composite rendering
when a value between 1 and 0 is used.
|
|
|
BackgroundFill : FillBase
|
CanvasElement
|
Fill to use when filling the background. May be any FillBase subclass instance,
"color" string, or null for transparent.
|
|
|
BackgroundShape : ShapeBase
|
CanvasElement
|
Shape to be used when rendering the elements background. May be any ShapeBase subclass instance.
|
|
|
BorderColor : String
|
CanvasElement
|
Hex color value to be used when drawing the border. Format like "#FF0000" (red)
|
|
|
BorderThickness : Number
|
CanvasElement
|
Thickness in pixels to be used when drawing the border.
|
|
|
BorderType : String
|
CanvasElement
|
Determines the border type the CanvasElement should render. Allowable values are
"solid", "inset", "outset" or "none" / null. Note that borders are internal and drawn on the inside
of the elements bounding area.
|
|
|
Bottom : Number
|
CanvasElement
|
The distance the element should be positioned from the lower bounds of the parent container.
This only works if the element is a child of an AnchorContainer.
|
|
|
ClipContent : boolean
|
CanvasElement
|
Determines if out of bounds rendering is allowed. If true the element will clip all rendering
and children's rendering to the elements bounding box. This style is inheritable for container elements.
|
|
|
CompositeLayer : boolean
|
CanvasElement
|
When true, this element renders itself and all children to a single layer and is treated
by its parent as a single element when rendering. This is necessary and automatically enabled
for styles like alpha where the component and all its children must be pre-rendered, and then
re-rendered with the appropriate effect.
This is very expensive but can also be very beneficial when used appropriately.
For example, if you have an application with a scrolling or constantly changing background
thereby always causing a full screen redraw, its beneficial to make the layer on top of the
background a composite layer. This effectively buffers the layer. Only the delta changes
will be drawn to the composite. Otherwise the entire display chain would have to be re-drawn
when the background moves. This is memory intensive as it effectively duplicates the rendering
area. Composite elements/children changing will update their region of their composite parent,
then that region of the composite parent needs to be copied up to the grandparent,
resulting in an additional buffer copy.
|
|
|
Cursor : CursorDefinition
|
CanvasElement
|
Specifies the cursor to be displayed when the mouse is over the element. A custom CursorDefinition
may be used or a browser type String ("text", "none", etc) may be used.
|
|
|
DisabledSkinClass : CanvasElement
|
ButtonElement
|
The CanvasElement constructor to be used for the button skin when the button is in the "disabled" state.
This will override SkinClass when equal or higher priority than SkinClass.
|
|
|
DisabledSkinStyle : StyleDefinition
|
ButtonElement
|
The StyleDefinition or [StyleDefinition] array to apply to the "disabled" state skin element.
|
|
|
DisabledTextColor : String
|
ButtonElement
|
Hex color value to be used for the button label when the button is in the "disabled" state. Format like "#FF0000" (red).
This will override TextColor when equal or higher priority than TextColor.
|
|
|
DownSkinClass : CanvasElement
|
ButtonElement
|
The CanvasElement constructor to be used for the button skin when the button is in the "down" state.
This will override SkinClass when equal or higher priority than SkinClass.
|
|
|
DownSkinStyle : StyleDefinition
|
ButtonElement
|
The StyleDefinition or [StyleDefinition] array to apply to the "down" state skin element.
|
|
|
DownTextColor : String
|
ButtonElement
|
Hex color value to be used for the button label when the button is in the "down" state. Format like "#FF0000" (red).
This will override TextColor when equal or higher priority than TextColor.
|
|
|
Draggable : boolean
|
CanvasElement
|
When true allows the element to be dragged by the user. This does not work for containers
that do not allow absolute positioning such as a ListContainer.
|
|
|
Enabled : boolean
|
CanvasElement
|
When false disables user interaction with the element.
|
|
|
FocusColor : String
|
[Inheritable] CanvasElement
|
Hex color value to be used when drawing the elements focus indicator. Format "#FF0000" (Red).
The focus indicator is only rendered when the element gains focus due to a tab stop.
|
|
|
FocusThickness : Number
|
[Inheritable] CanvasElement
|
Size in pixels that the focus ring should be rendered. Note that the focus ring is rendered
outside the elements bounding area.
|
|
|
Height : Number
|
CanvasElement
|
The Height the element should be rendered relative to its parent container. This only
works if the element is a child of a Container element.
|
|
|
HorizontalCenter : Number
|
CanvasElement
|
The distance in pixels from the horizontal center of the parent the element should be positioned.
Negative numbers indicate left of center, positive right of center.
This only works if the element is a child of an AnchorContainer.
|
|
|
IncludeInLayout : boolean
|
CanvasElement
|
When false, the element is no longer considered in the parent container's layout.
Typically this is used in conjunction with Visible, however sometimes you may want to
hide an element, but still have it consume container space.
|
|
|
IncludeInMeasure : boolean
|
CanvasElement
|
When false, the element is no longer considered in the parent container's measurement.
This is useful if you do not want containers to respect this child's measured size and/or
do not care if content is clipped, such as when using MinSize, MaxSize, and percent sizing together.
This also prevents the element's _doMeasure() function from running and forces a 0x0 measured size.
However, this will not prevent the "measurecomplete" event after this element finishes its measure phase.
|
|
|
LabelGap : Number
|
RadioButtonElement
|
Determines distance in pixels the label should be placed from the skin.
|
|
|
LabelPlacement : String
|
RadioButtonElement
|
Determines if the label should be placed to the left or right of the skin.
Allowable values are "left" or "right".
|
|
|
Left : Number
|
CanvasElement
|
The distance the element should be positioned from the left most bounds of the parent container.
This only works if the element is a child of an AnchorContainer.
|
|
|
MaxHeight : Number
|
CanvasElement
|
The maximum height in pixels the element should consume. This only
works if the element is a child of a Container element.
|
|
|
MaxWidth : Number
|
CanvasElement
|
The maximum width in pixels the element should consume. This only
works if the element is a child of a Container element.
|
|
|
MinHeight : Number
|
CanvasElement
|
The minimum height in pixels the element should consume. This only
works if the element is a child of a Container element.
|
|
|
MinWidth : Number
|
CanvasElement
|
The minimum width in pixels the element should consume. This only
works if the element is a child of a Container element.
|
|
|
MouseEnabled : boolean
|
CanvasElement
|
When false disables mouse events for the element.
|
|
|
OverSkinClass : CanvasElement
|
ButtonElement
|
The CanvasElement constructor to be used for the button skin when the button is in the "over" state.
This will override SkinClass when equal or higher priority than SkinClass.
|
|
|
OverSkinStyle : StyleDefinition
|
ButtonElement
|
The StyleDefinition or [StyleDefinition] array to apply to the "over" state skin element.
|
|
|
OverTextColor : String
|
ButtonElement
|
Hex color value to be used for the button label when the button is in the "over" state. Format like "#FF0000" (red).
This will override TextColor when equal or higher priority than TextColor.
|
|
|
Padding : Number
|
CanvasElement
|
Size in pixels that inner content should be spaced from the outer bounds of the element.
Padding effects all sides of the element. Padding may be negative under certain circumstances like
expanding an inner child to allow border collapsing with its parent.
|
|
|
PaddingBottom : Number
|
CanvasElement
|
Size in pixels that inner content should be spaced from the lower bounds of the element.
This will override the Padding style.
|
|
|
PaddingLeft : Number
|
CanvasElement
|
Size in pixels that inner content should be spaced from the left most bounds of the element.
This will override the Padding style.
|
|
|
PaddingRight : Number
|
CanvasElement
|
Size in pixels that inner content should be spaced from the right most bounds of the element.
This will override the Padding style.
|
|
|
PaddingTop : Number
|
CanvasElement
|
Size in pixels that inner content should be spaced from the upper bounds of the element.
This will override the Padding style.
|
|
|
PasswordMaskCharacter : String
|
[Inheritable] CanvasElement
|
Character to use when masking a password field
|
|
|
PercentHeight : Number
|
CanvasElement
|
The percentage of available height the element should consume relative to its parent container. This only
works if the element is a child of a Container element. Note that percentage height is calculated
based on the available space left over *after* static sized elements considered. Percentages
are allowed to add to more than 100 and will consume all of the available space. For containers
like ListContainers, when percents add to more than 100 the elements will share the available space
per the ratio of percent vs total percent used so it is perfectly reasonable to set 3 elements all
to 100 and allow them to split the real-estate by 3.
|
|
|
PercentWidth : Number
|
CanvasElement
|
The percentage of available width the element should consume relative to its parent container. This only
works if the element is a child of a Container element. Note that percentage width is calculated
based on the available space left over *after* static sized elements considered. Percentages
are allowed to add to more than 100 and will consume all of the available space. For containers
like ListContainers, when percents add to more than 100 the elements will share the available space
per the ratio of percent vs total percent used so it is perfectly reasonable to set 3 elements all
to 100 and allow them to split the real-estate by 3.
|
|
|
Right : Number
|
CanvasElement
|
The distance the element should be positioned from the right most bounds of the parent container.
This only works if the element is a child of an AnchorContainer.
|
|
|
RotateCenterX : Number
|
CanvasElement
|
The X position of the parent container the element should be rotated around.
This only works if the element is a child of an AnchorContainer.
|
|
|
RotateCenterY : Number
|
CanvasElement
|
The Y position of the parent container the element should be rotated around.
This only works if the element is a child of an AnchorContainer.
|
|
|
RotateDegrees : Number
|
CanvasElement
|
The number of degrees the element should be rotated (clockwise). When no RotateCenterX or
RotateCenterY is set, the element is rotated via its center point and rotated objects are
still positioned relative to their parent's coordinate plane after the transform has occurred.
|
|
|
SelectedDisabledSkinClass : CanvasElement
|
ToggleButtonElement
|
The CanvasElement constructor to be used for the button skin when the button is in the "selectedDisabled" state.
This will override SkinClass when equal or higher priority than SkinClass.
|
|
|
SelectedDisabledSkinStyle : StyleDefinition
|
ToggleButtonElement
|
The StyleDefinition or [StyleDefinition] array to apply to the "selectedDisabled" state skin element.
|
|
|
SelectedDisabledTextColor : String
|
ToggleButtonElement
|
Hex color value to be used for the button label when the button is in the "selectedDisabled" state. Format like "#FF0000" (red).
This will override TextColor when equal or higher priority than TextColor.
|
|
|
SelectedDownSkinClass : CanvasElement
|
ToggleButtonElement
|
The CanvasElement constructor to be used for the button skin when the button is in the "selectedDown" state.
This will override SkinClass when equal or higher priority than SkinClass.
|
|
|
SelectedDownSkinStyle : StyleDefinition
|
ToggleButtonElement
|
The StyleDefinition or [StyleDefinition] array to apply to the "selectedDown" state skin element.
|
|
|
SelectedDownTextColor : String
|
ToggleButtonElement
|
Hex color value to be used for the button label when the button is in the "selectedDown" state. Format like "#FF0000" (red).
This will override TextColor when equal or higher priority than TextColor.
|
|
|
SelectedOverSkinClass : CanvasElement
|
ToggleButtonElement
|
The CanvasElement constructor to be used for the button skin when the button is in the "selectedOver" state.
This will override SkinClass when equal or higher priority than SkinClass.
|
|
|
SelectedOverSkinStyle : StyleDefinition
|
ToggleButtonElement
|
The StyleDefinition or [StyleDefinition] array to apply to the "selectedOver" state skin element.
|
|
|
SelectedOverTextColor : String
|
ToggleButtonElement
|
Hex color value to be used for the button label when the button is in the "selectedOver" state. Format like "#FF0000" (red).
This will override TextColor when equal or higher priority than TextColor.
|
|
|
SelectedUpSkinClass : CanvasElement
|
ToggleButtonElement
|
The CanvasElement constructor to be used for the button skin when the button is in the "selectedUp" state.
This will override SkinClass when equal or higher priority than SkinClass.
|
|
|
SelectedUpSkinStyle : StyleDefinition
|
ToggleButtonElement
|
The StyleDefinition or [StyleDefinition] array to apply to the "selectedUp" state skin element.
|
|
|
SelectedUpTextColor : String
|
ToggleButtonElement
|
Hex color value to be used for the button label when the button is in the "selectedUp" state. Format like "#FF0000" (red).
This will override TextColor when equal or higher priority than TextColor.
|
|
|
ShadowColor : String
|
CanvasElement
|
Hex color value to be used when drawing the drop shadow. This may be set to null and no
shadow will be rendered. Format like "#FF0000" (red)
|
|
|
ShadowOffsetX : Number
|
CanvasElement
|
X offset that the drop shadow will be rendered.
|
|
|
ShadowOffsetY : Number
|
CanvasElement
|
Y offset that the drop shadow will be rendered.
|
|
|
ShadowSize : Number
|
CanvasElement
|
Size in pixels that the drop shadow should be rendered. Note that the drop shadow may be rendered
outside the elements bounding area. This will cause the element to be composite rendered.
|
|
|
SkinClass : CanvasElement
|
ButtonElement
|
The CanvasElement constructor type to apply to all skin states.
Specific states such as UpSkinClass will override SkinClass when they are equal priority.
|
|
|
SkinState : String
|
CanvasElement
|
This is an internal style used to toggle an element's current skin for different states such
as normal, mouse-over, mouse-down, etc. Its also commonly used by skin classes to identify their skin state.
|
|
|
TabStop : int
|
CanvasElement
|
Determines if an element can be focused using tab stops. -1 indicates the element cannot
take focus, 0 is default and the element will be focused in the order it appears in the display chain.
Numbers higher than 0 indicate a specific order to be used (not yet implemented).
|
|
|
Text : String
|
ButtonElement
|
Text string to be displayed as the button label.
|
|
|
TextCaretColor : String
|
[Inheritable] CanvasElement
|
Hex color value to be used when drawing blinking text caret. "#FF0000" (red)
|
|
|
TextColor : String
|
[Inheritable] CanvasElement
|
Hex color value to be used when drawing text. Format like "#FF0000" (red)
|
|
|
TextDecoration : String
|
[Inheritable] CanvasElement
|
Determines the text decoration used. Available values are "none" or "underline".
|
|
|
TextFillType : String
|
[Inheritable] CanvasElement
|
Determines the fill type when rendering text. Available values are "fill" and "stroke".
Stroke draws a border around characters, while fill completely fills them.
|
|
|
TextFont : String
|
[Inheritable] CanvasElement
|
Determines the font family to use when rendering text such as "Arial".
|
|
|
TextHighlightedColor : String
|
[Inheritable] CanvasElement
|
Hex color value to be used when drawing highlighted text. Format like "#FF0000" (red)
|
|
|
TextHorizontalAlign : String
|
ButtonElement
|
Determines alignment when rendering text. Available values are "left", "center", and "right".
|
|
|
TextLinePaddingBottom : Number
|
[Inheritable] CanvasElement
|
Padding to apply to the bottom of each line of text. This also impacts the size of the highlight background.
This is useful when using strange fonts that exceed their typical vertical bounds.
|
|
|
TextLinePaddingTop : Number
|
[Inheritable] CanvasElement
|
Padding to apply to the top of each line of text. This also impacts the size of the highlight background.
This is useful when using strange fonts that exceed their typical vertical bounds.
|
|
|
TextLineSpacing : Number
|
[Inheritable] CanvasElement
|
Vertical line spacing in pixels.
|
|
|
TextSize : int
|
[Inheritable] CanvasElement
|
Determines the size in pixels to render text.
|
|
|
TextStyle : String
|
[Inheritable] CanvasElement
|
Determines the style to render text. Available values are "normal", "bold", "italic", and "bold italic".
|
|
|
TextVerticalAlign : String
|
ButtonElement
|
Determines the baseline when rendering text. Available values are "top", "middle", or "bottom".
|
|
|
Top : Number
|
CanvasElement
|
The distance the element should be positioned from the upper bounds of the parent container.
This only works if the element is a child of an AnchorContainer.
|
|
|
UpSkinClass : CanvasElement
|
ButtonElement
|
The CanvasElement constructor to be used for the button skin when the button is in the "up" state.
This will override SkinClass when equal or higher priority than SkinClass.
|
|
|
UpSkinStyle : StyleDefinition
|
ButtonElement
|
The StyleDefinition or [StyleDefinition] array to apply to the "up" state skin element.
|
|
|
UpTextColor : String
|
ButtonElement
|
Hex color value to be used for the button label when the button is in the "up" state. Format like "#FF0000" (red).
This will override TextColor when equal or higher priority than TextColor.
|
|
|
VerticalCenter : Number
|
CanvasElement
|
The distance in pixels from the vertical center of the parent the element should be positioned.
Negative numbers indicate left of center, positive right of center.
This only works if the element is a child of an AnchorContainer.
|
|
|
Visible : boolean
|
CanvasElement
|
When false the element will not be rendered.
|
|
|
Width : Number
|
CanvasElement
|
The Width the element should be rendered relative to its parent container. This only
works if the element is a child of a Container element.
|
|
|
X : Number
|
CanvasElement
|
The X position the element should be rendered relative to its parent container. This only
works if the element is a child of an AnchorContainer.
|
|
|
Y : Number
|
CanvasElement
|
The Y position the element should be rendered relative to its parent container. This only
works if the element is a child of an AnchorContainer.
|
|
| Event |
Defined By |
|
added : AddedRemovedEvent
|
CanvasElement
|
Dispatched when this element is added to the display hierarchy and becomes a descendant of CanvasManager.
|
|
|
changed : ElementEvent
|
ToggleButtonElement
|
Dispatched when the ToggleButton's selection state changes as a result of user interaction.
|
|
|
click : ElementMouseEvent
|
CanvasElement
|
Dispatched when the mouse is pressed and released over the same element.
|
|
|
dragging : ElementEvent
|
CanvasElement
|
Dispatched when this element is moved due to it being dragged.
|
|
|
enterframe : DispatcherEvent
|
[Broadcast] CanvasElement
|
Dispatched at the beginning of the frame before any life cycle processing begins.
|
|
|
exitframe : DispatcherEvent
|
[Broadcast] CanvasElement
|
Dispatched at the end of the frame after life cycle processing ends.
|
|
|
focusin : ElementEvent
|
CanvasElement
|
Dispatched when this element gains focus.
|
|
|
focusout : ElementEvent
|
CanvasElement
|
Dispatched when this element loses focus.
|
|
|
keydown : ElementKeyboardEvent
|
CanvasElement
|
Dispatched when the element has focus and a key is pressed, repeatedly dispatched if the key is held down.
|
|
|
keyup : ElementKeyboardEvent
|
CanvasElement
|
Dispatched when the element has focus and a key is released.
|
|
|
layoutcomplete : DispatcherEvent
|
CanvasElement
|
Typically an internal event. Dispatched when an element has completed its
layout phase. This is used when it is necessary to wait for an element to
finish its layout pass so things such as its PercentWidth calculation is complete.
This is very expensive and should only be used when absolutely necessary. Its usually
only needed when elements are not directly related via parent/child.
For example, DropdownElement uses this to adjust the height of the dropdown popup
since we do not know how much height it will need until after it has finished layout.
|
|
|
localechanged : DispatcherEvent
|
[Broadcast] CanvasElement
|
Dispatched when CanvasManager's locale selection changes.
|
|
|
measurecomplete : DispatcherEvent
|
CanvasElement
|
Typically an internal event. Dispatched when an element has completed its
measure phase. This is used when it is necessary to wait for an element to
finish its measure pass so that its content size or _measuredSize calculation is complete.
This is very expensive and should only be used when absolutely necessary. Its usually
only needed when elements are not directly related via parent/child.
For example, ViewportElement uses this to invoke a layout pass when its content child
changes _measuredSize. The Viewport uses an intermediate CanvasElement as a clipping container
for the content child, which does not measure children, so an event is needed to notify the Viewport.
|
|
|
mousedown : ElementMouseEvent
|
CanvasElement
|
Dispatched when the mouse is pressed over this element.
|
|
|
mousemove : ElementMouseEvent
|
CanvasElement
|
Dispatched when the mouse moves over this element.
|
|
|
mousemoveex : ElementMouseEvent
|
[Broadcast] CanvasElement
|
Dispatched when the mouse moves anywhere, even outside of the browser window. Mouse coordinates are relative to CanvasManager.
|
|
|
mouseup : ElementMouseEvent
|
CanvasElement
|
Dispatched when the mouse is released. Note that the mouse may not still be over the element.
|
|
|
removed : AddedRemovedEvent
|
CanvasElement
|
Dispatched when this element is removed from the display hierarchy and is no longer a descendant of CanvasManager.
|
|
|
resize : DispatcherEvent
|
CanvasElement
|
Dispatched when the element's size changes.
|
|
|
rollout : ElementEvent
|
CanvasElement
|
Dispatched when the mouse moves outside of this element.
|
|
|
rollover : ElementEvent
|
CanvasElement
|
Dispatched when the mouse moves over this element.
|
|
|
stylechanged : StyleChangedEvent
|
StyleDefinition
|
Dispatched when a style is added, cleared, or changed.
|
|
|
wheel : ElementMouseWheelEvent
|
CanvasElement
|
Dispatched when the mouse wheel is rolled while over this element.
|
|
| Function |
Defined By |
|
RadioButtonElement()
|
[Constructor] RadioButtonElement
|
Creates new RadioButtonElement instance.
|
|
|
addCaptureListener(type, callback)
|
CanvasElement
|
Registers an event listener function to be called during capture phase.
| |
type : String
String representing the event type.
|
| |
callback : Function
Function to be called when the event occurs.
|
|
|
|
addEventListener(type, callback)
|
EventDispatcher
|
Registers an event lister function to be called when an event occurs.
| |
type : String
String representing the event type.
|
| |
callback : Function
Function to be called when the event occurs.
|
|
|
|
addStyleDefinition(styleDefinition)
|
CanvasElement
|
Adds a style definition to the end element's definition list. Styles in this definition
will override styles in previously added definitions (lower index). Instance styles, set
using setStyle() will override all definition styles.
Adding style definitions to elements already attached to the display chain is expensive,
for better performance add definitions before attaching the element via addElement()
| |
styleDefinition : StyleDefinition
The StyleDefinition to add and associate with the element.
|
| |
returns : StyleDefinition
The style definition just added.
|
|
|
|
addStyleDefinitionAt(styleDefinition, index)
|
CanvasElement
|
Inserts a style definition to this elements definition list at the specified index.
Definitions with higher indexes (added later) are higher priority. Instance styles, set
using setStyle() will override all definition styles.
Adding style definitions to elements already attached to the display chain is expensive,
for better performance add definitions before attaching the element via addElement()
| |
styleDefinition : StyleDefinition
StyleDefinition to be added to this elements definition list.
|
| |
index : int
The index to insert the style definition within the elements definition list.
|
| |
returns : StyleDefinition
Returns StyleDefinition just added when successfull, null if the StyleDefinition could not be added due to the index being out of range or other error.
|
|
|
|
clearStyle(styleName)
|
StyleDefinition
|
Clears style data from this object. This is the same
passing undefined to setStyle().
| |
styleName : String
String representing the style to clear.
|
|
|
|
clearStyleDefinitions()
|
CanvasElement
|
Removes all style definitions from the element. This is more efficient than
removing definitions one at a time.
|
|
|
dispatchEvent(event)
|
EventDispatcher
|
Dispatches an event to be processed by registered event listeners. The Event's target is the
EventDispatcher which called dispatchEvent. The Event will be cloned prior to passing to callback functions
to ensure the callback cannot modify the Event data or properties. You can check if the event was canceled
by calling the Event's getIsCanceled after dispatching it. Re-dispatching the same event will re-set its canceled state to false.
| |
event : DispatcherEvent
The DispatcherEvent class or subclass to be dispatched.
|
|
|
|
getManager()
|
CanvasElement
|
Gets the CanvasManager currently associated with this element.
| |
returns : CanvasManager
The CanvasManager currently associated with this element.
|
|
|
|
getMetrics(relativeToElement)
|
CanvasElement
|
Gets a DrawMetrics object containing the elements bounding box information
x, y, width, height, relative to the supplied element regardless of this element's transformation,
depth, or position in the display hierarchy. For example, you can call this get the elements width and height,
or to get this element's bounding box relative to the canvas or any other element.
| |
relativeToElement : CanvasElement
The element to translate this elements bounding box too. If relativeToElement equals null or this, will return metrics relative to this element: {x:0, y:0, width:thisWidth, height:thisHeight}.
|
| |
returns : DrawMetrics
DrawMetrics of this element relative to the supplied element.
|
|
|
|
getMouseIsDown()
|
CanvasElement
|
Gets the state of the mouse for this element.
| |
returns : boolean
Returns true if the mouse is currently pressed, false otherwise.
|
|
|
|
getName()
|
CanvasElement
|
Gets the name associated with this element.
| |
returns : String
The name associated with this element.
|
|
|
|
getNumStyleDefinitions()
|
CanvasElement
|
Gets the number of style definitions associated with this element.
| |
returns : int
The number of style definitions.
|
|
|
|
getParent()
|
CanvasElement
|
Gets this element's parent element.
|
|
|
getSelected()
|
ToggleButtonElement
|
Gets the selected state of the ToggleButton.
| |
returns : boolean
When true the toggle button is selected.
|
|
|
|
getStyle(styleName)
|
[Override] CanvasElement
|
Gets the style value for this element. When retrieving a style, CanvasElements look
through their associated style chain, at each step if undefined is returned, they look
at the next step until a non-undefined value is found.
1) Instance - Styles set directly to the element via setStyle()
2) StyleDefinitions - Styles associated via its assigned StyleDefinitions
3) StyleProxy - If proxy element is assigned, move to proxy element and repeat steps 1-3
4) Inheritable - If style is inheritable, move up to parent element and repeat steps 1-4
5) Default styles
| |
styleName : String
String representing the style value to be returned.
|
| |
returns : Any
Returns the associated style value if found, otherwise undefined.
|
|
|
|
getStyleData(styleName)
|
StyleableBase
|
Gets the style data for the supplied style name, this includes
additional info than getStyle() such as the style priority. You should
not modify the returned StyleData.
| |
styleName : String
String representing style to return the associated StyleData.
|
| |
returns : StyleData
Returns the associated StyleData
|
|
|
|
getStyleDefinitionAt(index)
|
CanvasElement
|
Gets the style definition at the supplied zero base index.
| |
index : int
Index of the style definition to return;
|
| |
returns : StyleDefinition
The style defenition at the supplied index, or null if index is out of range.
|
|
|
|
getStyleDefinitionIndex(styleDefinition)
|
CanvasElement
|
Returns the index of the supplied style definition or -1 if the style definition
has not been added.
| |
styleDefinition : StyleDefinition
StyleDefinition to return associated index.
|
| |
returns : int
Index of the StyleDefinition supplied via the styleDefinition parameter, or -1 if does not exist.
|
|
|
|
hasCaptureListener(type, callback)
|
CanvasElement
|
Checks if an event capture listener has been registered with this CanvasElement
| |
type : String
String representing the event type.
|
| |
callback : Function
Function callback to be called when the event occurs. This may be null to check if the CanvasElement has any capture events registered for the provided type.
|
| |
returns : boolean
Returns true if the CanvasElement has the provided capture callback registered for the provided type, or any capture callback for the provided type if the callback parameter is null. Otherwise, returns false.
|
|
|
|
hasEventListener(type, callback)
|
EventDispatcher
|
Checks if an event listener has been registered with this EventDispatcher
| |
type : String
String representing the event type.
|
| |
callback : Function
Function callback to be called when the event occurs. This may be null to check if the EventDispatcher has any events registered for the provided type.
|
| |
returns : boolean
Returns true if the EventDispatcher has the provided callback registered for the provided type, or any callback for the provided type if the callback parameter is null. Otherwise, returns false.
|
|
|
|
removeCaptureListener(type, callback)
|
CanvasElement
|
Removes a capture event listener.
| |
type : String
String representing the event type.
|
| |
callback : Function
Function callback to be removed.
|
| |
returns : boolean
Returns true if the callback was successfully removed, otherwise false such as if the function callback was not previously registered.
|
|
|
|
removeEventListener(type, callback)
|
EventDispatcher
|
Removes a callback from the EventDispatcher
| |
type : String
String representing the event type.
|
| |
callback : Function
Function callback to be removed.
|
| |
returns : boolean
Returns true if the callback was successfully removed, otherwise false such as if the function callback was not previously registered.
|
|
|
|
removeStyleDefinition(styleDefinition)
|
CanvasElement
|
Removes the supplied style definition from the element's style chain.
| |
styleDefinition : StyleDefinition
The StyleDefinition to remove from the element.
|
| |
returns : StyleDefinition
The style definition just removed, or null if the supplied style definition is not associated with this element.
|
|
|
|
removeStyleDefinitionAt(index)
|
CanvasElement
|
Removes the style definition from the elements definition list at the supplied index.
| |
index : int
Index to be removed.
|
| |
returns : StyleDefinition
Returns the StyleDefinition just removed if successfull, null if the definition could not be removed due it it not being in this elements definition list, or index out of range.
|
|
|
|
rotatePoint(point, reverse)
|
CanvasElement
|
Rotates a point point on this element's parent relative to this element's rotation transformation.
This is used to transform a point from the parent's coordinate plane to a child's coordinate plane or vice versa.
Typically you should use translatePointFrom() or translatePointTo() rather than rotatePoint().
| |
point : Object
Point object {x:0, y:0};
|
| |
reverse : boolean
When true, rotates a point on the parent's plane, to the childs plane. When false, rotates a point on the childs plane, to the parents plane.
|
|
|
|
setName(name)
|
CanvasElement
|
Sets an arbitrary name to this element. The system does not use this value,
it is for use by implementors if a way to differentiate elements is needed.
| |
name : String
A String to use as the element's name.
|
|
|
|
setSelected(isSelected)
|
ToggleButtonElement
|
Sets the selected state of the ToggleButton.
| |
isSelected : boolean
When true the toggle button is selected.
|
|
|
|
setStyle(styleName, value)
|
StyleDefinition
|
Sets the stored style value for this object.
| |
styleName : String
String representing the style to set.
|
| |
value : Any
The value to store. This may be null or undefined. Note that a null style is different from an absent (undefined) style. A null style will terminate a style chain lookup and return null value. An undefined style will cause the system to look further up the style chain for a value. Passing undefined is the same as calling clearStyle().
|
|
|
|
setStyleDefinitions(styleDefinitions)
|
CanvasElement
|
Replaces the elements current style definition list. This is more effecient than removing or
adding style definitions one at a time.
| |
styleDefinitions : StyleDefinition
May be a StyleDefinition, or an Array of StyleDefinition, including nested Arrays. Note that nested arrays will be flattened into a single array.
|
|
|
|
translateMetricsFrom(metrics, relativeFromElement)
|
CanvasElement
|
Translates a DrawMetrics from another element's to this element regardless of this element's transformation,
depth, or position in the display hierarchy.
| |
metrics : DrawMetrics
Metrics to transform from the relative to this element.
|
| |
relativeFromElement : CanvasElement
The element to translate the supplied metrics too. If relativeToElement equals null or this, will return metrics the same as the supplied metrics.
|
| |
returns : DrawMetrics
Translated DrawMetrics relative to the supplied element.
|
|
|
|
translateMetricsTo(metrics, relativeToElement)
|
CanvasElement
|
Translates a DrawMetrics from this element's to another element regardless of this element's transformation,
depth, or position in the display hierarchy.
| |
metrics : DrawMetrics
Metrics to transform to from this element to the supplied relative element.
|
| |
relativeToElement : CanvasElement
The element to translate the supplied metrics too. If relativeToElement equals null or this, will return metrics the same as the supplied metrics.
|
| |
returns : DrawMetrics
Translated DrawMetrics relative to the supplied element.
|
|
|
|
translatePointFrom(point, relativeFromElement)
|
CanvasElement
|
Translates a point from an element to this element regardless of this element's transformation,
depth, or position in the display hierarchy. For example, you can call this to translate a point on
the canvas to the relative point on this element.
| |
point : Object
Point - object containing {x:0, y:0}.
|
| |
relativeFromElement : CanvasElement
The element that the supplied point is relative too.
|
|
|
|
translatePointTo(point, relativeToElement)
|
CanvasElement
|
Translates a point from this element to another element regardless of this element's transformation,
depth, or position in the display hierarchy. For example, you can call this to translate a point on
this element to a point on the canvas.
| |
point : Object
Point - object containing {x:0, y:0}.
|
| |
relativeToElement : CanvasElement
The element to translate this element's point too.
|
|
|
| Function |
Defined By |
|
_addChild(element)
|
CanvasElement
|
Adds a child element to the end of this element's child list.
| |
element : CanvasElement
CanvasElement to be added as a child of this element.
|
| |
returns : CanvasElement
Returns the element just added.
|
|
|
|
_addChildAt(element, index)
|
CanvasElement
|
Inserts a child element to this elements child list at the specified index.
| |
element : CanvasElement
CanvasElement to be added as a child of this element.
|
| |
index : int
The index position to insert the child in the elements child list.
|
| |
returns : CanvasElement
Returns the element just added when successfull, null if the element could not be added due to the index being out of range.
|
|
|
|
_addStyleDefinitionAt(styleDefinition, index, isDefault)
|
CanvasElement
|
Inserts a style definition to this elements style definition or default definition lists.
Adding style definitions to elements already attached to the display chain is expensive,
for better performance add definitions before attaching the element via addElement().
Default definitions are used when styling sub components with sub styles.
| |
styleDefinition : StyleDefinition
StyleDefinition to be added to this elements definition list.
|
| |
index : int
The index to insert the style definition within the elements definition list.
|
| |
isDefault : bool
When true, inserts the definition into the element's default definition list.
|
| |
returns : StyleDefinition
Returns StyleDefinition just added when successfull, null if the StyleDefinition could not be added due to the index being out of range or other error.
|
|
|
|
_applySubStylesToElement(styleName, elementToApply)
|
[Override] CanvasElement
|
Convienence function for setting sub styles of sub components.
Applies appropriate sub styling from this element to the
supplied elements definition and default definition style lists.
You should call this on sub components from within the _doStylesUpdated()
function when the associated sub style changes.
| |
styleName : String
String representing the sub style to apply.
|
| |
elementToApply : CanvasElement
The sub component element to apply sub styles.
|
|
|
|
_changeState(state)
|
SkinnableElement
|
Called when the element changes skin state. Do not call this function directly.
You may override this if you need to make additional changes to your component
when the skin state changes (such as updating a label color).
| |
state : String
The skin state that this element is changing too.
|
| |
returns : boolean
Returns true if the element state has actually changed, false if it is the same state. Subclasses can check what this base function returns before making additional changes for better performance.
|
|
|
|
_createLabel()
|
ButtonElement
|
Creates the Button's label instance when Text style is not null or empty.
|
|
|
_doLayout(paddingMetrics)
|
CanvasElement
|
Lifecycle method for custom component development. Never call this function directly. The system
calls this function in response to changes that effect layout or elements being added to the display hierarchy.
Override this function to layout its children. You should call layout functions such as _setActualPosition() and
_setActualSize() on child elements from within this function. Sometimes you may need to add/remove additional elements
during layout such as when a Datagrid or Viewport adds/removes scroll bars. Keep in mind that adding/removing elements
automatically re-invalidates layout, so its best to bail out and wait for the next layout pass for best performance
under this scenario.
| |
paddingMetrics : DrawMetrics
Contains metrics to use after considering the element's padding. Simply a convienence as padding typically effects layout (but not always) depending on the component. Use any supporting functions such as _getBorderMetrics() that are needed to layout the element.
|
|
|
|
_doMeasure(padWidth, padHeight)
|
CanvasElement
|
Lifecycle method for custom component development. Never call this function directly. The system
calls this function in response to changes that effect measurement or elements being added to the display hierarchy.
Override this function to calculate the measured size of the element based on its styling, children, etc.
You should set the elements measured size by calling _setMeasuredSize() from within this function.
| |
padWidth : Number
Simply a convienence as padding typically effects measurement (but not always) depending on the component. Use any supporting functions such as _getBorderThickness that are needed to measure the element.
|
| |
padHeight : Number
Simply a convienence as padding typically effects measurement (but not always) depending on the component. Use any supporting functions such as _getBorderThickness that are needed to measure the element.
|
|
|
|
_doRender()
|
CanvasElement
|
Lifecycle method for custom component development. Never call this function directly. The system
calls this function in response to changes that effect rendering or elements being added to the display hierarchy.
Override this function to render the element. Keep in mind that any child elements are rendered on top of this
element. This function is typically not needed unless rendering a very primitive object such as a custom skin or
a display object that cannot be handled via a BackgroundShape class and/or _fillBackground() function.
Most advanced objects should use skins and other means to render themselves.
CanvasElement draws its background and border via supplied shape and gradient settings.
|
|
|
_doStylesUpdated(stylesMap)
|
CanvasElement
|
Lifecycle method for custom component development. Never call this function directly. The system
calls this function in response to style changes or elements being added to the display hierarchy.
Override this function to handle style changes to the element. Style changes may impact other styles,
event listeners, layout, measurement, rendering, etc. You should call appropriate _invalidate() method per style.
Note that style handling should not be dependent on the *current* state of a style. This function
should be able to run repeatedly with the same values. An example of when this may happen is if
an element is temporarily removed from the display hierarchy then added back. Whenever an element is added
all of its styles are invalidated. This is necessary as when an element is *not* part of the display chain
style changes are not tracked. So when an element is added there is no way to know which styles may have changed
hence all of them are invalidated.
| |
stylesMap : Object
An Object map containing all the style names that have been updated. Map contains entries {styleName:true}. Elements should typically check this map before assuming a style has changed for performance reasons. You should always call the base method. If you wish to override the style handling behavior of a specific style, you can simply delete it from the map before passing it to the base function.
|
|
|
|
_drawBackgroundShape(ctx, borderMetrics)
|
CanvasElement
|
Used to draw the path to the Canvas2DContext that is to be used to render the focus ring,
fill the background, and draw the border. You should never need to explicitly call this.
The system calls this during render phase.
Typically you should use the BackgroundShape style
for this, but may override it under more complex scenarios.
| |
ctx : Canvas2DContext
Canvas2DContext to draw the background shape path.
|
| |
borderMetrics : DrawMetrics
The DrawMetrics containing x,y,width,height used to draw the background. These metrics should be the same as the ones used to stroke a solid border.
|
|
|
|
_drawBorder(ctx, borderMetrics)
|
CanvasElement
|
Used to render the elements border according to the element's style settings.
You should never need to explicitly call this. The system calls this during
the render phase. You may override if you need to do a more complex border. The border
is rendered last, on top of the focus ring and background fill.
| |
ctx : Canvas2DContext
Canvas2DContext to render the border.
|
| |
borderMetrics : DrawMetrics
The DrawMetrics containing x,y,width,height used to draw the background. These metrics should be the same as the ones used to stroke a solid border.
|
|
|
|
_drawFocusRing(ctx, borderMetrics)
|
CanvasElement
|
Used to draw the focus ring when a tab-able element gains focus due to a tab stop per the elements styles.
You should never need to explicitly call this. The system calls this during
the render phase. You may override if you wish to draw a more complex focus indicator.
Focus ring is drawn *outside* the elements bounding box. Focus ring is rendered
before the background and border.
| |
ctx : Canvas2DContext
Canvas2DContext to render the focus ring.
|
| |
borderMetrics : DrawMetrics
The DrawMetrics containing x,y,width,height used to draw the background. These metrics should be the same as the ones used to stroke a solid border.
|
|
|
|
_fillBackground(ctx, borderMetrics)
|
CanvasElement
|
Used to fill the elements background shape according to the element's BackgroundShape and BackgroundFill styles.
You should never need to explicitly call this. The system calls this during
the render phase. You may override if you need to do a more complex background fill. The background fill
is rendered after the focus ring and before the border.
| |
ctx : Canvas2DContext
Canvas2DContext to fill the background shape.
|
| |
borderMetrics : DrawMetrics
The DrawMetrics containing x,y,width,height used to draw the background. These metrics should be the same as the ones used to stroke a solid border.
|
|
|
|
_getBorderMetrics()
|
CanvasElement
|
Helper function that returns a DrawMetrics object whose bounding area is inside this elements border.
| |
returns : DrawMetrics
Returns DrawMetrics that define a bounding area inside this elements border.
|
|
|
|
_getBorderThickness()
|
CanvasElement
|
Helper function that returns the elements border thickness per its applied styles.
| |
returns : Number
The elements border thickness.
|
|
|
|
_getChildAt(index)
|
CanvasElement
|
Gets the child element at the supplied index.
| |
index : int
Index of child element to return;
|
| |
returns : CanvasElement
The element at the supplied index, or null if index is out of range.
|
|
|
|
_getChildIndex(element)
|
CanvasElement
|
Returns the index of the supplied child element.
| |
element : CanvasElement
Child element to return the index.
|
| |
returns : int
Returns the child index or -1 if the element is not a child of this element.
|
|
|
|
_getClassStyle(styleName)
|
StyleableBase
|
Gets the default style value for the supplied style name specified on this
classes StyleDefault map. Subclasses override base class values.
| |
styleName : String
String representing the default style to return.
|
| |
returns : Any
Returns the associated default style value or undefined if none specified.
|
|
|
|
_getClassStyleList(styleName)
|
StyleableBase
|
Gets the default style values for the supplied style name specified on this
classes and base classes StyleDefault maps. This is used for sub styles as all
stub styles in the inheritance chain are applied to sub components.
| |
styleName : String
String representing the default style list to return.
|
| |
returns : Array
Returns an array of all default styles on this class, and base classes for the supplied styleName.
|
|
|
|
_getDefaultStyleList(styleName)
|
CanvasElement
|
Gets the style values for the supplied style name in this elements
default style definition list and class list styles for the supplied style name.
This is used for sub styles as all stub styles in the list are applied to sub components.
This list should be supplied to the sub components default style definition list.
| |
styleName : String
String representing the default style list to return.
|
| |
returns : Array
Returns an array of all styles in this elements default definition and class list styles for the associated style name.
|
|
|
|
_getFontString()
|
CanvasElement
|
Gets a font string that can be applied to the canvas's Context2D via the element's text styles.
This is just a helper to gather and format the styles for the canvas context.
| |
returns : String
String to be applied to the canvas contex's font. "bold 14px Arial".
|
|
|
|
_getGraphicsCtx()
|
CanvasElement
|
Returns the canvas context used when rendering this element. This should typically
only be called from within the element's _doRender() phase, and only if you intend
to actually draw. Calling this will impact the canvas redraw regions.
| |
returns : Canvas2DContext
Canvas context used when rendering this element.
|
|
|
|
_getInstanceStyle(styleName)
|
StyleableBase
|
Gets the assigned style value for the supplied style name specified.
| |
styleName : String
String representing the style to return.
|
| |
returns : Any
Returns the associated style value or undefined if none specified.
|
|
|
|
_getNumChildren()
|
CanvasElement
|
Gets this elements number of children.
| |
returns : int
The number of child elements.
|
|
|
|
_getNumStyleDefinitions(isDefault)
|
CanvasElement
|
Gets the number of style definitions or default definitions associated with this element.
| |
isDefault : bool
When true, returns the number of default definitions.
|
| |
returns : int
The number of style definitions.
|
|
|
|
_getPaddingMetrics()
|
CanvasElement
|
Helper function that returns a DrawMetrics object whose bounding area is inside this elements padding area.
| |
returns : DrawMetrics
Returns DrawMetrics that define a bounding area inside this elements padding area.
|
|
|
|
_getPaddingSize()
|
CanvasElement
|
Helper function that returns the elements total padding width and height per its applied styles.
| |
returns : Object
Returns an object containing {width:paddingWidth, height:paddingHeight, paddingBottom:paddingBottom, paddingTop:paddingTop, paddingLeft:paddingLeft, paddingRight:paddingRight}.
|
|
|
|
_getSkinClass(state)
|
SkinnableElement
|
Gets the skin class to use per the provided state.
Override this to return different skin classes for different states.
| |
state : String
The state for which to return a skin class.
|
| |
returns : Function
Return the constructor of the appropriate skin class.
|
|
|
|
_getSkinStyleProxyMap()
|
SkinnableElement
|
Gets the Style proxy map to pass to skins. Override this if you need to pass additional styles
to custom skins. You should include all the styles provided in the default SkinnableElement style map.
| |
returns : Object
Return a style proxy map to be applied to this element to all skins. Formatted as: MyProxyMap = Object.create(null); MyProxyMap.StyleName1 = true; MyProxyMap.StyleName2 = true;
|
|
|
|
_getStyleDefinitionAt(index, isDefault)
|
CanvasElement
|
Gets the style definition or default definition at the supplied zero base index.
| |
index : int
Index of the style definition to return;
|
| |
isDefault : bool
When true, returns the default definition at the supplied index.
|
| |
returns : StyleDefinition
The style defenition at the supplied index, or null if index is out of range.
|
|
|
|
_getStyledOrMeasuredHeight()
|
CanvasElement
|
Helper function that returns this elements styled height, or measured height if no style is set. Typically
called from within a parent containers layout phase.
| |
returns : Number
The elements height.
|
|
|
|
_getStyledOrMeasuredWidth()
|
CanvasElement
|
Helper function that returns this elements styled width, or measured width if no style is set. Typically
called from within a parent containers layout phase.
| |
returns : Number
The elements width.
|
|
|
|
_getStyleList(styleName)
|
CanvasElement
|
Gets the style values for the supplied style name in this elements
style definition list and instance styles for the supplied style name.
This is used for sub styles as all stub styles in the list are applied to sub components.
This list should be supplied to the sub components style definition list.
| |
styleName : String
String representing the style list to return.
|
| |
returns : Array
Returns an array of all styles in this elements definition list and instance styles for the associated style name.
|
|
|
|
_getSubStyleNameForSkinState(state)
|
SkinnableElement
|
Gets the style name of the sub style to be applied to the skin
for the associated state. Override this to return the associated
sub style name for the supplied state.
| |
state : String
The state for which to return a sub style name.
|
| |
returns : string
Sub style name to apply to the skin of the associated state.
|
|
|
|
_getTextColor(state)
|
ButtonElement
|
Gets the text color to be used for the supplied state.
Override this to add styles for additional states.
| |
state : String
String representing the state to return the text color style.
|
| |
returns : string
Text color for the supplied state.
|
|
|
|
_invalidateLayout()
|
CanvasElement
|
Invalidates the elements child layout and causes the system to invoke doLayout() on
the next layout phase. The system calls this automatically for all existing components,
this is only necessary for custom component development.
This should only be called when a change is made to the element that will impact its layout.
Such as property changes or from within the elements doStylesUpdated() when a style change impacts
the element's layout (such as Padding). On rare occasions you may need to re-invalidate layout
from within the doLayout() function. An example is when a DataList adds a new DataRenderer it
re-invalidates layout to allow the renderer to measure before continuing layout.
Do not override this function.
|
|
|
_invalidateMeasure()
|
CanvasElement
|
Invalidates the element's measured sizes and causes the system to invoke
doMeasure() on the next measure phase. The system calls this automatically for all
existing components, this is only necessary for custom component development.
This should only be called when a change is made
to the element that will impact its measurement. Such as property changes or from within the elements doStylesUpdated()
when a style change impacts the elements measurement (such as Padding). On rare occasions
you may need to re-invalidate measurement from within the doMeasure() function (such as wrapping text).
This will cause a 2nd measurement pass for that element which is valid (but expensive).
Do not override this function.
|
|
|
_invalidateRender()
|
CanvasElement
|
Invalidates the elements child render and causes the system to invoke doRender() on
the next render phase. The system calls this automatically for all existing components,
this is only necessary for custom component development.
This should only be called when a change is made to the element that will impact its rendering.
Such as property changes or from within the elements doStylesUpdated() when a style change impacts
the element's rendering (such as BackgroundFill).
Do not override this function.
|
|
|
_invalidateStyle(styleName)
|
CanvasElement
|
Invalidates the supplied style and causes the system to invoke the _doStylesChanged() function.
This should never concievably be called and is exclusively handled by the system.
This is the starting point for the element lifecycle. If you're program is dependent on
_doStylesChanged() when no styles have actually changed, you might have a design issue.
Do not override this function.
| |
styleName : String
String representing the style to be invalidated.
|
|
|
|
_onButtonClick(elementMouseEvent)
|
ButtonElement
|
Event handler for "click" event. Cancels the event if the Button is disabled.
Overriding this is more efficient than adding an additional "click" event listener.
|
|
|
_onButtonMouseDown(elementMouseEvent)
|
ButtonElement
|
Event handler for "mousedown" event. Updates the Button skin state.
Overriding this is more efficient than adding an additional "mousedown" event listener.
|
|
|
_onButtonMouseUp(elementMouseEvent)
|
ButtonElement
|
Event handler for "mouseup" event. Updates the Button skin state.
Overriding this is more efficient than adding an additional "mouseup" event listener.
|
|
|
_onButtonRollout(elementEvent)
|
ButtonElement
|
Event handler for "rollout" event. Updates the Button skin state.
Overriding this is more efficient than adding an additional "rollout" event listener.
|
|
|
_onButtonRollover(elementEvent)
|
ButtonElement
|
Event handler for "rollover" event. Updates the Button skin state.
Overriding this is more efficient than adding an additional "rollover" event listener.
|
|
|
_onCanvasElementAdded(addedRemovedEvent)
|
CanvasElement
|
Invoked when the element is added to the canvas. Every CanvasElement already adds its own
"added" event listener so overriding this is identical but more efficient than adding your own "added" event listener.
You should *always* call the base class function.
|
|
|
_onCanvasElementRemoved(addedRemovedEvent)
|
CanvasElement
|
Invoked when the element is removed to the canvas. Every CanvasElement already adds its own
"removed" event listener so overriding this is identical but more efficient than adding your own "removed" event listener.
You should *always* call the base class function.
|
|
|
_removeChild(element)
|
CanvasElement
|
Removes a child element from this elements child list.
| |
element : CanvasElement
Child to be removed.
|
| |
returns : CanvasElement
Returns the element just removed if successfull, null if the element could not be removed due to it not being a child of this element.
|
|
|
|
_removeChildAt(index)
|
CanvasElement
|
Removes a child element at specified index.
| |
index : int
Index to be removed.
|
| |
returns : CanvasElement
Returns the element just removed if successfull, null if the element could not be removed due it it not being a child of this element, or index out of range.
|
|
|
|
_removeStyleDefinitionAt(index, isDefault)
|
CanvasElement
|
Removes a style definition from this elements style definition or default definitions at the supplied index.
Default definitions are used when styling sub components with sub styles.
| |
index : int
Index to be removed.
|
| |
isDefault : bool
When true, removes the definition from the element's default definition list.
|
| |
returns : StyleDefinition
Returns the StyleDefinition just removed if successfull, null if the definition could not be removed due it it not being in this elements definition list, or index out of range.
|
|
|
|
_setActualPosition(x, y)
|
CanvasElement
|
Sets the elements position within its parent. Note that if the element is transformed or rotated,
this sets the elements position within its transformed plane. If you wish to position a transformed
element relative to its parents coordinate plane, use _setRelativePosition(). This should typically
only be called from within the parents layout phase.
| |
x : int
The X position to move the element.
|
| |
y : int
The Y position to move the element.
|
|
|
|
_setActualRotation(degrees, centerX, centerY)
|
CanvasElement
|
Sets this elements rotation degrees and rotation point relative to its parent. This should typically
only be called from within the parent's layout phase.
| |
degrees : Number
Degrees to rotate the element (clockwise).
|
| |
centerX : Number
The X position relative to the elements parent to rotate around.
|
| |
centerY : Number
The Y position relative to the elements parent to rotate around.
|
|
|
|
_setActualSize(width, height)
|
CanvasElement
|
Sets this element's size in pixels prior to any transformation or rotation.
This should typically only be called from within the parents layout phase.
| |
width : Number
The width in pixels to size this element.
|
| |
height : Number
The height in pixels to size this element.
|
|
|
|
_setChildIndex(element, index)
|
CanvasElement
|
Changes a child element's index.
| |
element : CanvasElement
Child element to change index.
|
| |
index : int
New index of the child element.
|
| |
returns : boolean
Returns true if the child's index is successfully changed, false if the element is not a child of this element or the index is out of range.
|
|
|
|
_setLabelText(text)
|
ButtonElement
|
Sets supplied text to the buttons label element, adds or destroys the label as necessary.
| |
text : String
String to be used for the label text.
|
|
|
|
_setListData(listData, itemData)
|
CanvasElement
|
This function is called when the element is being used as a DataRenderer for containers
like DataList and DataGrid. Override this function to make any changes to the DataRenderer
per the supplied DataListData and itemData objects. Update any styles, states, add/remove children, call any
necessary _invalidate() functions, etc.
| |
listData : DataListData
A DataListData or subclass object passed by the parent DataList or subclass with data necessary to update the DataRender like the parent DataList reference and row/column index being rendered.
|
| |
itemData : Object
The data Object (such as row data) supplied by the implementor's ListCollection to render the row/column DataRenderer.
|
|
|
|
_setListSelected(selectedData)
|
CanvasElement
|
This function is called when the element is being used as a DataRenderer for containers
like DataList and DataGrid to change the DataRenderer's selection state.
Override this function to make any changes to the DataRenderer per the selection state.
Update any styles, states, add/remove children, call any necessary _invalidate() functions, etc.
| |
selectedData : Any
Selected data, differs per container.
|
|
|
|
_setRelativePosition(x, y, relativeToElement)
|
CanvasElement
|
Sets the elements position relative to a supplied element regardless of this element's transformation,
depth, or position in the display hierarchy or relation to the supplied relativeToElement. This should typically
only be called during the parent element's layout phase. Setting relativeToElement to null has an identical
effect to calling _setActualPosition(). This is used by some containers to position the element relative
to a parent's coordinate plane rather than the child's transformed plane.
| |
x : Number
The relative X position to move this element's position.
|
| |
y : Number
The relative Y position to move this element's position.
|
| |
relativeToElement : CanvasElement
The CanvasElement to move this element relative too.
|
|
|
|
_setStyleDefinitions(styleDefinitions, isDefault, styleNamesChangedMap)
|
CanvasElement
|
Replaces the elements current style definition or default definition lists.
This is more effecient than removing or adding style definitions one at a time.
Default definitions are used when styling sub components with sub styles.
| |
styleDefinitions : StyleDefinition
May be a StyleDefinition, or an Array of StyleDefinition
|
| |
isDefault : bool
When true, replaces the default definition list.
|
| |
styleNamesChangedMap : Object
Optional - A empty map object - Object.create(null) to populate style changes due to swapping definitions while this element is attached to the display chain. When specified (not null), does not automatically invoke style changed events.
|
|
|
|
_setStyleProxy(styleProxy)
|
CanvasElement
|
Sets the element which is to proxy styles to this element. See getStyle() and StyleProxy.
This should be set prior to added this element to the display hierarchy via addElement() or _addChild().
| |
styleProxy : StyleProxy
The StyleProxy element wrapper to use to proxy styles from the proxy element to this element.
|
|
|
|
_updateSkinClass(state)
|
SkinnableElement
|
Updates the skin class for the skin of the provided state. Subclasses should call
this within their _doStylesUpdated() when skin style class changes.
| |
state : String
The state for which to update the skin class.
|
|
|
|
_updateSkinStyleDefinitions(state)
|
SkinnableElement
|
Updates the StyleDefinition for the skin of the provided state. Subclasses should call
this within their _doStylesUpdated() when skin style definitions change.
| |
state : String
The state for which to update the StyleDefinition.
|
|
|
|
_updateState()
|
ButtonElement
|
Called in response to mouse events, and when the Button is added to the display hierarchy (if mouse is enabled).
Updates the Button skin state.
|
|
|
_updateText()
|
ButtonElement
|
Updates the buttons text per styling.
This function calls _updateLabelText(text)
Override this if you need to change the source of the label text and
call _updateLabelText accordingly.
|
|
|
_updateTextColor()
|
ButtonElement
|
Updates the text color in response to state changes.
|
|