亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? facade.as

?? PureMVC框架
?? AS
字號:
/*
 PureMVC - Copyright(c) 2006-08 Futurescale, Inc., Some rights reserved.
 Your reuse is governed by the Creative Commons Attribution 3.0 United States License
*/
package org.puremvc.as3.patterns.facade
{

	import org.puremvc.as3.core.*;
	import org.puremvc.as3.interfaces.*;
	import org.puremvc.as3.patterns.observer.Notification;

	/**
	 * A base Singleton <code>IFacade</code> implementation.
	 * 
	 * <P>
	 * In PureMVC, the <code>Facade</code> class assumes these 
	 * responsibilities:
	 * <UL>
	 * <LI>Initializing the <code>Model</code>, <code>View</code>
	 * and <code>Controller</code> Singletons.</LI> 
	 * <LI>Providing all the methods defined by the <code>IModel, 
	 * IView, & IController</code> interfaces.</LI>
	 * <LI>Providing the ability to override the specific <code>Model</code>,
	 * <code>View</code> and <code>Controller</code> Singletons created.</LI> 
	 * <LI>Providing a single point of contact to the application for 
	 * registering <code>Commands</code> and notifying <code>Observers</code></LI>
	 * </UL>
	 * <P>
 	 * Example usage:
	 * <listing>
	 *	import org.puremvc.as3.patterns.facade.&lowast;;
	 * 
	 *	import com.me.myapp.model.~~;
	 *	import com.me.myapp.view.~~;
	 *	import com.me.myapp.controller.~~;
	 * 
	 *	public class MyFacade extends Facade
	 *	{
	 *		// Notification constants. The Facade is the ideal
	 *		// location for these constants, since any part
	 *		// of the application participating in PureMVC 
	 *		// Observer Notification will know the Facade.
	 *		public static const GO_COMMAND:String = "go";
	 * 		
	 *		// Override Singleton Factory method 
	 *		public static function getInstance() : MyFacade {
	 *			if (instance == null) instance = new MyFacade();
	 *			return instance as MyFacade;
	 *		}
	 * 		
	 *		// optional initialization hook for Facade
	 *		override public function initializeFacade() : void {
	 *			super.initializeFacade();
	 *			// do any special subclass initialization here
	 *		}
	 *	
	 *		// optional initialization hook for Controller
	 *		override public function initializeController() : void {
	 *			// call super to use the PureMVC Controller Singleton. 
	 *			super.initializeController();
	 * 
	 *			// Otherwise, if you're implmenting your own
	 *			// IController, then instead do:
	 *			// if ( controller != null ) return;
	 *			// controller = MyAppController.getInstance();
	 * 		
	 *			// do any special subclass initialization here
	 *			// such as registering Commands
	 *			registerCommand( GO_COMMAND, com.me.myapp.controller.GoCommand )
	 *		}
	 *	
	 *		// optional initialization hook for Model
	 *		override public function initializeModel() : void {
	 *			// call super to use the PureMVC Model Singleton. 
	 *			super.initializeModel();
	 * 
	 *			// Otherwise, if you're implmenting your own
	 *			// IModel, then instead do:
	 *			// if ( model != null ) return;
	 *			// model = MyAppModel.getInstance();
	 * 		
	 *			// do any special subclass initialization here
	 *			// such as creating and registering Model proxys
	 *			// that don't require a facade reference at
	 *			// construction time, such as fixed type lists
	 *			// that never need to send Notifications.
	 *			regsiterProxy( new USStateNamesProxy() );
	 * 			
	 *			// CAREFUL: Can't reference Facade instance in constructor 
	 *			// of new Proxys from here, since this step is part of
	 *			// Facade construction!  Usually, Proxys needing to send 
	 *			// notifications are registered elsewhere in the app 
	 *			// for this reason.
	 *		}
	 *	
	 *		// optional initialization hook for View
	 *		override public function initializeView() : void {
	 *			// call super to use the PureMVC View Singleton. 
	 *			super.initializeView();
	 * 
	 *			// Otherwise, if you're implmenting your own
	 *			// IView, then instead do:
	 *			// if ( view != null ) return;
	 *			// view = MyAppView.getInstance();
	 * 		
	 *			// do any special subclass initialization here
	 *			// such as creating and registering Mediators
	 *			// that do not need a Facade reference at construction
	 *			// time.
	 *			registerMediator( new LoginMediator() ); 
	 * 
	 *			// CAREFUL: Can't reference Facade instance in constructor 
	 *			// of new Mediators from here, since this is a step
	 *			// in Facade construction! Usually, all Mediators need 
	 *			// receive notifications, and are registered elsewhere in 
	 *			// the app for this reason.
	 *		}
	 *	}
	 * </listing>
	 * 
	 * @see org.puremvc.as3.core.model.Model Model
	 * @see org.puremvc.as3.core.view.View View
	 * @see org.puremvc.as3.core.controller.Controller Controller
	 * @see org.puremvc.as3.patterns.observer.Notification Notification
	 * @see org.puremvc.as3.patterns.mediator.Mediator Mediator
	 * @see org.puremvc.as3.patterns.proxy.Proxy Proxy
	 * @see org.puremvc.as3.patterns.command.SimpleCommand SimpleCommand
	 * @see org.puremvc.as3.patterns.command.MacroCommand MacroCommand
	 */
	public class Facade implements IFacade
	{
		/**
		 * Constructor. 
		 * 
		 * <P>
		 * This <code>IFacade</code> implementation is a Singleton, 
		 * so you should not call the constructor 
		 * directly, but instead call the static Singleton 
		 * Factory method <code>Facade.getInstance()</code>
		 * 
		 * @throws Error Error if Singleton instance has already been constructed
		 * 
		 */
		public function Facade( ) {
			if (instance != null) throw Error(SINGLETON_MSG);
			instance = this;
			initializeFacade();	
		}

		/**
		 * Initialize the Singleton <code>Facade</code> instance.
		 * 
		 * <P>
		 * Called automatically by the constructor. Override in your
		 * subclass to do any subclass specific initializations. Be
		 * sure to call <code>super.initializeFacade()</code>, though.</P>
		 */
		protected function initializeFacade(  ):void {
			initializeModel();
			initializeController();
			initializeView();
		}

		/**
		 * Facade Singleton Factory method
		 * 
		 * @return the Singleton instance of the Facade
		 */
		public static function getInstance():IFacade {
			if (instance == null) instance = new Facade( );
			return instance;
		}

		/**
		 * Initialize the <code>Controller</code>.
		 * 
		 * <P>
		 * Called by the <code>initializeFacade</code> method.
		 * Override this method in your subclass of <code>Facade</code> 
		 * if one or both of the following are true:
		 * <UL>
		 * <LI> You wish to initialize a different <code>IController</code>.</LI>
		 * <LI> You have <code>Commands</code> to register with the <code>Controller</code> at startup.</code>. </LI>		  
		 * </UL>
		 * If you don't want to initialize a different <code>IController</code>, 
		 * call <code>super.initializeController()</code> at the beginning of your
		 * method, then register <code>Command</code>s.
		 * </P>
		 */
		protected function initializeController( ):void {
			if ( controller != null ) return;
			controller = Controller.getInstance();
		}

		/**
		 * Initialize the <code>Model</code>.
		 * 
		 * <P>
		 * Called by the <code>initializeFacade</code> method.
		 * Override this method in your subclass of <code>Facade</code> 
		 * if one or both of the following are true:
		 * <UL>
		 * <LI> You wish to initialize a different <code>IModel</code>.</LI>
		 * <LI> You have <code>Proxy</code>s to register with the Model that do not 
		 * retrieve a reference to the Facade at construction time.</code></LI> 
		 * </UL>
		 * If you don't want to initialize a different <code>IModel</code>, 
		 * call <code>super.initializeModel()</code> at the beginning of your
		 * method, then register <code>Proxy</code>s.
		 * <P>
		 * Note: This method is <i>rarely</i> overridden; in practice you are more
		 * likely to use a <code>Command</code> to create and register <code>Proxy</code>s
		 * with the <code>Model</code>, since <code>Proxy</code>s with mutable data will likely
		 * need to send <code>INotification</code>s and thus will likely want to fetch a reference to 
		 * the <code>Facade</code> during their construction. 
		 * </P>
		 */
		protected function initializeModel( ):void {
			if ( model != null ) return;
			model = Model.getInstance();
		}
		

		/**
		 * Initialize the <code>View</code>.
		 * 
		 * <P>
		 * Called by the <code>initializeFacade</code> method.
		 * Override this method in your subclass of <code>Facade</code> 
		 * if one or both of the following are true:
		 * <UL>
		 * <LI> You wish to initialize a different <code>IView</code>.</LI>
		 * <LI> You have <code>Observers</code> to register with the <code>View</code></LI>
		 * </UL>
		 * If you don't want to initialize a different <code>IView</code>, 
		 * call <code>super.initializeView()</code> at the beginning of your
		 * method, then register <code>IMediator</code> instances.
		 * <P>
		 * Note: This method is <i>rarely</i> overridden; in practice you are more
		 * likely to use a <code>Command</code> to create and register <code>Mediator</code>s
		 * with the <code>View</code>, since <code>IMediator</code> instances will need to send 
		 * <code>INotification</code>s and thus will likely want to fetch a reference 
		 * to the <code>Facade</code> during their construction. 
		 * </P>
		 */
		protected function initializeView( ):void {
			if ( view != null ) return;
			view = View.getInstance();
		}

		/**
		 * Register an <code>ICommand</code> with the <code>Controller</code> by Notification name.
		 * 
		 * @param notificationName the name of the <code>INotification</code> to associate the <code>ICommand</code> with
		 * @param commandClassRef a reference to the Class of the <code>ICommand</code>
		 */
		public function registerCommand( notificationName:String, commandClassRef:Class ):void 
		{
			controller.registerCommand( notificationName, commandClassRef );
		}

		/**
		 * Remove a previously registered <code>ICommand</code> to <code>INotification</code> mapping from the Controller.
		 * 
		 * @param notificationName the name of the <code>INotification</code> to remove the <code>ICommand</code> mapping for
		 */
		public function removeCommand( notificationName:String ):void 
		{
			controller.removeCommand( notificationName );
		}

		/**
		 * Check if a Command is registered for a given Notification 
		 * 
		 * @param notificationName
		 * @return whether a Command is currently registered for the given <code>notificationName</code>.
		 */
		public function hasCommand( notificationName:String ) : Boolean
		{
			return controller.hasCommand(notificationName);
		}

		/**
		 * Register an <code>IProxy</code> with the <code>Model</code> by name.
		 * 
		 * @param proxyName the name of the <code>IProxy</code>.
		 * @param proxy the <code>IProxy</code> instance to be registered with the <code>Model</code>.
		 */
		public function registerProxy ( proxy:IProxy ):void	
		{
			model.registerProxy ( proxy );	
		}
				
		/**
		 * Retrieve an <code>IProxy</code> from the <code>Model</code> by name.
		 * 
		 * @param proxyName the name of the proxy to be retrieved.
		 * @return the <code>IProxy</code> instance previously registered with the given <code>proxyName</code>.
		 */
		public function retrieveProxy ( proxyName:String ):IProxy 
		{
			return model.retrieveProxy ( proxyName );	
		}

		/**
		 * Remove an <code>IProxy</code> from the <code>Model</code> by name.
		 *
		 * @param proxyName the <code>IProxy</code> to remove from the <code>Model</code>.
		 * @return the <code>IProxy</code> that was removed from the <code>Model</code>
		 */
		public function removeProxy ( proxyName:String ):IProxy 
		{
			var proxy:IProxy;
			if ( model != null ) proxy = model.removeProxy ( proxyName );	
			return proxy
		}

		/**
		 * Check if a Proxy is registered
		 * 
		 * @param proxyName
		 * @return whether a Proxy is currently registered with the given <code>proxyName</code>.
		 */
		public function hasProxy( proxyName:String ) : Boolean
		{
			return model.hasProxy( proxyName );
		}

		/**
		 * Register a <code>IMediator</code> with the <code>View</code>.
		 * 
		 * @param mediatorName the name to associate with this <code>IMediator</code>
		 * @param mediator a reference to the <code>IMediator</code>
		 */
		public function registerMediator( mediator:IMediator ):void 
		{
			if ( view != null ) view.registerMediator( mediator );
		}

		/**
		 * Retrieve an <code>IMediator</code> from the <code>View</code>.
		 * 
		 * @param mediatorName
		 * @return the <code>IMediator</code> previously registered with the given <code>mediatorName</code>.
		 */
		public function retrieveMediator( mediatorName:String ):IMediator 
		{
			return view.retrieveMediator( mediatorName ) as IMediator;
		}

		/**
		 * Remove an <code>IMediator</code> from the <code>View</code>.
		 * 
		 * @param mediatorName name of the <code>IMediator</code> to be removed.
		 * @return the <code>IMediator</code> that was removed from the <code>View</code>
		 */
		public function removeMediator( mediatorName:String ) : IMediator 
		{
			var mediator:IMediator;
			if ( view != null ) mediator = view.removeMediator( mediatorName );			
			return mediator;
		}

		/**
		 * Check if a Mediator is registered or not
		 * 
		 * @param mediatorName
		 * @return whether a Mediator is registered with the given <code>mediatorName</code>.
		 */
		public function hasMediator( mediatorName:String ) : Boolean
		{
			return view.hasMediator( mediatorName );
		}

		/**
		 * Create and send an <code>INotification</code>.
		 * 
		 * <P>
		 * Keeps us from having to construct new notification 
		 * instances in our implementation code.
		 * @param notificationName the name of the notiification to send
		 * @param body the body of the notification (optional)
		 * @param type the type of the notification (optional)
		 */ 
		public function sendNotification( notificationName:String, body:Object=null, type:String=null ):void 
		{
			notifyObservers( new Notification( notificationName, body, type ) );
		}

		/**
		 * Notify <code>Observer</code>s.
		 * <P>
		 * This method is left public mostly for backward 
		 * compatibility, and to allow you to send custom 
		 * notification classes using the facade.</P>
		 *<P> 
		 * Usually you should just call sendNotification
		 * and pass the parameters, never having to 
		 * construct the notification yourself.</P>
		 * 
		 * @param notification the <code>INotification</code> to have the <code>View</code> notify <code>Observers</code> of.
		 */
		public function notifyObservers ( notification:INotification ):void {
			if ( view != null ) view.notifyObservers( notification );
		}

		// Private references to Model, View and Controller
		protected var controller : IController;
		protected var model		 : IModel;
		protected var view		 : IView;
		
		// The Singleton Facade instance.
		protected static var instance : IFacade; 
		
		// Message Constants
		protected const SINGLETON_MSG	: String = "Facade Singleton already constructed!";
	
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕中文字幕一区二区| 成人永久免费视频| 欧美精品久久99| 日av在线不卡| 久久青草欧美一区二区三区| 国产精品一级黄| 亚洲欧美在线视频观看| 欧洲激情一区二区| 天天影视涩香欲综合网| 日韩精品中文字幕一区二区三区 | 精品乱人伦一区二区三区| 国产专区综合网| ㊣最新国产の精品bt伙计久久| 色噜噜久久综合| 日韩黄色免费电影| 久久综合九色综合欧美就去吻| 福利电影一区二区| 一个色综合网站| 日韩亚洲电影在线| 国产成人精品免费| 亚洲成人精品影院| 亚洲精品一区二区精华| 97久久超碰国产精品| 日韩在线一区二区三区| 国产午夜精品一区二区| 91视频在线看| 久久电影国产免费久久电影| 中文字幕精品一区二区三区精品| 91成人看片片| 国产毛片精品视频| 亚洲va欧美va天堂v国产综合| 欧美成人官网二区| 欧美色电影在线| 国产成人自拍网| 亚洲成a人v欧美综合天堂下载 | 精品裸体舞一区二区三区| 94-欧美-setu| 激情综合色综合久久综合| 亚洲精品国产一区二区三区四区在线| 日韩三级免费观看| 色噜噜偷拍精品综合在线| 国产乱码精品一区二区三区av | 欧美激情一区二区三区在线| 欧美日韩国产高清一区二区三区| 国产不卡在线播放| 免费人成网站在线观看欧美高清| 成人免费一区二区三区视频| 精品国产免费久久| 欧美福利视频导航| 色先锋久久av资源部| 高清beeg欧美| 久久99最新地址| 日韩一区精品字幕| 一区二区免费在线| 中文字幕在线观看不卡| 久久久久久毛片| 日韩西西人体444www| 欧美男男青年gay1069videost| 色综合久久久久久久久久久| 成人美女视频在线观看18| 国产裸体歌舞团一区二区| 九色|91porny| 看电视剧不卡顿的网站| 五月激情综合色| 午夜精品免费在线观看| 亚洲国产精品欧美一二99| 国产精品超碰97尤物18| 国产欧美日韩精品一区| 中文字幕欧美激情一区| 国产日韩欧美高清| 国产日韩精品一区二区三区| 国产亚洲欧美日韩俺去了| xnxx国产精品| 久久久久国产精品人| 久久伊99综合婷婷久久伊| 亚洲精品在线三区| 久久亚洲综合av| 欧美精彩视频一区二区三区| 国产欧美一区二区精品仙草咪| 久久精品人人做人人综合 | 精品视频123区在线观看| 91国偷自产一区二区使用方法| 99国产一区二区三精品乱码| 91麻豆精品一区二区三区| 色狠狠av一区二区三区| 欧美探花视频资源| 欧美亚洲高清一区二区三区不卡| 欧洲在线/亚洲| 制服丝袜亚洲网站| 精品日韩在线观看| 欧美国产精品劲爆| 亚洲欧美成aⅴ人在线观看| 亚洲综合色丁香婷婷六月图片| 亚洲成人动漫在线免费观看| 全部av―极品视觉盛宴亚洲| 国内精品久久久久影院一蜜桃| 成人自拍视频在线观看| 色婷婷激情综合| 337p亚洲精品色噜噜噜| 国产欧美综合在线观看第十页| 国产精品久久久久久一区二区三区| 亚洲欧美日本在线| 麻豆精品久久精品色综合| 国产成人在线视频网址| 日本乱码高清不卡字幕| 日韩欧美一二三四区| 中文字幕欧美激情一区| 狠狠色2019综合网| 欧美日韩的一区二区| 538prom精品视频线放| 日韩精品一区二区三区蜜臀| 国产日产欧美一区二区视频| 亚洲色图第一区| 日韩精品乱码av一区二区| 激情欧美一区二区| 91在线视频在线| 欧美一区二区在线播放| 日本一区二区电影| 日韩精品一区第一页| 丁香婷婷综合网| 欧美酷刑日本凌虐凌虐| 国产欧美日韩另类视频免费观看| 亚洲国产综合人成综合网站| 国产精品一区二区久久精品爱涩 | 成人午夜视频在线观看| 欧美日韩三级一区| 中文字幕精品一区二区精品绿巨人| 国产黑丝在线一区二区三区| 欧美午夜理伦三级在线观看| 欧美高清一级片在线观看| 日韩—二三区免费观看av| 91麻豆精品一区二区三区| www国产亚洲精品久久麻豆| 亚洲国产aⅴ天堂久久| 高清久久久久久| 欧美r级电影在线观看| 亚洲国产视频一区二区| 成人一区二区三区在线观看| 日韩一区二区免费电影| 一区二区三区四区在线免费观看| 国产黑丝在线一区二区三区| 日韩视频在线永久播放| 亚洲成a人v欧美综合天堂下载| 成人高清视频在线| 国产网站一区二区三区| 久久99精品国产麻豆不卡| 欧美精品aⅴ在线视频| 一区二区三区在线视频观看| 不卡电影一区二区三区| 久久久精品国产免费观看同学| 美日韩一级片在线观看| 欧美精品色一区二区三区| 樱桃视频在线观看一区| eeuss鲁片一区二区三区| 久久免费视频一区| 精品亚洲国产成人av制服丝袜| 欧美精品黑人性xxxx| 丝袜亚洲精品中文字幕一区| 欧美性感一区二区三区| 亚洲亚洲人成综合网络| 91日韩一区二区三区| 综合色天天鬼久久鬼色| 99re66热这里只有精品3直播 | 国产一区二区三区综合| 日韩欧美中文字幕公布| 青娱乐精品视频在线| 日韩一区二区三区在线观看| 奇米四色…亚洲| 日韩欧美一区在线观看| 久久精品国产一区二区| 日韩午夜在线观看| 国产在线一区观看| 国产精品素人视频| av电影在线不卡| 亚洲另类在线一区| 欧美写真视频网站| 青青草97国产精品免费观看 | www.亚洲国产| 日韩伦理电影网| 日本韩国精品一区二区在线观看| 亚洲精品美腿丝袜| 欧美男男青年gay1069videost | 毛片不卡一区二区| 久久影院视频免费| a在线播放不卡| 亚洲午夜私人影院| 日韩欧美一级二级| 成人手机在线视频| 亚洲乱码一区二区三区在线观看| 欧美亚洲免费在线一区| 日本aⅴ亚洲精品中文乱码| 久久久综合精品| 色综合久久精品| 日日夜夜免费精品| 国产亚洲成aⅴ人片在线观看| www.久久久久久久久| 婷婷丁香激情综合| 久久综合中文字幕| 日本道精品一区二区三区| 日av在线不卡|