チェンジセット 759

差分発生行の前後
無視リスト:
コミット日時:
2008/07/03 15:50:37 (2 ヶ月前)
コミッタ:
seagirl
ログメッセージ:

サンプル全体を Thread を使ったものに書き換える
BusinessDelegate? Command Controller Event は
使わないことを推奨するようにする

ファイル:

凡例:

変更無し
追加
削除
更新
コピー
移動
  • as3/GeniusFramework/samples/flex/src/jp/seagirl/sample/core/Application.as

    r756 r759  
    33        import jp.seagirl.genius.core.Application; 
    44        import jp.seagirl.genius.managers.ApplicationManager; 
    5         import jp.seagirl.sample.controllers.Controller; 
    65        import jp.seagirl.sample.views.Main; 
    76         
     
    1211 
    1312        public class Application extends jp.seagirl.genius.core.Application 
    14         { 
    15                 //-------------------------------------------------------------------------- 
    16                 // 
    17                 //  Class constants 
    18                 // 
    19                 //-------------------------------------------------------------------------- 
    20                  
     13        {                
    2114                public static const APPLICATION_NAME:String = 'Portfolio'; 
    2215                public static const APPLICATION_VERSION:String = '1.0.0'; 
    23                  
    2416                public static const DEFAULT_PAGE:String = 'Intro'; 
    25                  
    26                 //-------------------------------------------------------------------------- 
    27                 // 
    28                 //  Constructor 
    29                 // 
    30                 //-------------------------------------------------------------------------- 
    3117                 
    3218                public function Application() 
     
    4329                } 
    4430                 
    45                 //-------------------------------------------------------------------------- 
    46                 // 
    47                 //  Variables 
    48                 // 
    49                 //-------------------------------------------------------------------------- 
     31                private var applicationManager:ApplicationManager; 
    5032                 
    51                 private var applicationManager:ApplicationManager; 
    52                 private var controller:Controller; 
    53                  
    54                 //-------------------------------------------------------------------------- 
    55                 // 
    56                 //  Properties 
    57                 // 
    58                 //-------------------------------------------------------------------------- 
    59                  
    60                 //---------------------------------- 
    61                 //  UIComponents 
    62                 //---------------------------------- 
    63                  
     33                // Using MXML 
    6434                public var mainView:Main; 
    65  
    66                  
    67                 //-------------------------------------------------------------------------- 
    68                 // 
    69                 //  Methods 
    70                 // 
    71                 //-------------------------------------------------------------------------- 
    72                  
    73                  
    74                 //-------------------------------------------------------------------------- 
    75                 // 
    76                 //  Overridden handlers 
    77                 // 
    78                 //-------------------------------------------------------------------------- 
    79                  
    80                 override protected function preinitializeHandler(event:FlexEvent):void 
    81                 { 
    82                         controller = Controller.instance; 
    83                 } 
    8435                 
    8536                override protected function initializeHandler(event:FlexEvent):void 
     
    9142                } 
    9243                 
    93                 //-------------------------------------------------------------------------- 
    94                 // 
    95                 //  Event handlers 
    96                 // 
    97                 //-------------------------------------------------------------------------- 
    98                  
    9944        } 
    10045} 
  • as3/GeniusFramework/samples/flex/src/jp/seagirl/sample/threads/GeniusThread.as

    r757 r759  
    11package jp.seagirl.sample.threads 
    22{ 
     3        import flash.net.URLRequest; 
     4        import flash.net.URLVariables; 
     5         
    36        import org.libspark.thread.Thread; 
    47        import org.libspark.thread.threads.net.URLLoaderThread; 
    58 
    69        public class GeniusThread extends Thread 
    7         {                
     10        {                       
    811                protected var data:Object; 
    912                protected var loaderThread:URLLoaderThread; 
     13                protected var request:URLRequest = new URLRequest(); 
     14                protected var variables:URLVariables = new URLVariables(); 
    1015                 
    1116                public function startWithData(data:Object):void 
  • as3/GeniusFramework/samples/flex/src/jp/seagirl/sample/views/AmazonBase.as

    r758 r759  
    33        import jp.seagirl.genius.views.ViewBase; 
    44        import jp.seagirl.sample.models.AmazonModel; 
    5         import jp.seagirl.sample.threads.AmazonLoadThread; 
     5        import jp.seagirl.sample.threads.*; 
     6        import jp.seagirl.sample.threads.amazon.LoadAmazonThread; 
    67         
    78        import mx.binding.utils.ChangeWatcher; 
     
    2122                override protected function updateView():void 
    2223                { 
    23                         new AmazonLoadThread().startWithData({ id: 1234 }); 
    24                         //new GeniusEvent(Controller.AMAZON_LOAD).dispatch(); 
     24                        new LoadAmazonThread().start(); 
    2525                } 
    2626                 
  • as3/GeniusFramework/samples/flex/src/jp/seagirl/sample/views/MainBase.as

    r638 r759  
    88        import jp.seagirl.genius.managers.ApplicationManager; 
    99        import jp.seagirl.genius.views.ViewBase; 
    10         import jp.seagirl.sample.controllers.Controller
     10        import jp.seagirl.sample.threads.ChangeStateThread
    1111         
    1212        import mx.binding.utils.BindingUtils; 
    1313        import mx.containers.VBox; 
    1414        import mx.containers.ViewStack; 
    15         import mx.events.FlexEvent; 
    1615 
    1716        public class MainBase extends ViewBase 
     
    4746                        } 
    4847                         
    49                         new GeniusEvent(Controller.STATE_CHANGE).dispatch(); 
     48                        new ChangeStateThread().start(); 
    5049                } 
    5150                 
    5251                private function titleClickHandler(event:MouseEvent):void 
    5352                { 
    54                         new GeniusEvent(Controller.STATE_CHANGE).dispatch(); 
     53                        new ChangeStateThread().start(); 
    5554                } 
    5655                 
     
    5857                { 
    5958                        var page:String = Link(event.currentTarget).name; 
    60                         new GeniusEvent(Controller.STATE_CHANGE).dispatch({ page: page }); 
     59                        new ChangeStateThread().startWithData({ page: page }); 
    6160                } 
    6261                 
  • as3/GeniusFramework/samples/flex/src/jp/seagirl/sample/views/ThreePaneBase.as

    r638 r759  
    44         
    55        import jp.seagirl.collections.SortCompareFunction; 
    6         import jp.seagirl.genius.controllers.GeniusEvent; 
    76        import jp.seagirl.genius.views.ViewBase; 
    8         import jp.seagirl.sample.controllers.Controller; 
    97        import jp.seagirl.sample.models.ThreePaneModel; 
     8        import jp.seagirl.sample.threads.threePane.LoadThreePaneThread; 
    109         
    1110        import mx.binding.utils.ChangeWatcher; 
     
    1716        import mx.controls.Text; 
    1817        import mx.controls.dataGridClasses.DataGridColumn; 
    19         import mx.events.FlexEvent; 
    2018        import mx.events.PropertyChangeEvent; 
    2119        import mx.formatters.DateFormatter; 
     
    5149                { 
    5250                        CursorManager.setBusyCursor(); 
    53                         new GeniusEvent(Controller.THREE_PANE_LOAD).dispatch(); 
     51                        new LoadThreePaneThread().start(); 
    5452                } 
    5553