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

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

?? view.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.core
{

	import org.puremvc.as3.interfaces.*;
	import org.puremvc.as3.patterns.observer.Observer;

	/**
	 * A Singleton <code>IView</code> implementation.
	 * 
	 * <P>
	 * In PureMVC, the <code>View</code> class assumes these responsibilities:
	 * <UL>
	 * <LI>Maintain a cache of <code>IMediator</code> instances.</LI>
	 * <LI>Provide methods for registering, retrieving, and removing <code>IMediators</code>.</LI>
	 * <LI>Notifiying <code>IMediators</code> when they are registered or removed.</LI>
	 * <LI>Managing the observer lists for each <code>INotification</code> in the application.</LI>
	 * <LI>Providing a method for attaching <code>IObservers</code> to an <code>INotification</code>'s observer list.</LI>
	 * <LI>Providing a method for broadcasting an <code>INotification</code>.</LI>
	 * <LI>Notifying the <code>IObservers</code> of a given <code>INotification</code> when it broadcast.</LI>
	 * </UL>
	 * 
	 * @see org.puremvc.as3.patterns.mediator.Mediator Mediator
	 * @see org.puremvc.as3.patterns.observer.Observer Observer
	 * @see org.puremvc.as3.patterns.observer.Notification Notification
	 */
	public class View implements IView
	{
		
		/**
		 * Constructor. 
		 * 
		 * <P>
		 * This <code>IView</code> implementation is a Singleton, 
		 * so you should not call the constructor 
		 * directly, but instead call the static Singleton 
		 * Factory method <code>View.getInstance()</code>
		 * 
		 * @throws Error Error if Singleton instance has already been constructed
		 * 
		 */
		public function View( )
		{
			if (instance != null) throw Error(SINGLETON_MSG);
			instance = this;
			mediatorMap = new Array();
			observerMap = new Array();	
			initializeView();	
		}
		
		/**
		 * Initialize the Singleton View instance.
		 * 
		 * <P>
		 * Called automatically by the constructor, this
		 * is your opportunity to initialize the Singleton
		 * instance in your subclass without overriding the
		 * constructor.</P>
		 * 
		 * @return void
		 */
		protected function initializeView(  ) : void 
		{
		}
	
		/**
		 * View Singleton Factory method.
		 * 
		 * @return the Singleton instance of <code>View</code>
		 */
		public static function getInstance() : IView 
		{
			if ( instance == null ) instance = new View( );
			return instance;
		}
				
		/**
		 * Register an <code>IObserver</code> to be notified
		 * of <code>INotifications</code> with a given name.
		 * 
		 * @param notificationName the name of the <code>INotifications</code> to notify this <code>IObserver</code> of
		 * @param observer the <code>IObserver</code> to register
		 */
		public function registerObserver ( notificationName:String, observer:IObserver ) : void
		{
			if( observerMap[ notificationName ] != null ) {
				observerMap[ notificationName ].push( observer );
			} else {
				observerMap[ notificationName ] = [ observer ];	
			}
		}


		/**
		 * Notify the <code>IObservers</code> for a particular <code>INotification</code>.
		 * 
		 * <P>
		 * All previously attached <code>IObservers</code> for this <code>INotification</code>'s
		 * list are notified and are passed a reference to the <code>INotification</code> in 
		 * the order in which they were registered.</P>
		 * 
		 * @param notification the <code>INotification</code> to notify <code>IObservers</code> of.
		 */
		public function notifyObservers( notification:INotification ) : void
		{
			if( observerMap[ notification.getName() ] != null ) {
				var observers:Array = observerMap[ notification.getName() ] as Array;
				for (var i:Number = 0; i < observers.length; i++) {
					var observer:IObserver = observers[ i ] as IObserver;
					observer.notifyObserver( notification );
				}
			}
		}
						
		/**
		 * Register an <code>IMediator</code> instance with the <code>View</code>.
		 * 
		 * <P>
		 * Registers the <code>IMediator</code> so that it can be retrieved by name,
		 * and further interrogates the <code>IMediator</code> for its 
		 * <code>INotification</code> interests.</P>
		 * <P>
		 * If the <code>IMediator</code> returns any <code>INotification</code> 
		 * names to be notified about, an <code>Observer</code> is created encapsulating 
		 * the <code>IMediator</code> instance's <code>handleNotification</code> method 
		 * and registering it as an <code>Observer</code> for all <code>INotifications</code> the 
		 * <code>IMediator</code> is interested in.</p>
		 * 
		 * @param mediatorName the name to associate with this <code>IMediator</code> instance
		 * @param mediator a reference to the <code>IMediator</code> instance
		 */
		public function registerMediator( mediator:IMediator ) : void
		{
			// Register the Mediator for retrieval by name
			mediatorMap[ mediator.getMediatorName() ] = mediator;
			
			// Get Notification interests, if any.
			var interests:Array = mediator.listNotificationInterests();

			// Register Mediator as an observer for each notification of interests
			if ( interests.length > 0) 
			{
				// Create Observer referencing this mediator's handlNotification method
				var observer:Observer = new Observer( mediator.handleNotification, mediator );

				// Register Mediator as Observer for its list of Notification interests
				for ( var i:Number=0;  i<interests.length; i++ ) {
					registerObserver( interests[i],  observer );
				}			
			}
			
			// alert the mediator that it has been registered
			mediator.onRegister();
			
		}

		/**
		 * Retrieve an <code>IMediator</code> from the <code>View</code>.
		 * 
		 * @param mediatorName the name of the <code>IMediator</code> instance to retrieve.
		 * @return the <code>IMediator</code> instance previously registered with the given <code>mediatorName</code>.
		 */
		public function retrieveMediator( mediatorName:String ) : IMediator
		{
			return mediatorMap[ mediatorName ];
		}

		/**
		 * Remove an <code>IMediator</code> from the <code>View</code>.
		 * 
		 * @param mediatorName name of the <code>IMediator</code> instance to be removed.
		 * @return the <code>IMediator</code> that was removed from the <code>View</code>
		 */
		public function removeMediator( mediatorName:String ) : IMediator
		{
			// Go through the observer list for each notification 
			// in the observer map and remove all Observers with a 
			// reference to the Mediator being removed.
			for ( var notificationName:String in observerMap ) {
				// the observer list for the notification under inspection
				var observers:Array = observerMap[ notificationName ];
				// First, collect the indices of the observers to be removed 
				var removalTargets:Array = new Array();
				for ( var i:int=0;  i< observers.length; i++ ) {
					if ( Observer(observers[i]).compareNotifyContext( retrieveMediator( mediatorName ) ) == true ) {
						removalTargets.push(i);
					}
				}
				// now the removalTargets array has an ascending 
				// list of indices to be removed from the observers array
				// so pop them off the array, effectively going from 
				// highest index value to lowest, and splice each
				// from the observers array. since we're going backwards,
				// the collapsing of the array elements to fill the spliced
				// out element's space does not affect the position of the
				// lower numbered indices we've yet to remove
				var target:int;
				while ( removalTargets.length > 0 ) 
				{
					target = removalTargets.pop();
					observers.splice(target,1);
				}
				// Also, when an notification's observer list length falls to 
				// zero, delete the notification key from the observer map
				if ( observers.length == 0 ) {
					delete observerMap[ notificationName ];		
				}
			}			
			// Remove the to the Mediator from the mediator map and return it
			var mediator:IMediator = mediatorMap[ mediatorName ] as IMediator;
			delete mediatorMap[ mediatorName ];

			// alert the mediator that it has been removed
			if (mediator) mediator.onRemove();
			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 mediatorMap[ mediatorName ] != null;
		}

		// Mapping of Mediator names to Mediator instances
		protected var mediatorMap : Array;

		// Mapping of Notification names to Observer lists
		protected var observerMap	: Array;
		
		// Singleton instance
		protected static var instance	: IView;

		// Message Constants
		protected const SINGLETON_MSG	: String = "View Singleton already constructed!";
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲视频一区在线| 久久色在线观看| 日本亚洲免费观看| 欧美精品一区二区三区四区 | 久久免费偷拍视频| 91污在线观看| 亚洲最大成人网4388xx| 51精品秘密在线观看| 久久国产精品色婷婷| 欧美激情自拍偷拍| 在线观看亚洲精品| 日韩av一区二| 久久蜜桃香蕉精品一区二区三区| 自拍偷拍欧美激情| 欧美精品 日韩| 国产精品亚洲一区二区三区妖精 | 99re成人精品视频| 亚洲资源在线观看| 久久综合九色综合欧美亚洲| 成人精品一区二区三区中文字幕| 欧美精品日韩精品| 琪琪一区二区三区| 中文字幕巨乱亚洲| 91精品国产综合久久久蜜臀粉嫩 | 欧美日韩精品三区| 国产真实乱对白精彩久久| 亚洲精品免费在线| 26uuu色噜噜精品一区二区| 色综合视频在线观看| 久久国内精品视频| 亚洲一区二区三区激情| 国产午夜精品久久久久久免费视 | 91久久奴性调教| 九九热在线视频观看这里只有精品| 欧美色综合影院| 麻豆精品视频在线| 亚洲激情五月婷婷| 久久久.com| 日韩一区二区免费在线观看| 91丨九色丨蝌蚪丨老版| 欧美私人免费视频| 国产98色在线|日韩| 午夜天堂影视香蕉久久| 国产精品国产三级国产普通话蜜臀| 菠萝蜜视频在线观看一区| 奇米精品一区二区三区在线观看一| 欧美美女bb生活片| 一本到高清视频免费精品| 国产在线麻豆精品观看| 免费在线观看一区二区三区| 一区二区三区视频在线看| 久久九九国产精品| 精品国产91洋老外米糕| 7777精品伊人久久久大香线蕉经典版下载| 亚洲国产色一区| 国产精品卡一卡二卡三| 2021中文字幕一区亚洲| 日韩美女主播在线视频一区二区三区| 美女视频免费一区| 亚洲成av人片在线| 亚洲国产精品久久久久秋霞影院| 这里只有精品视频在线观看| 色综合天天综合网国产成人综合天 | 久久久www成人免费毛片麻豆 | 成人永久免费视频| 国产精品一区二区三区网站| 久久精品国产77777蜜臀| 日韩中文字幕91| 青青草一区二区三区| 天堂影院一区二区| 亚洲成人tv网| 三级欧美在线一区| 日韩精品视频网| 日本不卡视频一二三区| 奇米精品一区二区三区在线观看一| 国产色产综合色产在线视频| 久久久久久夜精品精品免费| 欧美变态tickling挠脚心| 日韩精品一区二区三区视频| 精品国产91洋老外米糕| 久久久av毛片精品| 国产精品久久久久久久浪潮网站 | 欧美日韩一区二区三区视频| 91丨九色porny丨蝌蚪| 一本大道综合伊人精品热热 | 成人性生交大片免费看视频在线 | 亚洲欧洲日本在线| 一区二区三区四区在线免费观看| 日韩一区二区电影在线| 日韩欧美久久一区| 欧美激情中文不卡| 一级做a爱片久久| 色综合视频在线观看| 一本久久精品一区二区| 欧美色视频一区| 日韩欧美亚洲国产另类| 国产欧美精品一区二区色综合| 欧美日韩精品一区二区三区| 欧美大片一区二区三区| 精品三级av在线| 国产精品久久久久久久第一福利| 精品日本一线二线三线不卡| 国产欧美视频一区二区| 一区二区久久久久| 国内精品嫩模私拍在线| 97se亚洲国产综合自在线 | 亚洲国产成人自拍| 亚洲精品日韩专区silk| 男人的天堂久久精品| 春色校园综合激情亚洲| 欧美狂野另类xxxxoooo| 久久久99免费| 亚洲大片在线观看| 国产成人在线视频网站| 91国偷自产一区二区开放时间| 国内精品写真在线观看| 色综合天天综合在线视频| 日韩一区二区在线看| 亚洲天堂网中文字| 久久超级碰视频| 一本色道久久综合亚洲aⅴ蜜桃| 国产高清视频一区| 欧美二区乱c少妇| 国产精品久久久久久久久久免费看| 久久综合一区二区| 亚洲综合丝袜美腿| 成人国产视频在线观看| 日韩一区二区三区免费观看| 一区二区三区中文字幕| 韩国三级电影一区二区| 欧美日韩一区二区三区免费看| 欧美三级在线看| 亚洲欧洲成人自拍| 精品亚洲成a人| 欧美亚一区二区| 成人免费视频在线观看| 久久99最新地址| 7777精品伊人久久久大香线蕉超级流畅 | 国产高清一区日本| 欧美精品亚洲一区二区在线播放| 欧美人牲a欧美精品| 国产精品美女久久久久av爽李琼 | 亚洲视频你懂的| 国产一区二区三区香蕉| 日韩一区二区三区四区| 亚洲电影第三页| 99久久亚洲一区二区三区青草| 色哟哟亚洲精品| 中文字幕高清一区| 国产成人精品www牛牛影视| 日韩一级片网站| 日韩成人伦理电影在线观看| 91麻豆swag| 中文字幕在线一区二区三区| 懂色中文一区二区在线播放| 久久婷婷成人综合色| 久久国产精品99久久久久久老狼 | 久久综合丝袜日本网| 日韩国产欧美在线视频| 欧美嫩在线观看| 图片区小说区区亚洲影院| 欧洲国内综合视频| 一区二区三区精品| 91日韩精品一区| 一区二区三区在线视频观看 | 国产精品一二一区| 久久久影院官网| 国产精品自拍一区| 国产日韩高清在线| 波多野结衣的一区二区三区| 日韩一区在线播放| 91福利资源站| 日韩和的一区二区| 精品国产91洋老外米糕| 国产一区二区三区四区五区入口 | 亚洲欧美一区二区三区久本道91| 天天色天天爱天天射综合| 欧美日韩在线播| 免费日本视频一区| 91精品一区二区三区在线观看| 国产午夜一区二区三区| 成人av在线一区二区三区| 亚洲精品国产视频| 欧美日韩国产美女| 国产主播一区二区三区| 国产精品国产三级国产有无不卡 | 欧美成人一区二区| 国产激情一区二区三区四区| 国产精品国产三级国产专播品爱网 | 图片区小说区国产精品视频| 日韩视频一区在线观看| 国产xxx精品视频大全| 亚洲欧美另类久久久精品| 欧美年轻男男videosbes| 国产一区二区三区视频在线播放| 欧美午夜精品一区二区蜜桃| 另类小说色综合网站| 国产精品不卡视频| 在线国产亚洲欧美| 久久99精品久久久久久动态图|