| Package | ardisia.components.transformContainer |
| Class | public class TransformContainer |
| Inheritance | TransformContainer spark.components.SkinnableContainer |
Avoid anchor layouts on child elements.
Any element that implements IVisualElement can be added, but only elements that dispatch mouse events, like DisplayObjects, can be selected and transformed.
View the technical documentation on the Ardisia Labs website for more information.
Default MXML PropertymxmlContentFactory
| Property | Defined By | ||
|---|---|---|---|
| allowMultipleSelection : Boolean = true
True to allow the user to select multiple elements when the "ctrl" or
"shift" key is down during selection. | TransformContainer | ||
| dragEnabled : Boolean = true
True to enable element dragging. | TransformContainer | ||
| excludedPips : Array
An array of the pips to not display over selected elements. | TransformContainer | ||
| hoveredElement : IVisualElement [read-only]
The currently hovered visual element. | TransformContainer | ||
| lockAspectRatio : Boolean = false
True lock the aspect ratio when transforming. | TransformContainer | ||
| selectedElements : Vector.<IVisualElement>
A vector of the selected visual elements. | TransformContainer | ||
| showHoverIndicator : Boolean
True to display the hoverIndicatorPart when mousing over child visual
elements. | TransformContainer | ||
| showSelectionIndicators : Boolean
True to display the selection indicators over selected elements. | TransformContainer | ||
| transformMode : String
See the TransformModes class for possible values.
"none" applies no transformation and does not display the
transformation pips.
"postScale" applies transform scaling to the selected element(s)
after applying all other transformations. | TransformContainer | ||
| Method | Defined By | ||
|---|---|---|---|
applySelection():void
Adds the selection indicators and transform pips to the selected
elements. | TransformContainer | ||
clearSelection():void
Clear out the selected elements and updates selection. | TransformContainer | ||
| Method | Defined By | ||
|---|---|---|---|
contentGroupHandler(event:Event):void
Handles events for the content group skin part. | TransformContainer | ||
elementHandler(event:Event):void
Handles events on elements added to this container. | TransformContainer | ||
getPipName(pip:IVisualElement):String
Return the english description of which pip is passed. | TransformContainer | ||
getTransformRectangle(targetSpace:DisplayObject):Rectangle
deprecated - use getTransformRectangle2() instead. | TransformContainer | ||
getTransformRectangle2(targetSpace:IVisualElement):Rectangle
Return the transform lasso rectangle that bounds all the selected
elements. | TransformContainer | ||
handleSelection(element:IVisualElement, event:MouseEvent = null):void
Takes the passed element and the mouse event that occurred contextually
in relation to the passed element and figures out how to adjust the
selected elements. | TransformContainer | ||
isElementSelected(element:IVisualElement):Boolean
Checks whether the passed element is in the selectedElements vector. | TransformContainer | ||
mouseHandler(event:MouseEvent):void
Handles mouse event. | TransformContainer | ||
removeAllDynamicParts(factory:String):void
Remove all instances of the passed dynamic part factory. | TransformContainer | ||
removeCursorGroup(groupName:String):void
Remove the cursor group. | TransformContainer | ||
selectedElementDraggingHandler(event:Event):void
Handles events related to element dragging. | TransformContainer | ||
setCursorFromCSS(bitmapStyle:String, hotspotStyle:String, groupName:String, priority:Number):Boolean
Set the cursor based on a CSS style. | TransformContainer | ||
setHover(currentHover:IVisualElement):void
Sets the hover indicator. | TransformContainer | ||
setResizeCursor(name:String, priority:Number, groupName:String):void
Set the current cursor to the resize cursor. | TransformContainer | ||
transformPipHandler(event:Event):void
Handles all transform events and transform dragging. | TransformContainer | ||
| Event | Summary | Defined By | ||
|---|---|---|---|---|
| Dispatched when the selection changes. | TransformContainer | |||
| Dispatched when a visual element drag ends. | TransformContainer | |||
| Dispatched while a visual element is being dragged. | TransformContainer | |||
| Dispatched when a visual element drag begins. | TransformContainer | |||
| Dispatched when the hovered element changes. | TransformContainer | |||
| Dispatched when a transform ends. | TransformContainer | |||
| Dispatched when a transform is in progress. | TransformContainer | |||
| Dispatched when a transform begins. | TransformContainer | |||
This component uses skins made up of skin parts. Do not set the skin parts directly. The component's skin sets the skin parts.
| allowMultipleSelection | property |
public var allowMultipleSelection:Boolean = trueTrue to allow the user to select multiple elements when the "ctrl" or "shift" key is down during selection.
The default value is true.
| dragEnabled | property |
public var dragEnabled:Boolean = trueTrue to enable element dragging.
The default value is true.
| excludedPips | property |
excludedPips:ArrayAn array of the pips to not display over selected elements.
Only relevant if the "showSelectionIndicators" property is true.
The default value is null.
public function get excludedPips():Array public function set excludedPips(value:Array):void| hoveredElement | property |
hoveredElement:IVisualElement [read-only] The currently hovered visual element.
The is property is bindable. Bound to the "hoveredElementChanged" event.
The default value is null.
This property can be used as the source for data binding.
public function get hoveredElement():IVisualElement| lockAspectRatio | property |
public var lockAspectRatio:Boolean = falseTrue lock the aspect ratio when transforming.
The default value is false.
| selectedElements | property |
selectedElements:Vector.<IVisualElement>A vector of the selected visual elements.
The is property is bindable. Bound to the "change" event.
The default value is null.
This property can be used as the source for data binding.
public function get selectedElements():Vector.<IVisualElement> public function set selectedElements(value:Vector.<IVisualElement>):void| showHoverIndicator | property |
showHoverIndicator:BooleanTrue to display the hoverIndicatorPart when mousing over child visual elements.
The default value is true.
public function get showHoverIndicator():Boolean public function set showHoverIndicator(value:Boolean):void| showSelectionIndicators | property |
showSelectionIndicators:BooleanTrue to display the selection indicators over selected elements.
The default value is true.
public function get showSelectionIndicators():Boolean public function set showSelectionIndicators(value:Boolean):void| transformMode | property |
transformMode:String
See the TransformModes class for possible values.
"none" applies no transformation and does not display the transformation pips.
"postScale" applies transform scaling to the selected element(s) after applying all other transformations. This mode can add large amounts of skew to transformed elements.
"preScale" mode applies scaling before applying any other transformations and does not change the element's skew.
"explicit" applies changes in size to explicit width and height values. "explicit" is useful for text or containers when distortion is not desired. The element's scaling is not changed and the element's minWidth, maxWidth, minHeight, and maxHeight settings will be respected.
"postScale" allows the user to skew elements while "preScale" and "explicit" mode will not add additional skew.
NOTE: this property is irrelevant if multiple elements are selected. If multiple elements are selected, the "postScale" transformMode is applied automatically.
The default value is "preScale".
public function get transformMode():String public function set transformMode(value:String):void| applySelection | () | method |
public function applySelection():voidAdds the selection indicators and transform pips to the selected elements.
| clearSelection | () | method |
public function clearSelection():voidClear out the selected elements and updates selection.
| contentGroupHandler | () | method |
protected function contentGroupHandler(event:Event):voidHandles events for the content group skin part.
Parameters
event:Event — the Event that triggered the handler
|
| elementHandler | () | method |
protected function elementHandler(event:Event):voidHandles events on elements added to this container.
Parameters
event:Event — the Event that triggered this handler
|
| getPipName | () | method |
protected function getPipName(pip:IVisualElement):StringReturn the english description of which pip is passed.
Parameters
pip:IVisualElement — the Pip
|
String — the String english text description of the pip
|
| getTransformRectangle | () | method |
protected function getTransformRectangle(targetSpace:DisplayObject):Rectangledeprecated - use getTransformRectangle2() instead. getBounds() isn't terribly reliable.
Returns the transform lasso rectangle that bounds all the selected elements.
Parameters
targetSpace:DisplayObject |
Rectangle — Rectangle
|
| getTransformRectangle2 | () | method |
protected function getTransformRectangle2(targetSpace:IVisualElement):RectangleReturn the transform lasso rectangle that bounds all the selected elements.
Improved version of getTransformRectangle2(). Does not use getBounds().
Parameters
targetSpace:IVisualElement — the coordinate space to use
|
Rectangle — Rectangle
|
| handleSelection | () | method |
protected function handleSelection(element:IVisualElement, event:MouseEvent = null):voidTakes the passed element and the mouse event that occurred contextually in relation to the passed element and figures out how to adjust the selected elements.
Parameters
element:IVisualElement — the IVisualElement acted upon by a Mouse Event
| |
event:MouseEvent (default = null) — the MouseEvent that acted on the IVisualElement
|
| isElementSelected | () | method |
protected function isElementSelected(element:IVisualElement):BooleanChecks whether the passed element is in the selectedElements vector.
Parameters
element:IVisualElement — the IVisualElement to check
|
Boolean — a Boolean
|
| mouseHandler | () | method |
protected function mouseHandler(event:MouseEvent):voidHandles mouse event.
Parameters
event:MouseEvent — the MouseEvent that triggered the handler
|
| removeAllDynamicParts | () | method |
protected function removeAllDynamicParts(factory:String):voidRemove all instances of the passed dynamic part factory.
Parameters
factory:String — the name of the factory
|
| removeCursorGroup | () | method |
protected function removeCursorGroup(groupName:String):voidRemove the cursor group.
Parameters
groupName:String |
| selectedElementDraggingHandler | () | method |
protected function selectedElementDraggingHandler(event:Event):voidHandles events related to element dragging.
Parameters
event:Event — the Event that triggered the handler
|
| setCursorFromCSS | () | method |
protected function setCursorFromCSS(bitmapStyle:String, hotspotStyle:String, groupName:String, priority:Number):BooleanSet the cursor based on a CSS style.
Parameters
bitmapStyle:String — the css style to retrieve the bitmap asset
| |
hotspotStyle:String — the css style hotspot for the bitmap asset
| |
groupName:String — the groupName to apply to the cursor
| |
priority:Number |
Boolean — true is cursor successfully changed
|
| setHover | () | method |
protected function setHover(currentHover:IVisualElement):voidSets the hover indicator.
Parameters
currentHover:IVisualElement — the IVisualElement that is currently hovered
|
| setResizeCursor | () | method |
protected function setResizeCursor(name:String, priority:Number, groupName:String):voidSet the current cursor to the resize cursor. Wil change the angle to reflect the moused pip.
Parameters
name:String | |
priority:Number | |
groupName:String |
| transformPipHandler | () | method |
protected function transformPipHandler(event:Event):voidHandles all transform events and transform dragging.
Parameters
event:Event — the Event that triggered the handler
|
| change | Event |
ardisia.components.transformContainer.events.TransformContainerEventardisia.components.transformContainer.events.TransformContainerEventDispatched when the selection changes.
| elementDragEnd | Event |
ardisia.components.transformContainer.events.TransformContainerEventardisia.components.transformContainer.events.TransformContainerEventDispatched when a visual element drag ends.
| elementDragging | Event |
ardisia.components.transformContainer.events.TransformContainerEventardisia.components.transformContainer.events.TransformContainerEventDispatched while a visual element is being dragged.
| elementDragStart | Event |
ardisia.components.transformContainer.events.TransformContainerEventardisia.components.transformContainer.events.TransformContainerEventDispatched when a visual element drag begins.
| hoveredElementChanged | Event |
flash.events.Eventflash.events.EventDispatched when the hovered element changes.
| transformDragEnd | Event |
ardisia.components.transformContainer.events.TransformContainerEventardisia.components.transformContainer.events.TransformContainerEventDispatched when a transform ends.
| transformDragging | Event |
ardisia.components.transformContainer.events.TransformContainerEventardisia.components.transformContainer.events.TransformContainerEventDispatched when a transform is in progress.
| transformDragStart | Event |
ardisia.components.transformContainer.events.TransformContainerEventardisia.components.transformContainer.events.TransformContainerEventDispatched when a transform begins.