zoukankan      html  css  js  c++  java
  • TransformToolControl.as

    package com.senocular.display {
        
        import flash.display.InteractiveObject;
        import flash.display.MovieClip;
        import flash.geom.Matrix;
        import flash.geom.Point;
        
        
    public class TransformToolControl extends MovieClip {
            
            
    // Variables
            protected var _transformTool:TransformTool;
            protected var _referencePoint:Point;
            protected var _relatedObject:InteractiveObject;
                
            
    // Properties
            
            
    /**
             
    * Reference to TransformTool instance using the control
             
    * This property is defined after using TransformTool.addControl
             
    * prior to being added to the TransformTool display list
             
    * (it can be accessed after the TransformTool.CONTROL_INIT event)
             
    */
            
    public function get transformTool():TransformTool {
                return _transformTool;
            }
            
    public function set transformTool(t:TransformTool):void {
                _transformTool 
    = t;
            }
            
            
    /**
             
    * The object "related" to this control and can be referenced
             
    * if the control needs association with another object.  This is
             
    * used with the default move control to relate itself with the
             
    * tool target (cursors also check for this)
             
    */
            
    public function get relatedObject():InteractiveObject {
                return _relatedObject;
            }
            
    public function set relatedObject(i:InteractiveObject):void {
                _relatedObject 
    = i ? i : this;
            }
            
            
    /**
             
    * A point of reference that can be used to handle transformations
             
    * A TransformTool instance will use this property for offsetting the
             
    * location of the mouse to match the desired start location of the transform
             
    */
            
    public function get referencePoint():Point {
                return _referencePoint;
            }
            
    public function set referencePoint(p:Point):void {
                _referencePoint 
    = p;
            }
            
            
    /**
             
    * Constructor
             
    */
            
    public function TransformToolControl() {
                _relatedObject 
    = this;
            }
            
            
    /**
             
    * Optionally used with transformTool.maintainHandleForm to 
             
    * counter transformations applied to a control by its parents
             
    */
            
    public function counterTransform():void {
                transform.matrix 
    = new Matrix();
                var concatMatrix:Matrix 
    = transform.concatenatedMatrix;
                concatMatrix.invert();
                transform.matrix 
    = concatMatrix;
            }
        }
    }
  • 相关阅读:
    web学习---html,js,php,mysql一个动态网页获取流程
    用正则表达式做替换
    Array.prototype.slice.call(arguments)
    javascript join以及slice,push函数
    SQLServer中跨服务器跨数据库之间的数据操作
    SQL Server里面如何导出包含数据的SQL脚本
    Sql Server 常用日期格式
    Microsoft SQL Server下的SQL语句
    多线程与UI操作(二)
    多线程与UI操作(一)
  • 原文地址:https://www.cnblogs.com/ddw1997/p/1579921.html
Copyright © 2011-2022 走看看