control.as

来自「用于flash/flex的 as3的 2D图形图像图表的动态生成」· AS 代码 · 共 60 行

AS
60
字号
package flare.vis.controls
{
	import flare.util.Filter;
	
	import flash.display.InteractiveObject;
	import flash.events.EventDispatcher;

	/**
	 * Base class for interactive controls.
	 */
	public class Control extends EventDispatcher implements IControl
	{
		/** @private */
		protected var _object:InteractiveObject;
		/** @private */
		protected var _filter:Function;
		
		/** Boolean function indicating the items considered by the control.
		 *  @see flare.util.Filter */
		public function get filter():Function { return _filter; }
		public function set filter(f:*):void { _filter = Filter.$(f); }
		
		/**
		 * Creates a new Control
		 */
		public function Control() {
			// do nothing
		}
		
		/** @inheritDoc */
		public function get object():InteractiveObject
		{
			return _object;
		}
		
		/** @inheritDoc */
		public function attach(obj:InteractiveObject):void
		{
			if (_object) detach();
			_object = obj;
		}
		
		/** @inheritDoc */
		public function detach():InteractiveObject
		{
			var obj:InteractiveObject = _object;
			_object = null;	
			return obj;
		}
		
		// -- MXML ------------------------------------------------------------
		
		/** @private */
		public function initialized(document:Object, id:String):void
		{
			// do nothing
		}
		
	} // end of class Control
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?