利用者向け情報

開発者向け情報

[sandbox.akabana]/trunk/yui-frameworks/yui-air-flex4/src/main/flex/jp/akb7/yui/air/YuiWindowedApplication.as

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1471 - (hide annotations)
Mon Feb 7 15:32:51 2011 JST (2 years, 3 months ago) by e1arkw
Original Path: trunk/yui/yui-air-flex4/src/main/flex/org/seasar/akabana/yui/air/YuiWindowedApplication.as
File size: 2633 byte(s)
RootViewを作成するタイミングをcommitPropertiesに変更しました。
1 e1arkw 1232 /*
2     * Copyright 2004-2010 the Seasar Foundation and the Others.
3     *
4     * Licensed under the Apache License, Version 2.0 (the "License");
5     * you may not use this file except in compliance with the License.
6     * You may obtain a copy of the License at
7     *
8     * http://www.apache.org/licenses/LICENSE-2.0
9     *
10     * Unless required by applicable law or agreed to in writing, software
11     * distributed under the License is distributed on an "AS IS" BASIS,
12     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13     * either express or implied. See the License for the specific language
14     * governing permissions and limitations under the License.
15     */
16 e1arkw 1225 package org.seasar.akabana.yui.air
17     {
18 e1arkw 1305 import flash.events.Event;
19    
20     import mx.core.UIComponent;
21     import mx.events.AIREvent;
22    
23     import org.seasar.akabana.yui.framework.core.YuiFrameworkSettings;
24     import org.seasar.akabana.yui.framework.error.YuiFrameworkContainerError;
25    
26     import spark.components.WindowedApplication;
27    
28     [Style(name="rootViewClass", type="Class")]
29     public class YuiWindowedApplication extends WindowedApplication
30     {
31     private var _setting:YuiFrameworkSettings;
32    
33     public function get setting():YuiFrameworkSettings{
34     return _setting;
35     }
36    
37     private var _rootView:UIComponent;
38    
39     public function get rootView():UIComponent{
40     return _rootView;
41     }
42    
43     public function YuiWindowedApplication()
44 e1arkw 1233 {
45 e1arkw 1305 super();
46     _setting = new YuiFrameworkSettings();
47     }
48 e1arkw 1233
49 e1arkw 1305 public override function dispatchEvent(event:Event):Boolean
50     {
51     if( _rootView != null ){
52     _rootView.dispatchEvent(event);
53     }
54     if( event.isDefaultPrevented()){
55     return false;
56     } else {
57     return super.dispatchEvent(event);
58     }
59     }
60    
61 e1arkw 1471 protected override function commitProperties():void{
62     super.commitProperties();
63 e1arkw 1305
64     createRootView();
65     }
66    
67     protected function createRootView():void{
68     var viewClass:Class = getStyle("rootViewClass") as Class;
69    
70     if( viewClass == null ){
71     throw new YuiFrameworkContainerError("rootViewClass style is needed.");
72     } else {
73     _rootView = new viewClass();
74     _rootView.name = "rootView";
75     _rootView.setVisible(false,true);
76     addElement(_rootView);
77     }
78     }
79     }
80 e1arkw 1225 }

Repository Top
ViewVC Help  
ViewVC logotype
Powered by ViewVC