Skip to content

Commit

Permalink
Added LocalEventMap. This is work in progress class
Browse files Browse the repository at this point in the history
  • Loading branch information
yulaar committed Sep 2, 2008
1 parent 909a268 commit 0f5765a
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions src/com/asfusion/mate/core/LocalEventMap.as
@@ -0,0 +1,57 @@
/*
Copyright 2008 Nahuel Foronda/AsFusion
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. Y
ou may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, s
oftware distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and limitations under the License
Author: Nahuel Foronda, Principal Architect
nahuel at asfusion dot com
@ignore
*/
package com.asfusion.mate.core
{
import com.asfusion.mate.events.DispatcherEvent;

import flash.events.IEventDispatcher;

public class LocalEventMap extends EventMap
{
/*-.........................................dispatcher..........................................*/
/**
* The event dispatcher that will be used in the EventMap.
*/
public function get dispatcher():IEventDispatcher
{
return currentDispatcher;
}
public function set dispatcher(value:IEventDispatcher):void
{
var oldValue:IEventDispatcher = currentDispatcher;
if(oldValue !== value)
{
currentDispatcher = value;
var event:DispatcherEvent = new DispatcherEvent(DispatcherEvent.CHANGE);
event.newDispatcher = value;
event.oldDispatcher = oldValue;
dispatchEvent(event);
}
}
/*-.........................................getDispatcher..........................................*/
/**
* @inheritDoc
*/
override public function getDispatcher():IEventDispatcher
{
return currentDispatcher;
}
}
}

0 comments on commit 0f5765a

Please sign in to comment.