NavigationCommand.as

Go to the documentation of this file.
00001 import gugga.application.ApplicatiotionNavigationalStateMemento;
00002 import gugga.common.ICommand;
00003 import gugga.commands.INavigationCommandReceiver;
00004 
00008 class gugga.commands.NavigationCommand 
00009         implements ICommand 
00010 {
00011         private var mReceiver:INavigationCommandReceiver;
00012         private var mPreviousState:ApplicatiotionNavigationalStateMemento;
00013         private var mNavigateTo:String;
00014         
00015         public function NavigationCommand(aNavigateTo:String)
00016         {
00017                 mReceiver = INavigationCommandReceiver(_global.ApplicationController);
00018                 mNavigateTo = aNavigateTo;
00019         }
00020 
00021         public function execute() : Boolean 
00022         {
00023                 mPreviousState =  mReceiver.createNavigationState();
00024                 return mReceiver.navigateTo(mNavigateTo);
00025         }
00026 
00027         public function isReversible() : Boolean 
00028         {
00029                 return true;
00030         }
00031 
00032         public function undo() : Void 
00033         {
00034                 mReceiver.setNavigationState(mPreviousState);
00035         }
00036         
00037         public function clone():ICommand
00038         {
00039                 var  copy:NavigationCommand =  new NavigationCommand(this.mNavigateTo);
00040                 
00041                 copy.mNavigateTo = this.mNavigateTo;
00042                 copy.mPreviousState = this.mPreviousState;
00043 //              copy.mApplication = this.mApplication;
00044                 copy.mReceiver = this.mReceiver;
00045                 return copy; 
00046         }
00047 }

Generated on Fri May 11 17:12:43 2007 for GuggaFramework by  doxygen 1.5.2