| Package | com.senocular.display.transform |
| Class | public class TransformTool |
| Inheritance | TransformTool flash.display.Sprite |
| Property | Defined By | ||
|---|---|---|---|
| autoRaise : Boolean
When true, the targets will raise to the top of their
display lists, though not above the Transform Tool, when
assigned as targets of the tool. | TransformTool | ||
| baseMatrix : Matrix [read-only]
The "committed" matrix transformation of a target
object. | TransformTool | ||
| bottomLeft : Point
A reference point (metric) indicating the location of the local
bottom left corner of the target object in the TransformTool
coordinate space. | TransformTool | ||
| bottomRight : Point
A reference point (metric) indicating the location of the local
bottom right corner of the target object in the TransformTool
coordinate space. | TransformTool | ||
| calculatedMatrix : Matrix [read-only]
The current transformation matrix of the Transform Tool. | TransformTool | ||
| controls : Array
A representation of the TransformTool's display list in
array form. | TransformTool | ||
| cursor : DisplayObject
The cursor to be displayed by the Transform Tool. | TransformTool | ||
| cursorEvent : Event [read-only]
The event that invoked a change in the cursor. | TransformTool | ||
| cursorHidesMouse : Boolean
When true, the native mouse cursor will be hidden with
Mouse.hide() when the cursor is non-null. | TransformTool | ||
| isActive : Boolean
Indicates that a transform control has assumed control
of the tool for interaction. | TransformTool | ||
| livePreview : Boolean
When true, the target is visually transformed with the tool
between target commits as the user changes the transform with
interactive controls. | TransformTool | ||
| localRegistration : Point [read-only]
The current location of the registration point in the context
of the target object's coordinate space. | TransformTool | ||
| maxHeight : Number
The maximum height along the transformed y axis that a target
object is allowed to have. | TransformTool | ||
| maxRotation : Number
The maximum rotation allowed for a transformed target object. | TransformTool | ||
| maxScaleX : Number
The maximum scale along the transformed x axis that a target
object is allowed to have. | TransformTool | ||
| maxScaleY : Number
The maximum scale along the transformed y axis that a target
object is allowed to have. | TransformTool | ||
| maxWidth : Number
The maximum width along the transformed x axis that a target
object is allowed to have. | TransformTool | ||
| minHeight : Number
The minimum height along the transformed y axis that a target
object is allowed to have. | TransformTool | ||
| minRotation : Number
The minimum rotation allowed for a transformed target object. | TransformTool | ||
| minScaleX : Number
The minimum scale along the transformed x axis that a target
object is allowed to have. | TransformTool | ||
| minScaleY : Number
The minimum scale along the transformed y axis that a target
object is allowed to have. | TransformTool | ||
| minWidth : Number
The minimum width along the transformed x axis that a target
object is allowed to have. | TransformTool | ||
| negativeScaling : Boolean
Determines whether or not transforming is allowed to result in
negative scales. | TransformTool | ||
| postTransform : Matrix [read-only] | TransformTool | ||
| preTransform : Matrix [read-only] | TransformTool | ||
| registration : Point
A reference point (metric) indicating the location of the
registration point within the TransformTool coordinate space. | TransformTool | ||
| registrationManager : RegistrationManager
The registration manager used to keep track of registration
points in target objects. | TransformTool | ||
| target : DisplayObject
Target display object to be transformed by the TransformTool. | TransformTool | ||
| targetEvent : Event [read-only]
A saved reference to the event that selected the
target when TransformTool.select was used. | TransformTool | ||
| targetEventMouse : Point [read-only] | TransformTool | ||
| topLeft : Point
A reference point (metric) indicating the location of the local
top left corner of the target object in the TransformTool
coordinate space. | TransformTool | ||
| topRight : Point
A reference point (metric) indicating the location of the local
top right corner of the target object in the TransformTool
coordinate space. | TransformTool | ||
| transformMethod : String
Determines the method by which tool transformations
are applied to the target display object. | TransformTool | ||
| Property | Defined By | ||
|---|---|---|---|
| _baseMatrix : Matrix | TransformTool | ||
| _calculatedMatrix : Matrix | TransformTool | ||
| _cursorEvent : Event | TransformTool | ||
| _postTransform : Matrix | TransformTool | ||
| _preTransform : Matrix | TransformTool | ||
| _targetEvent : Event | TransformTool | ||
| _targetEventMouse : Point | TransformTool | ||
| Method | Defined By | ||
|---|---|---|---|
TransformTool(controls:Array = null, registrationManager:RegistrationManager = null)
Constructor for new TransformTool instances. | TransformTool | ||
calculateTransform(reset:Boolean = true, enforceNegativeScaling:Boolean = true):void
Calculates the value of calculatedMatrix by applying the values of
preTransform and postTransform to the baseMatrix. | TransformTool | ||
commitTarget():void
Applies the calculatedMatrix transform to the target
object and commits the target to the transformation. | TransformTool | ||
deselect(event:Event):void
Helper selection handler for deselecting target objects. | TransformTool | ||
fitToTarget():void
Fits the Transform Tool to match the current state of the target. | TransformTool | ||
getHeight():Number
Returns the height of the target object based on its size within
its transformed y axis and the current value of calculatedMatrix. | TransformTool | ||
getRotation():Number
Returns the rotation of target object based on the current value
of calculatedMatrix. | TransformTool | ||
getRotationX(matrix:Matrix = null):Number
Returns the rotation of a matrix on its x axis. | TransformTool | ||
getRotationY(matrix:Matrix = null):Number
Returns the rotation of a matrix on its y axis. | TransformTool | ||
getScaleX(matrix:Matrix = null):Number
Returns the scale of a matrix along its x axis. | TransformTool | ||
getScaleY(matrix:Matrix = null):Number
Returns the scale of a matrix along its y axis. | TransformTool | ||
getWidth():Number
Returns the width of the target object based on its size within
its transformed x axis and the current value of calculatedMatrix. | TransformTool | ||
isPositiveScale(matrix:Matrix = null):Boolean
Determines if a matrix is scaled positively or not. | TransformTool | ||
matrixEquals(m1:Matrix, m2:Matrix = null):Boolean
Compares two matrices to see if they're equal. | TransformTool | ||
normalizeBase(amount:Number = 1):Boolean
For zero-scale transformations, this function will reset
the base scale to represent a positive value represented
by the amount value. | TransformTool | ||
raise():void
Moves the Transform Tool and the target object to the tops
of their respective parent display lists. | TransformTool | ||
resetRegistration():void
Resets the registration point to its default location relative
to the (0,0) position in the target object's local coordinate
space. | TransformTool | ||
resetTransform():void
Resets the transformation of the target object to it's
unmodified state. | TransformTool | ||
restrictRotation():void
Applies restrictions to rotation. | TransformTool | ||
restrictScale(enforceNegativeScaling:Boolean = true):void
Applies restrictions to scaling. | TransformTool | ||
saveRegistration():void
Saves the current registration point value in localRegistration to
the registration manager. | TransformTool | ||
select(event:Event):void
Helper selection handler for selecting target objects. | TransformTool | ||
setCursor(value:DisplayObject, cursorEvent:Event = null):void
Sets the cursor for the transform tool with a respective cursor
event that identifies the event that caused the change in the cursor. | TransformTool | ||
setHeight(value:Number):void
Sets the height of calculatedMatrix based on the size of the
current target. | TransformTool | ||
setRotation(value:Number, matrix:Matrix = null):void
Sets the rotation of a matrix. | TransformTool | ||
setScaleX(value:Number, matrix:Matrix = null):void
Sets the scale of a matrix along its x axis. | TransformTool | ||
setScaleY(value:Number, matrix:Matrix = null):void
Sets the scale of a matrix along its y axis. | TransformTool | ||
setTarget(value:DisplayObject, targetEvent:Event = null):void | TransformTool | ||
setWidth(value:Number):void
Sets the width of calculatedMatrix based on the size of the
current target. | TransformTool | ||
update(commit:Boolean = true):void
Performs a full update of the Transform Tool. | TransformTool | ||
updateControls():void
Dispatches an update event (REDRAW) allowing controls
within the tool to update themselves to match the
current calculatedMatrix transform. | TransformTool | ||
updateMetrics():void
Updates references used to identify points of interest in the
Transform Tool. | TransformTool | ||
updateTarget():void
Applies the calculatedMatrix transform to the target
object. | TransformTool | ||
| Method | Defined By | ||
|---|---|---|---|
applyRegistrationOffset():void
Adds registration offset to transformation matrix. | TransformTool | ||
applyTransformToTarget():Boolean
Applies the transform defined by calculatedMatrix to the target
object. | TransformTool | ||
cleanupCursor():void
Cleanup steps when defining a new cursor value. | TransformTool | ||
cleanupTarget():void
Cleanup steps when defining a new target value. | TransformTool | ||
resetTransformModifiers(resetBase:Boolean = true):void
Resets the values of preTransform, postTransform, and optionally
baseMatrix to their defaults. | TransformTool | ||
restrict(enforceNegativeScaling:Boolean = true):void
Goes under the assumption that scaling is handled by
the preTransform and rotation is handled by the
postTransform matrices. | TransformTool | ||
retrieveRegistration():void
Retrieves the current registration point from the registration
manager assigning it to localRegistration. | TransformTool | ||
setupCursor():void
Setup steps when defining a new cursor value. | TransformTool | ||
setupTarget():void | TransformTool | ||
validateTargetMatrix():Boolean | TransformTool | ||
| Constant | Defined By | ||
|---|---|---|---|
| COMMIT : String = commit [static]
Event constant for commit event types. | TransformTool | ||
| CURSOR_CHANGED : String = cursorChanged [static]
Event constant for cursorChanged event types. | TransformTool | ||
| REDRAW : String = redraw [static]
Event constant for redraw event types. | TransformTool | ||
| RESTRICT : String = restrict [static]
Event constant for restrict event types. | TransformTool | ||
| TARGET_CHANGED : String = targetChanged [static]
Event constant for targetChanged event types. | TransformTool | ||
| TARGET_TRANSFORMED : String = targetTransformed [static]
Event constant for targetTransformed event types. | TransformTool | ||
| TRANSFORM_CHANGED : String = transformChanged [static]
Event constant for transformChanged event types. | TransformTool | ||
| TRANSFORM_MATRIX : String = matrix [static]
Transform method for transforming a target object by updating
DisplayObject.transform.matrix. | TransformTool | ||
| TRANSFORM_PROPERTIES : String = properties [static]
Transform method for transforming a target object by updating
properties such as DisplayObject.width, DisplayObject.height and
DisplayObject.rotation. | TransformTool | ||
| _baseMatrix | property |
protected var _baseMatrix:Matrix| _calculatedMatrix | property |
protected var _calculatedMatrix:Matrix| _cursorEvent | property |
protected var _cursorEvent:Event| _postTransform | property |
protected var _postTransform:Matrix| _preTransform | property |
protected var _preTransform:Matrix| _targetEvent | property |
protected var _targetEvent:Event| _targetEventMouse | property |
protected var _targetEventMouse:Point| autoRaise | property |
autoRaise:BooleanWhen true, the targets will raise to the top of their display lists, though not above the Transform Tool, when assigned as targets of the tool.
public function get autoRaise():Boolean public function set autoRaise(value:Boolean):void| baseMatrix | property |
baseMatrix:Matrix [read-only] The "committed" matrix transformation of a target object. This is the matrix on which other transformations are based. This is set when the target is set and when is committed with methods like commitTarget(). When preTransform and postTransform are applied, they're applied to the baseMatrix value to resolve the calculatedMatrix.
public function get baseMatrix():Matrix| bottomLeft | property |
public var bottomLeft:PointA reference point (metric) indicating the location of the local bottom left corner of the target object in the TransformTool coordinate space.
| bottomRight | property |
public var bottomRight:PointA reference point (metric) indicating the location of the local bottom right corner of the target object in the TransformTool coordinate space.
| calculatedMatrix | property |
calculatedMatrix:Matrix [read-only] The current transformation matrix of the Transform Tool. This is updated when the target is defined and when calculateTransform is called. Controls will automatically call calculateTransform when used, updating the calculatedMatrix during transformations.
public function get calculatedMatrix():Matrix| controls | property |
controls:ArrayA representation of the TransformTool's display list in array form. Control sets are assigned to this property.
public function get controls():Array public function set controls(value:Array):void| cursor | property |
cursor:DisplayObjectThe cursor to be displayed by the Transform Tool. Cursors are generally defined in and set by controls. Using the ControlCursor control, the cursor can be seen in the TransformTool instance itself. Otherwise, cursors will have to be manually displayed by listening for the CURSOR_CHANGED event.
public function get cursor():DisplayObject public function set cursor(value:DisplayObject):void| cursorEvent | property |
cursorEvent:Event [read-only] The event that invoked a change in the cursor.
public function get cursorEvent():Event| cursorHidesMouse | property |
cursorHidesMouse:BooleanWhen true, the native mouse cursor will be hidden with Mouse.hide() when the cursor is non-null.
public function get cursorHidesMouse():Boolean public function set cursorHidesMouse(value:Boolean):void| isActive | property |
isActive:BooleanIndicates that a transform control has assumed control of the tool for interaction. Other controls would check this value to see if it is able to interact with the tool without interference from other controls.
public function get isActive():Boolean public function set isActive(value:Boolean):void| livePreview | property |
livePreview:BooleanWhen true, the target is visually transformed with the tool between target commits as the user changes the transform with interactive controls. If false, target objects are only updated when the target is committed which (typically) occurs only after interaction with a control has completed.
public function get livePreview():Boolean public function set livePreview(value:Boolean):void| localRegistration | property |
localRegistration:Point [read-only] The current location of the registration point in the context of the target object's coordinate space. This value will always be a Point instance. When there is no target, the value will be (0, 0). The registration manager uses this value to store registration points for objects.
public function get localRegistration():Point| maxHeight | property |
maxHeight:NumberThe maximum height along the transformed y axis that a target object is allowed to have. If both a maxHeight and maxScaleY are specified, the value resulting in the smallest value will be used.
public function get maxHeight():Number public function set maxHeight(value:Number):void| maxRotation | property |
maxRotation:NumberThe maximum rotation allowed for a transformed target object. Ranges between minRotation and maxRotation depend on which value of the two is greater.
public function get maxRotation():Number public function set maxRotation(value:Number):void| maxScaleX | property |
maxScaleX:NumberThe maximum scale along the transformed x axis that a target object is allowed to have. If both a maxWidth and maxScaleX are specified, the value resulting in the smallest value will be used.
public function get maxScaleX():Number public function set maxScaleX(value:Number):void| maxScaleY | property |
maxScaleY:NumberThe maximum scale along the transformed y axis that a target object is allowed to have. If both a maxHeight and maxScaleY are specified, the value resulting in the smallest value will be used.
public function get maxScaleY():Number public function set maxScaleY(value:Number):void| maxWidth | property |
maxWidth:NumberThe maximum width along the transformed x axis that a target object is allowed to have. If both a maxWidth and maxScaleX are specified, the value resulting in the smallest value will be used.
public function get maxWidth():Number public function set maxWidth(value:Number):void| minHeight | property |
minHeight:NumberThe minimum height along the transformed y axis that a target object is allowed to have. If both a minHeight and minScaleY are specified, the value resulting in the highest value will be used.
public function get minHeight():Number public function set minHeight(value:Number):void| minRotation | property |
minRotation:NumberThe minimum rotation allowed for a transformed target object. Ranges between minRotation and maxRotation depend on which value of the two is greater.
public function get minRotation():Number public function set minRotation(value:Number):void| minScaleX | property |
minScaleX:NumberThe minimum scale along the transformed x axis that a target object is allowed to have. If both a minWidth and minScaleX are specified, the value resulting in the highest value will be used.
public function get minScaleX():Number public function set minScaleX(value:Number):void| minScaleY | property |
minScaleY:NumberThe minimum scale along the transformed y axis that a target object is allowed to have. If both a minHeight and minScaleY are specified, the value resulting in the highest value will be used.
public function get minScaleY():Number public function set minScaleY(value:Number):void| minWidth | property |
minWidth:NumberThe minimum width along the transformed x axis that a target object is allowed to have. If both a minWidth and minScaleX are specified, the value resulting in the highest value will be used.
public function get minWidth():Number public function set minWidth(value:Number):void| negativeScaling | property |
negativeScaling:BooleanDetermines whether or not transforming is allowed to result in negative scales. When true, negative scaling is allowed and a transformed target object can be mirrored along its x and/or y axes. When false, negative scaling is not allowed and scale for both axes will always be positive.
public function get negativeScaling():Boolean public function set negativeScaling(value:Boolean):void| postTransform | property |
postTransform:Matrix [read-only] public function get postTransform():Matrix| preTransform | property |
preTransform:Matrix [read-only] public function get preTransform():Matrix| registration | property |
public var registration:PointA reference point (metric) indicating the location of the registration point within the TransformTool coordinate space.
| registrationManager | property |
registrationManager:RegistrationManagerThe registration manager used to keep track of registration points in target objects. When using multiple instances of TransformTool, you may want to have each instance use the same registration manager so that each Transform Tool uses the same registration points for objects.
public function get registrationManager():RegistrationManager public function set registrationManager(value:RegistrationManager):voidArgumentError — The specified value is null.
|
| target | property |
target:DisplayObjectTarget display object to be transformed by the TransformTool.
public function get target():DisplayObject public function set target(value:DisplayObject):void| targetEvent | property |
targetEvent:Event [read-only] A saved reference to the event that selected the target when TransformTool.select was used. This allows controls to use that event to perform appropriate actions during selection, such as starting a drag (move) operation on the target.
public function get targetEvent():Event| targetEventMouse | property |
targetEventMouse:Point [read-only] public function get targetEventMouse():Point| topLeft | property |
public var topLeft:PointA reference point (metric) indicating the location of the local top left corner of the target object in the TransformTool coordinate space.
| topRight | property |
public var topRight:PointA reference point (metric) indicating the location of the local top right corner of the target object in the TransformTool coordinate space.
| transformMethod | property |
transformMethod:StringDetermines the method by which tool transformations are applied to the target display object.
public function get transformMethod():String public function set transformMethod(value:String):void| TransformTool | () | Constructor |
public function TransformTool(controls:Array = null, registrationManager:RegistrationManager = null)Constructor for new TransformTool instances.
Parameterscontrols:Array (default = null) — An array of controls to be added to the display
list.
| |
registrationManager:RegistrationManager (default = null) — The registration manager to use for
target objects assigned to this TransformTool instance. If one is
not specified, one is created automatically.
|
| applyRegistrationOffset | () | method |
protected function applyRegistrationOffset():voidAdds registration offset to transformation matrix. This assumes deriveFinalTransform has already been called.
| applyTransformToTarget | () | method |
protected function applyTransformToTarget():BooleanApplies the transform defined by calculatedMatrix to the target object. How this is applied depends on the value of transformMethod.
ReturnsBoolean — True if the target object was changed, false if not.
|
| calculateTransform | () | method |
public function calculateTransform(reset:Boolean = true, enforceNegativeScaling:Boolean = true):voidCalculates the value of calculatedMatrix by applying the values of preTransform and postTransform to the baseMatrix. The value of calculatedMatrix is used when transforms are being applied to the tool and its target object.
Parameters
reset:Boolean (default = true) — When true, the preTransform and postTransform
modifiers will be reset to their identity matrix after the
calculation is complete.
| |
enforceNegativeScaling:Boolean (default = true) — When false, scale restrictions that
use negativeScaling to restrict calculatedMatrix are ignored.
|
| cleanupCursor | () | method |
protected function cleanupCursor():voidCleanup steps when defining a new cursor value. You may need to override this method to control the order of operations when adding content to the set cursor setter. This is called before a new cursor value is set.
| cleanupTarget | () | method |
protected function cleanupTarget():voidCleanup steps when defining a new target value. You may need to override this method to control the order of operations when adding content to the set target setter. This is called before a new target value is set.
| commitTarget | () | method |
public function commitTarget():voidApplies the calculatedMatrix transform to the target object and commits the target to the transformation. This will reset all transformation modifiers (preTransform and postTransform) and set the baseMatrix to the updated transform of the target.
| deselect | () | method |
public function deselect(event:Event):voidHelper selection handler for deselecting target objects. Set this handler as the listener for an event that would cause the deselection of a target object.
Parameters
event:Event |
| fitToTarget | () | method |
public function fitToTarget():voidFits the Transform Tool to match the current state of the target. Use this when the target object is transformed outside of the Transform Tool.
| getHeight | () | method |
public function getHeight():NumberReturns the height of the target object based on its size within its transformed y axis and the current value of calculatedMatrix. This is different from the normal height reported by DisplayObject which is based on the height of the object within its parent's coordinate space. If no target exists 0 is returned.
ReturnsNumber — The height of the target object.
|
| getRotation | () | method |
public function getRotation():NumberReturns the rotation of target object based on the current value of calculatedMatrix. A matrix's general rotation is based on the rotation of its x axis.
ReturnsNumber — The rotation of a matrix in radians.
|
| getRotationX | () | method |
public function getRotationX(matrix:Matrix = null):NumberReturns the rotation of a matrix on its x axis.
Parameters
matrix:Matrix (default = null) — The matrix from which to find a rotation. If not
specified, calculatedMatrix is used.
|
Number — The rotation of a matrix along it's x axis in radians.
|
| getRotationY | () | method |
public function getRotationY(matrix:Matrix = null):NumberReturns the rotation of a matrix on its y axis.
Parameters
matrix:Matrix (default = null) — The matrix from which to find a rotation. If not
specified, calculatedMatrix is used.
|
Number — The rotation of a matrix along it's y axis in radians.
|
| getScaleX | () | method |
public function getScaleX(matrix:Matrix = null):NumberReturns the scale of a matrix along its x axis.
Parameters
matrix:Matrix (default = null) — The matrix from which to get the scale. If not
specified, calculatedMatrix is used.
|
Number — The scale of a matrix along its x axis.
|
| getScaleY | () | method |
public function getScaleY(matrix:Matrix = null):NumberReturns the scale of a matrix along its y axis.
Parameters
matrix:Matrix (default = null) — The matrix from which to get the scale. If not
specified, calculatedMatrix is used.
|
Number — The scale of a matrix along its y axis.
|
| getWidth | () | method |
public function getWidth():NumberReturns the width of the target object based on its size within its transformed x axis and the current value of calculatedMatrix. This is different from the normal width reported by DisplayObject which is based on the width of the object within its parent's coordinate space. If no target exists 0 is returned.
ReturnsNumber — The height of the target object.
|
| isPositiveScale | () | method |
public function isPositiveScale(matrix:Matrix = null):BooleanDetermines if a matrix is scaled positively or not.
Parameters
matrix:Matrix (default = null) — The matrix to determine if it is positively scaled.
If not specified, calculatedMatrix is used.
|
Boolean — Returns true if the matrix is positively scaled, false if
not.
|
| matrixEquals | () | method |
public function matrixEquals(m1:Matrix, m2:Matrix = null):BooleanCompares two matrices to see if they're equal.
Parameters
m1:Matrix — A matrix to be compared with another matrix.
| |
m2:Matrix (default = null) — The matrix to be compared with the first matrix.
If this value is not provided calculatedMatrix is used.
|
Boolean — True if the matrices match, false if not.
|
| normalizeBase | () | method |
public function normalizeBase(amount:Number = 1):BooleanFor zero-scale transformations, this function will reset the base scale to represent a positive value represented by the amount value. This would be needed if transformations expect a non-zero scale, for example if scaling the existing scale which, if zero, would not scale at all.
Parameters
amount:Number (default = 1) — The amount by which the base transformation
is normalized in scale. This amount is a pixel value based
on the internal bounds of the target object.
|
Boolean — True if the base transform was normalized at all,
false if no changes were made.
|
| raise | () | method |
public function raise():voidMoves the Transform Tool and the target object to the tops of their respective parent display lists. This is automatically called when a target is set and autoRaise is true.
| resetRegistration | () | method |
public function resetRegistration():voidResets the registration point to its default location relative to the (0,0) position in the target object's local coordinate space.
| resetTransform | () | method |
public function resetTransform():voidResets the transformation of the target object to it's unmodified state.
| resetTransformModifiers | () | method |
protected function resetTransformModifiers(resetBase:Boolean = true):voidResets the values of preTransform, postTransform, and optionally baseMatrix to their defaults. The pre and post transforms are set to their identity matrices. The baseMatrix is set to the transform matrix of the target object.
Parameters
resetBase:Boolean (default = true) — When true, baseMatrix is reset along with
preTransform and postTransform.
|
| restrict | () | method |
protected function restrict(enforceNegativeScaling:Boolean = true):voidGoes under the assumption that scaling is handled by the preTransform and rotation is handled by the postTransform matrices.
Parameters
enforceNegativeScaling:Boolean (default = true) |
| restrictRotation | () | method |
public function restrictRotation():voidApplies restrictions to rotation.
| restrictScale | () | method |
public function restrictScale(enforceNegativeScaling:Boolean = true):voidApplies restrictions to scaling.
Parameters
enforceNegativeScaling:Boolean (default = true) — When false, the value of negativeScaling
is not enforced when restricting scale. This should be set to false when
rotating a the Transform Tool since rotation can result in what could be
considered a negative scale.
|
| retrieveRegistration | () | method |
protected function retrieveRegistration():voidRetrieves the current registration point from the registration manager assigning it to localRegistration.
| saveRegistration | () | method |
public function saveRegistration():voidSaves the current registration point value in localRegistration to the registration manager.
| select | () | method |
public function select(event:Event):voidHelper selection handler for selecting target objects. Set this handler as the listener for a MouseEvent.MOUSE_DOWN event of an object or a container of objects to have targets automatically set to the Transform Tool when clicked. This event handler uses either Event.target or Event.currentTarget as TransformTool.target depending on which is in the same display object container as the Transform Tool itself.
Parameters
event:Event |
| setCursor | () | method |
public function setCursor(value:DisplayObject, cursorEvent:Event = null):voidSets the cursor for the transform tool with a respective cursor event that identifies the event that caused the change in the cursor.
Parameters
value:DisplayObject — The cursor display object to be used for the current
Transform Tool cursor.
| |
cursorEvent:Event (default = null) — The event that invoked the change in the cursor.
|
| setHeight | () | method |
public function setHeight(value:Number):voidSets the height of calculatedMatrix based on the size of the current target. If target is null or the value passed is not a number, calculatedMatrix is unchanged.
Parameters
value:Number — The height value for the target object.
|
| setRotation | () | method |
public function setRotation(value:Number, matrix:Matrix = null):voidSets the rotation of a matrix. The rotation set is based on the x axis.
Parameters
value:Number — A new rotation value in radians.
| |
matrix:Matrix (default = null) — The matrix on which to set a rotation. If not
specified, calculatedMatrix is used.
|
| setScaleX | () | method |
public function setScaleX(value:Number, matrix:Matrix = null):voidSets the scale of a matrix along its x axis.
Parameters
value:Number — The matrix for which to set a scale. If not
specified, calculatedMatrix is used.
| |
matrix:Matrix (default = null) |
| setScaleY | () | method |
public function setScaleY(value:Number, matrix:Matrix = null):voidSets the scale of a matrix along its y axis.
Parameters
value:Number — The matrix for which to set a scale. If not
specified, calculatedMatrix is used.
| |
matrix:Matrix (default = null) |
| setTarget | () | method |
public function setTarget(value:DisplayObject, targetEvent:Event = null):voidParameters
value:DisplayObject | |
targetEvent:Event (default = null) |
| setupCursor | () | method |
protected function setupCursor():voidSetup steps when defining a new cursor value. You may need to override this method to control the order of operations when adding content to the set cursor setter. This is called after a new cursor value is set.
| setupTarget | () | method |
protected function setupTarget():void| setWidth | () | method |
public function setWidth(value:Number):voidSets the width of calculatedMatrix based on the size of the current target. If target is null or the value passed is not a number, calculatedMatrix is unchanged.
Parameters
value:Number — The height value for the target object.
|
| update | () | method |
public function update(commit:Boolean = true):voidPerforms a full update of the Transform Tool. This includes: updating the metrics, updating the target (with optional commit) and updating the controls.
Parameters
commit:Boolean (default = true) — When true, the target is updated with a call
to commitTarget. When false, updateTarget is used.
|
| updateControls | () | method |
public function updateControls():voidDispatches an update event (REDRAW) allowing controls within the tool to update themselves to match the current calculatedMatrix transform.
| updateMetrics | () | method |
public function updateMetrics():voidUpdates references used to identify points of interest in the Transform Tool. These include points like the registration point, topLeft, bottomRight, etc. Metrics should be updated when the calculatedMatrix is updated and controls need to be redrawn as many controls use these properties to position themselves.
| updateTarget | () | method |
public function updateTarget():voidApplies the calculatedMatrix transform to the target object. Updates are only applied here if livePreview is true. For non-livePreview updates, commitTarget is required.
| validateTargetMatrix | () | method |
protected function validateTargetMatrix():BooleanReturnsBoolean |
| COMMIT | Constant |
public static const COMMIT:String = commitEvent constant for commit event types.
| CURSOR_CHANGED | Constant |
public static const CURSOR_CHANGED:String = cursorChangedEvent constant for cursorChanged event types.
| REDRAW | Constant |
public static const REDRAW:String = redrawEvent constant for redraw event types.
| RESTRICT | Constant |
public static const RESTRICT:String = restrictEvent constant for restrict event types.
| TARGET_CHANGED | Constant |
public static const TARGET_CHANGED:String = targetChangedEvent constant for targetChanged event types.
| TARGET_TRANSFORMED | Constant |
public static const TARGET_TRANSFORMED:String = targetTransformedEvent constant for targetTransformed event types.
| TRANSFORM_CHANGED | Constant |
public static const TRANSFORM_CHANGED:String = transformChangedEvent constant for transformChanged event types.
| TRANSFORM_MATRIX | Constant |
public static const TRANSFORM_MATRIX:String = matrixTransform method for transforming a target object by updating DisplayObject.transform.matrix.
| TRANSFORM_PROPERTIES | Constant |
public static const TRANSFORM_PROPERTIES:String = propertiesTransform method for transforming a target object by updating properties such as DisplayObject.width, DisplayObject.height and DisplayObject.rotation.