チェンジセット 2556

差分発生行の前後
無視リスト:
コミット日時:
2009/05/02 01:29:48 (3 年前)
コミッタ:
seagirl
ログメッセージ:

大枠だいたい出来た

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/GeniusFramework/branches/2.0/app-template/script/build.properties

    r2553 r2556  
    22APP_ROOT=${basedir}/.. 
    33MAIN_APP=${APP_ROOT}/src/[% name %].mxml 
    4 OUTPUT_BIN=${basedir}/bin-debug/[% name %].swf 
     4OUTPUT_BIN=${basedir}/../bin-debug/[% name %].swf 
  • as3/GeniusFramework/branches/2.0/app-template/src/MyApp.mxml

    r2555 r2556  
    33        xmlns:mx="http://www.adobe.com/2006/mxml" 
    44        xmlns:local="*" 
    5         xmlns:views="views.*" 
     5        xmlns:views="[% package %].views.*" 
    66        layout="absolute" 
    77        pageTitle="[% name %]"> 
  • as3/GeniusFramework/branches/2.0/app-template/src/MyAppConfig.as

    r2484 r2556  
    11package 
    22{ 
    3         public class Config 
     3        import jp.seagirl.genius.core.IConfig; 
     4         
     5        public class [% name %]Config implements IConfig 
    46        { 
    57                // アプリケーションの名前 
    6                 public static const APPLICATION_NAME:String = '[% name %]'; 
     8                public function get applicationName():String 
     9                { 
     10                        return '[% name %]'; 
     11                } 
    712                 
    813                // アプリケーションのバージョン 
    9                 public static const APPLICATION_VERSION:String = '1.0.0';        
     14                public function get applicationVersion():String 
     15                { 
     16                        return '1.0.0'; 
     17                } 
    1018                 
    1119                // デフォルトの状態 
    12                 public static const DEFAULT_STATE:Object = { page: 'Page1' }; 
    13  
     20                public function get defaultState():Object 
     21                { 
     22                        return { page: 'Page1' }; 
     23                } 
     24                 
    1425        } 
    1526} 
  • as3/GeniusFramework/branches/2.0/app-template/src/MyAppDelegate.as

    r2555 r2556  
    88        import jp.seagirl.genius.views.ApplicationDelegate; 
    99         
    10         import mx.binding.utils.BindingUtils; 
    1110        import mx.core.UIComponent; 
    1211         
     
    1817                 
    1918                /** 
    20                  * アプリケーション情報を登録します。  
     19                 * アプリケーション設定ファイルを初期化  
    2120                 */              
    22                 override protected function initializeApplication():void 
     21                override protected function initializeConfig():void 
    2322                { 
    24                         context.name = Config.APPLICATION_NAME; 
    25                         context.version = Config.APPLICATION_VERSION;            
    26                         context.traceApplicationInformation(); 
    27                 } 
    28                  
    29                 /** 
    30                  * アプリケーションの状態を登録します。  
    31                  */              
    32                 override protected function initializeState():void 
    33                 { 
    34                         context.defaultState = Config.DEFAULT_STATE; 
    35                          
    36                         if (!context.state.hasOwnProperty('page')) 
    37                                 context.state = Config.DEFAULT_STATE; 
    38                                  
    39                         BindingUtils.bindSetter(changePage, context, 'state'); 
     23                        config = new [% name %]Config(); 
    4024                } 
    4125                 
     
    4529                override protected function initializeModels():void 
    4630                {                        
    47                         //context.addModel(new MainModel()); 
     31                        //addModel(new MainModel()); 
    4832                } 
    4933                 
     
    5337                override protected function initializeControllers():void 
    5438                { 
    55                         context.addController(new Page1Controller(view.page1)); 
    56                         context.addController(new Page2Controller(view.page2)); 
     39                        addController(new Page1Controller(view.page1)); 
     40                        addController(new Page2Controller(view.page2)); 
    5741                } 
    5842                 
    5943                /** 
    60                  * 状態に変化があると呼び出されるコールバック関数です。 
     44                 * 状態に変化があると呼び出されます。。 
    6145                 */              
    62                 private function changePage(data:Object):void 
     46                override protected function changePage(data:Object):void 
    6347                { 
    64                         if (data == null) 
    65                                 return; 
    66                                  
    6748                        var child:UIComponent; 
    6849                         
  • as3/GeniusFramework/branches/2.0/bin/build.xml

    r2553 r2556  
    3333                </copy> 
    3434                 
    35                 <move file="${app_root}/src/main.mxml" tofile="${app_root}/src/${name}.mxml" /> 
    36                 <move file="${app_root}/src/mainDelegate.as" tofile="${app_root}/src/${name}Delegate.as" /> 
     35                <move file="${app_root}/src/MyApp.mxml" tofile="${app_root}/src/${name}.mxml" /> 
     36                <move file="${app_root}/src/MyAppDelegate.as" tofile="${app_root}/src/${name}Delegate.as" /> 
     37                <move file="${app_root}/src/MyAppConfig.as" tofile="${app_root}/src/${name}Config.as" /> 
    3738                <move file="${app_root}/src/main.css" tofile="${app_root}/src/${name}.css" /> 
    3839                <move file="${app_root}/src/main-config.xml" tofile="${app_root}/src/${name}-config.xml" /> 
  • as3/GeniusFramework/branches/2.0/src/jp/seagirl/genius/views/ApplicationDelegate.as

    r2555 r2556  
    2626 package jp.seagirl.genius.views 
    2727{ 
     28        import jp.seagirl.genius.controllers.ViewController; 
    2829        import jp.seagirl.genius.core.Context; 
     30        import jp.seagirl.genius.core.IConfig; 
     31        import jp.seagirl.genius.models.Model; 
    2932         
     33        import mx.binding.utils.BindingUtils; 
    3034        import mx.core.Application; 
    3135         
     
    5054                } 
    5155                 
     56                protected var config:IConfig; 
     57                 
    5258                override protected function preinitialize():void 
    5359                { 
    54                         context = new Context(); 
    55                          
    5660                        if (this['view'] is Application) 
    5761                                SWFWheel.initialize(Application(this['view']).systemManager.stage); 
     
    6468                override protected function initialize():void 
    6569                { 
    66                         initializeApplication(); 
    67                         initializeState(); 
     70                        initializeConfig(); 
     71                        initializeContext(); 
    6872                        initializeModels(); 
    6973                        initializeControllers(); 
    7074                } 
    7175                 
    72                 protected function initializeApplication():void 
     76                protected function initializeConfig():void 
    7377                { 
    74                          
     78                        if (config == null) 
     79                                throw new Error("IConfig インスタンスが設定されていません。") 
    7580                } 
    7681                 
    77                 protected function initializeState():void 
     82                protected function initializeContext():void 
    7883                { 
     84                        context = new Context(); 
     85                        context.name = config.applicationName; 
     86                        context.version = config.applicationVersion; 
     87                        context.traceApplicationInformation(); 
    7988                         
     89                        context.defaultState = config.defaultState; 
     90                         
     91                        if (!context.state.hasOwnProperty('page')) 
     92                                context.state = config.defaultState; 
     93                                 
     94                        BindingUtils.bindSetter(onContextStateChange, context, 'state'); 
    8095                } 
    8196                 
     
    90105                } 
    91106                 
     107                protected function changePage(data:Object):void 
     108                { 
     109                         
     110                } 
     111                 
     112                public function getModel(modelName:String):Model 
     113                { 
     114                        return context.getModel(modelName); 
     115                } 
     116                 
     117                public function hasModel(modelName:String):Boolean 
     118                { 
     119                        return context.hasModel(modelName); 
     120                } 
     121                 
     122                public function addModel(model:Model):void 
     123                { 
     124                        context.addModel(model); 
     125                } 
     126                 
     127                public function removeModel(modelName:String):Model 
     128                { 
     129                        return context.removeModel(modelName); 
     130                } 
     131                 
     132                public function getController(controllerName:String):ViewController 
     133                { 
     134                        return context.getController(controllerName); 
     135                } 
     136                 
     137                public function hasController(controllerName:String):Boolean 
     138                { 
     139                        return context.hasController(controllerName); 
     140                } 
     141                 
     142                public function addController(controller:ViewController):void 
     143                { 
     144                        context.addController(controller); 
     145                } 
     146                 
     147                public function removeController(controllerName:String):ViewController 
     148                { 
     149                        return context.removeController(controllerName); 
     150                } 
     151                 
     152                /** 
     153                 * 状態に変化があると呼び出されるコールバック関数です。 
     154                 */              
     155                private function onContextStateChange(data:Object):void 
     156                { 
     157                        if (data == null) 
     158                                return; 
     159                         
     160                        changePage(data); 
     161                } 
     162                 
    92163        } 
    93164}