Repository: flex-asjs Updated Branches: refs/heads/core_js_to_as 845bc6d36 -> 44a1bb9a0
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44a1bb9a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/StackedViewManagerView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/StackedViewManagerView.as b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/StackedViewManagerView.as deleted file mode 100644 index fd1a58b..0000000 --- a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/StackedViewManagerView.as +++ /dev/null @@ -1,127 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You 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, software -// 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. -// -//////////////////////////////////////////////////////////////////////////////// -package org.apache.flex.mobile.beads -{ - import org.apache.flex.core.IBeadModel; - import org.apache.flex.core.IStrand; - import org.apache.flex.core.IViewportModel; - import org.apache.flex.core.UIBase; - import org.apache.flex.events.IEventDispatcher; - import org.apache.flex.events.Event; - import org.apache.flex.html.beads.ContainerView; - import org.apache.flex.html.beads.layouts.HorizontalLayout; - import org.apache.flex.mobile.chrome.NavigationBar; - import org.apache.flex.mobile.chrome.ToolBar; - import org.apache.flex.mobile.models.ViewManagerModel; - - /** - * The StackedViewManagerView creates the visual elements of the StackedViewManager. This - * includes a NavigationBar, ToolBar, and contentArea. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class StackedViewManagerView extends ViewManagerView - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function StackedViewManagerView() - { - super(); - } - - private var _toolBar:ToolBar; - - override public function set strand(value:IStrand):void - { - var model:ViewManagerModel = value.getBeadByType(IBeadModel) as ViewManagerModel; - - if (model.toolBarItems) - { - _toolBar = new ToolBar(); - _toolBar.controls = model.toolBarItems; - _toolBar.addBead(new HorizontalLayout()); - UIBase(value).addElement(_toolBar,false); - } - - super.strand = value; - } - override public function get strand():IStrand - { - return super.strand; - } - - /** - * @private - */ - override protected function layoutChromeElements():void - { - var host:UIBase = strand as UIBase; - var contentAreaY:Number = 0; - var contentAreaHeight:Number = host.height; - var toolbarHeight:Number = _toolBar == null ? 0 : _toolBar.height; - - var model:ViewManagerModel = strand.getBeadByType(IBeadModel) as ViewManagerModel; - - if (navigationBar) - { - navigationBar.x = 0; - navigationBar.y = 0; - navigationBar.width = host.width; - - contentAreaHeight -= navigationBar.height; - contentAreaY = navigationBar.height; - - model.navigationBar = navigationBar; - } - - if (_toolBar) - { - _toolBar.x = 0; - _toolBar.y = host.height - toolbarHeight; - _toolBar.width = host.width; - - contentAreaHeight -= toolbarHeight; - - model.toolBar = _toolBar; - } - - if (contentAreaY < 0) contentAreaY = 0; - if (contentAreaHeight < 0) contentAreaHeight = 0; - - model.contentX = 0; - model.contentY = contentAreaY; - model.contentWidth = host.width; - model.contentHeight = contentAreaHeight; - - sizeViewsToFitContentArea(); - - // notify the views that the content size has changed - IEventDispatcher(strand).dispatchEvent( new Event("contentSizeChanged") ); - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44a1bb9a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/TabbedViewManagerView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/TabbedViewManagerView.as b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/TabbedViewManagerView.as deleted file mode 100644 index be20d2c..0000000 --- a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/TabbedViewManagerView.as +++ /dev/null @@ -1,139 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You 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, software -// 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. -// -//////////////////////////////////////////////////////////////////////////////// -package org.apache.flex.mobile.beads -{ - import org.apache.flex.core.IBeadModel; - import org.apache.flex.core.IStrand; - import org.apache.flex.core.IViewportModel; - import org.apache.flex.core.UIBase; - import org.apache.flex.events.IEventDispatcher; - import org.apache.flex.events.Event; - import org.apache.flex.html.beads.ContainerView; - import org.apache.flex.html.beads.layouts.HorizontalLayout; - import org.apache.flex.mobile.chrome.NavigationBar; - import org.apache.flex.mobile.chrome.TabBar; - import org.apache.flex.mobile.models.ViewManagerModel; - - /** - * The TabbedViewManagerView constructs the visual elements of the TabbedViewManager. The - * elements may be a navigation bar, a tab bar, and the contentArea. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class TabbedViewManagerView extends ViewManagerView - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function TabbedViewManagerView() - { - super(); - } - - private var _tabBar:TabBar; - - private var _strand:IStrand; - override public function get strand():IStrand - { - return _strand; - } - override public function set strand(value:IStrand):void - { - _strand = value; - - var model:ViewManagerModel = value.getBeadByType(IBeadModel) as ViewManagerModel; - - // TabbedViewManager always has a TabBar - _tabBar = new TabBar(); - _tabBar.dataProvider = model.views; - _tabBar.labelField = "title"; - _tabBar.addEventListener("change",handleButtonBarChange); - UIBase(_strand).addElement(_tabBar, false); - - super.strand = value; - } - - /** - * @private - */ - private function handleButtonBarChange(event:Event):void - { - var newIndex:Number = _tabBar.selectedIndex; - var model:ViewManagerModel = strand.getBeadByType(IBeadModel) as ViewManagerModel; - - // doing this will trigger the selectedIndexChanged event which will - // tell the strand to switch views - model.selectedIndex = newIndex; - } - - /** - * @private - */ - override protected function layoutChromeElements():void - { - var host:UIBase = _strand as UIBase; - var contentAreaY:Number = 0; - var contentAreaHeight:Number = host.height; - - var model:ViewManagerModel = strand.getBeadByType(IBeadModel) as ViewManagerModel; - - if (navigationBar) - { - navigationBar.x = 0; - navigationBar.y = 0; - navigationBar.width = host.width; - - contentAreaHeight -= navigationBar.height; - contentAreaY = navigationBar.height; - - model.navigationBar = navigationBar; - } - - if (_tabBar) - { - _tabBar.x = 0; - _tabBar.y = host.height - _tabBar.height; - _tabBar.width = host.width; - _tabBar.dispatchEvent(new Event("layoutNeeded")); - - contentAreaHeight -= _tabBar.height; - - model.tabBar = _tabBar; - } - - model.contentX = 0; - model.contentY = contentAreaY; - model.contentWidth = host.width; - model.contentHeight = contentAreaHeight; - - sizeViewsToFitContentArea(); - - // notify the views that the content size has changed - IEventDispatcher(strand).dispatchEvent( new Event("contentSizeChanged") ); - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44a1bb9a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/ViewManagerView.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/ViewManagerView.as b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/ViewManagerView.as deleted file mode 100644 index 59baf94..0000000 --- a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/beads/ViewManagerView.as +++ /dev/null @@ -1,165 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You 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, software -// 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. -// -//////////////////////////////////////////////////////////////////////////////// -package org.apache.flex.mobile.beads -{ - import org.apache.flex.core.IBeadModel; - import org.apache.flex.core.IBeadView; - import org.apache.flex.core.IStrand; - import org.apache.flex.core.IUIBase; - import org.apache.flex.core.IViewportModel; - import org.apache.flex.core.UIBase; - import org.apache.flex.events.IEventDispatcher; - import org.apache.flex.events.Event; - import org.apache.flex.html.Container; - import org.apache.flex.html.beads.layouts.HorizontalLayout; - import org.apache.flex.mobile.IView; - import org.apache.flex.mobile.chrome.NavigationBar; - import org.apache.flex.mobile.models.ViewManagerModel; - - /** - * The ViewManagerView creates the visual elements of the StackedViewManager. This - * includes a NavigationBar, ToolBar, and contentArea. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class ViewManagerView implements IBeadView - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function ViewManagerView() - { - super(); - } - - public function get host():IUIBase - { - return _strand as IUIBase; - } - public function set host(value:IUIBase):void - { - // not implemented; getter only. - } - - private var _navigationBar:NavigationBar; - public function get navigationBar():NavigationBar - { - return _navigationBar; - } - public function set navigationBar(value:NavigationBar):void - { - // not implemented; getter only. - } - - private var _strand:IStrand; - public function get strand():IStrand - { - return _strand; - } - public function set strand(value:IStrand):void - { - _strand = value; - UIBase(_strand).addEventListener("sizeChanged", sizeChangedHandler); - UIBase(_strand).addEventListener("widthChanged", sizeChangedHandler); - UIBase(_strand).addEventListener("heightChanged", sizeChangedHandler); - - var model:ViewManagerModel = value.getBeadByType(IBeadModel) as ViewManagerModel; - model.addEventListener("selectedIndexChanged", viewsChangedHandler); - - if (model.navigationBarItems) - { - _navigationBar = new NavigationBar(); - _navigationBar.controls = model.navigationBarItems; - _navigationBar.addBead(new HorizontalLayout()); - UIBase(_strand).addElement(_navigationBar, false); - } - } - - /** - * @private - */ - protected function viewsChangedHandler(event:Event):void - { - layoutChromeElements(); - } - - /** - * @private - */ - protected function sizeChangedHandler(event:Event):void - { - layoutChromeElements(); - } - - /** - * @private - */ - protected function layoutChromeElements():void - { - var host:UIBase = _strand as UIBase; - var contentAreaY:Number = 0; - var contentAreaHeight:Number = host.height; - - var model:ViewManagerModel = _strand.getBeadByType(IBeadModel) as ViewManagerModel; - - if (_navigationBar) - { - _navigationBar.x = 0; - _navigationBar.y = 0; - _navigationBar.width = host.width; - - contentAreaHeight -= _navigationBar.height; - contentAreaY = _navigationBar.height; - - model.navigationBar = _navigationBar; - } - - model.contentX = 0; - model.contentY = contentAreaY; - model.contentWidth = host.width; - model.contentHeight = contentAreaHeight; - - sizeViewsToFitContentArea(); - } - - protected function sizeViewsToFitContentArea():void - { - var model:ViewManagerModel = _strand.getBeadByType(IBeadModel) as ViewManagerModel; - - var n:int = ViewManagerModel(model).views.length; - if (n > 0) { - for (var i:int = 0; i < n; i++) - { - var view:IView = ViewManagerModel(model).views[i] as IView; - UIBase(view).x = model.contentX; - UIBase(view).y = model.contentY; - UIBase(view).setWidthAndHeight(model.contentWidth, model.contentHeight, true); - } - } - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44a1bb9a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/NavigationBar.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/NavigationBar.as b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/NavigationBar.as deleted file mode 100644 index 5e7873e..0000000 --- a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/NavigationBar.as +++ /dev/null @@ -1,103 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You 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, software -// 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. -// -//////////////////////////////////////////////////////////////////////////////// -package org.apache.flex.mobile.chrome -{ - import org.apache.flex.core.IChrome; - import org.apache.flex.events.Event; - import org.apache.flex.events.IEventDispatcher; - import org.apache.flex.html.Container; - - /** - * The NavigationBar class is part of the mobile view manager's chrome. When present, - * it provides a place for content at the top of the view, above the contentArea. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class NavigationBar extends Container implements IChrome - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function NavigationBar() - { - super(); - - className = "NavigationBar"; - } - - public function hidesBackButton(value:Boolean):void - { - - } - - private var _controls:Array; - - /** - * The controls of the NavigationBar (eg, a button to go back and a title). - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function set controls(value:Array):void - { - _controls = value; - } - public function get controls():Array - { - return _controls; - } - - /** - * @private - */ - override public function addedToParent():void - { - super.addedToParent(); - - for (var i:int=0; i < _controls.length; i++) - { - addElement( _controls[i], false ); - - var ctrl:IEventDispatcher = _controls[i] as IEventDispatcher; - ctrl.addEventListener("show", handleVisibilityChange); - ctrl.addEventListener("hide", handleVisibilityChange); - } - - dispatchEvent(new Event("layoutNeeded")); - } - - /** - * @private - */ - private function handleVisibilityChange(event:Event):void - { - dispatchEvent(new Event("layoutNeeded")); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44a1bb9a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/TabBar.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/TabBar.as b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/TabBar.as deleted file mode 100644 index 6e54326..0000000 --- a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/TabBar.as +++ /dev/null @@ -1,50 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You 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, software -// 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. -// -//////////////////////////////////////////////////////////////////////////////// -package org.apache.flex.mobile.chrome -{ - import org.apache.flex.core.IChrome; - import org.apache.flex.html.ButtonBar; - - /** - * The TabBar class displays a set of buttons that can be used to - * switch between navigation panels. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class TabBar extends ButtonBar implements IChrome - { - /** - * Constructor - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function TabBar() - { - super(); - - className = "TabBar"; - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44a1bb9a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/ToolBar.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/ToolBar.as b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/ToolBar.as deleted file mode 100644 index 6c8c748..0000000 --- a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/ToolBar.as +++ /dev/null @@ -1,81 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You 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, software -// 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. -// -//////////////////////////////////////////////////////////////////////////////// -package org.apache.flex.mobile.chrome -{ - import org.apache.flex.core.IBeadLayout; - import org.apache.flex.core.IChrome; - import org.apache.flex.events.Event; - import org.apache.flex.html.Container; - - /** - * The ToolBar class provides a space below the contentArea of a view manager which can - * be used to house controls for the view. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class ToolBar extends Container implements IChrome - { - public function ToolBar() - { - super(); - - className = "ToolBar"; - } - - private var _controls:Array; - - /** - * The control components of the ToolBar (eg, a settings button). - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function set controls(value:Array):void - { - _controls = value; - } - public function get controls():Array - { - return _controls; - } - - /** - * @private - */ - override public function addedToParent():void - { - super.addedToParent(); - - var layout:IBeadLayout = this.getBeadByType(IBeadLayout) as IBeadLayout; - trace("layout = "+layout); - - for (var i:int=0; i < _controls.length; i++) - { - addElement( _controls[i], false ); - } - - dispatchEvent(new Event("layoutNeeded")); - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44a1bb9a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/models/ViewManagerModel.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/models/ViewManagerModel.as b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/models/ViewManagerModel.as deleted file mode 100644 index c57cc61..0000000 --- a/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/models/ViewManagerModel.as +++ /dev/null @@ -1,263 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////// -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You 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, software -// 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. -// -//////////////////////////////////////////////////////////////////////////////// -package org.apache.flex.mobile.models -{ - import org.apache.flex.core.IBeadModel; - import org.apache.flex.core.IStrand; - import org.apache.flex.core.UIBase; - import org.apache.flex.events.Event; - import org.apache.flex.events.EventDispatcher; - import org.apache.flex.mobile.chrome.NavigationBar; - import org.apache.flex.mobile.chrome.TabBar; - import org.apache.flex.mobile.chrome.ToolBar; - - /** - * The ViewManagerModel houses properties and values common to the components - * which make up view managers. These properties include the title, which view - * is currently active and selected. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class ViewManagerModel extends EventDispatcher implements IBeadModel - { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function ViewManagerModel() - { - super(); - - _views = new Array(); - } - - private var _strand:IStrand; - - public function set strand(value:IStrand):void - { - _strand = value; - } - - public var contentX:Number = 0; - public var contentY:Number = 0; - public var contentWidth:Number = 0; - public var contentHeight:Number = 0; - - private var _views:Array; - - /** - * The array of views displayed in the contentArea of the ViewManager. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get views():Array - { - return _views; - } - public function set views(value:Array):void - { - if (value != _views) { - _views = value; - _selectedIndex = value.length - 1; - dispatchEvent(new Event("viewsChanged")); - } - } - - /** - * Pushes a view onto the top/end of the stack of views. This view becomes - * the active view. Mostly used by the StackedViewManager. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function pushView(value:Object):void - { - _views.push(value); - _selectedIndex = _views.length - 1; - dispatchEvent(new Event("viewPushed")); - } - - /** - * Removes the most recently added view. The next view in the stack becomes the - * active view. Mostly used by StackedViewManager. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function popView():Object - { - if (_views.length > 1) { - var discard:Object = _views.pop(); - _selectedIndex = _views.length - 1; - dispatchEvent(new Event("viewPopped")); - } - return _views[_views.length-1]; - } - - private var _selectedIndex:Number = -1; - - /** - * The index into the views array of the currently active view. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get selectedIndex():Number - { - return _selectedIndex; - } - public function set selectedIndex(value:Number):void - { - if (value != _selectedIndex) { - _selectedIndex = value; - dispatchEvent(new Event("selectedIndexChanged")); - } - } - - private var _title:String; - - /** - * The title of the view.. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get title():String - { - return _title; - } - public function set title(value:String):void - { - _title = value; - } - - private var _navigationBarItems:Array; - - /** - * The array of controls that make up the NavigationBar. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get navigationBarItems():Array - { - return _navigationBarItems; - } - public function set navigationBarItems(value:Array):void - { - _navigationBarItems = value; - } - - private var _navigationBar:NavigationBar; - - /** - * The NavigationBar (or null if not present). - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get navigationBar():NavigationBar - { - return _navigationBar; - } - public function set navigationBar(value:NavigationBar):void - { - _navigationBar = value; - } - - private var _toolBarItems:Array; - - /** - * The array of controls that make up the ToolBar.. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get toolBarItems():Array - { - return _toolBarItems; - } - public function set toolBarItems(value:Array):void - { - _toolBarItems = value; - } - - private var _toolBar:ToolBar; - - /** - * The ToolBar (or null if not present). - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get toolBar():ToolBar - { - return _toolBar; - } - public function set toolBar(value:ToolBar):void - { - _toolBar = value; - } - - private var _tabBar:TabBar; - - /** - * The TabBar (or null if not present). - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function get tabBar():TabBar - { - return _tabBar; - } - public function set tabBar(value:TabBar):void - { - _tabBar = value; - } - } -} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44a1bb9a/frameworks/projects/Mobile/build.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/Mobile/build.xml b/frameworks/projects/Mobile/build.xml index cb6c0db..fa1a1b4 100644 --- a/frameworks/projects/Mobile/build.xml +++ b/frameworks/projects/Mobile/build.xml @@ -28,28 +28,16 @@ <property name="FLEX_HOME" value="${FLEXJS_HOME}"/> <property name="FALCON_HOME" value="${env.FALCON_HOME}"/> <property name="FALCONJX_HOME" value="${env.FALCONJX_HOME}"/> - <property name="gjslint" value="gjslint" /> - <property name="jshint" value="jshint" /> - <condition property="no.lint" value="true"> - <os family="windows"/> - </condition> - + <target name="main" depends="clean,compile,test" description="Clean build of Mobile.swc"> </target> - - <target name="all" depends="main,compile-asjs,lint-js,test-js" description="Full build of Mobile.swc"> + + <target name="all" depends="clean,compile-asjs,compile-extern-swc,copy-js,compile,test" description="Full build of Mobile.swc"> </target> - + <target name="test" unless="is.jenkins"> <!-- no tests yet <ant dir="as/tests" /> - <ant dir="asjs/tests" /> - --> - </target> - - <target name="test-js" unless="is.jenkins"> - <!-- no tests yet - <ant dir="js/tests" /> --> </target> @@ -98,11 +86,13 @@ <load-config filename="compile-config.xml" /> <arg value="+playerglobal.version=${playerglobal.version}" /> <arg value="+env.AIR_HOME=${env.AIR_HOME}" /> + <arg value="-define=COMPILE::AS3,true" /> + <arg value="-define=COMPILE::JS,false" /> </compc> </target> - <target name="compile-asjs" > - <echo message="Cross-compiling Mobile/asjs"/> + <target name="compile-asjs"> + <echo message="Cross-compiling Mobile"/> <echo message="FALCONJX_HOME: ${FALCONJX_HOME}"/> <java jar="${FALCONJX_HOME}/lib/compc.jar" fork="true" > <jvmarg value="-Xmx384m" /> @@ -117,45 +107,56 @@ <arg value="+playerglobal.version=${playerglobal.version}" /> <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" /> <arg value="+env.AIR_HOME=${env.AIR_HOME}" /> + <arg value="-external-library-path+=${FALCONJX_HOME}/../externs/js/out/bin/js.swc" /> + <!-- this is not on external-library path otherwise goog.requires are not generated --> + <arg value="-library-path+=${FALCONJX_HOME}/../externs/GCL/out/bin/GCL.swc" /> + <arg value="-define=COMPILE::AS3,false" /> + <arg value="-define=COMPILE::JS,true" /> </java> </target> - <target name="lint-js" depends="gjslint, jshint, copy-js" /> - <target name="copy-js" > + <target name="compile-extern-swc" description="Compiles .as files into .swc used for cross-compiling other projects"> + <echo message="Compiling externs/Mobile.swc"/> + <echo message="FLEX_HOME: ${FLEX_HOME}"/> + <echo message="FALCON_HOME: ${FALCON_HOME}"/> + <!-- make JS output folder now so include-file doesn't error --> + <mkdir dir="${FLEXJS_HOME}/frameworks/externs"/> + + <!-- Load the <compc> task. We can't do this at the <project> level --> + <!-- because targets that run before flexTasks.jar gets built would fail. --> + <taskdef resource="flexTasks.tasks" classpathref="lib.path"/> + <!-- + Link in the classes (and their dependencies) for the MXML tags + listed in this project's manifest.xml. + Also link the additional classes (and their dependencies) + listed in CoreClasses.as, + because these aren't referenced by the manifest classes. + Keep the standard metadata when compiling. + Include the appropriate CSS files and assets in the SWC. + Don't include any resources in the SWC. + Write a bundle list of referenced resource bundles + into the file bundles.properties in this directory. + --> + <compc fork="true" + output="${FLEXJS_HOME}/frameworks/externs/Mobile.swc"> + <jvmarg line="${compc.jvm.args}"/> + <load-config filename="compile-asjs-config.xml" /> + <arg value="+playerglobal.version=${playerglobal.version}" /> + <arg value="+env.AIR_HOME=${env.AIR_HOME}" /> + <arg value="-external-library-path+=${FALCONJX_HOME}/../externs/js/out/bin/js.swc" /> + <!-- this is not on external-library path otherwise goog.requires are not generated --> + <arg value="-library-path+=${FALCONJX_HOME}/../externs/GCL/out/bin/GCL.swc" /> + <arg value="-define=COMPILE::AS3,false" /> + <arg value="-define=COMPILE::JS,true" /> + </compc> + </target> + + <target name="copy-js"> <copy todir="${FLEXJS_HOME}/frameworks/js/FlexJS/libs"> - <fileset dir="${basedir}/js/src"> - <include name="**/**" /> - </fileset> <fileset dir="${basedir}/js/out"> - <include name="**/**" /> + <include name="**/**"/> </fileset> </copy> </target> - <target name="gjslint" unless="no.lint"> - <echo>running gjslint</echo> - <exec executable="${gjslint}" dir="${basedir}" failonerror="true"> - <arg value="--strict" /> - <arg value="--disable" /> - <arg value="006,100,214,300" /> - <!-- 006: wrong indentation --> - <!-- 100: cannot have non-primitive value --> - <!-- 214: @fileoverview tag missing description --> - <!-- 300: missing newline at end of file --> - <arg value="--max_line_length" /> - <arg value="120" /> - <arg value="-r" /> - <arg value="${basedir}/js/src" /> - </exec> - </target> - - <target name="jshint" unless="no.lint"> - <echo>running jshint</echo> - <exec executable="${jshint}" dir="${basedir}" failonerror="true"> - <arg value="--config" /> - <arg value="${FLEX_HOME}/frameworks/js/jshint.properties" /> - <arg value="${basedir}/js/src" /> - </exec> - </target> - </project> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44a1bb9a/frameworks/projects/Mobile/compile-asjs-config.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/Mobile/compile-asjs-config.xml b/frameworks/projects/Mobile/compile-asjs-config.xml index 043394b..face373 100644 --- a/frameworks/projects/Mobile/compile-asjs-config.xml +++ b/frameworks/projects/Mobile/compile-asjs-config.xml @@ -22,7 +22,6 @@ <accessible>false</accessible> <external-library-path> - <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element> </external-library-path> <mxml> @@ -44,15 +43,26 @@ <library-path> <!-- asjscompc won't 'link' these classes in, but will list their requires - if these swcs are on the external-library-path then their requires - will not be listed --> - <path-element>../../libs/Core.swc</path-element> - <path-element>../../libs/HTML.swc</path-element> - <path-element>../../libs/Mobile.swc</path-element> + if these swcs are on the external-library-path then their requires + will not be listed --> + <path-element>../../externs/Core.swc</path-element> + <path-element>../../externs/Graphics.swc</path-element> + <path-element>../../externs/HTML.swc</path-element> </library-path> + <namespaces> + <namespace> + <uri>library://ns.apache.org/flexjs/basic</uri> + <manifest>basic-manifest.xml</manifest> + </namespace> + <!--<namespace> + <uri>library://ns.apache.org/flexjs/cordova</uri> + <manifest>cordova-manifest.xml</manifest> + </namespace>--> + </namespaces> + <source-path> - <path-element>asjs/src</path-element> + <path-element>as/src</path-element> </source-path> <warn-no-constructor>false</warn-no-constructor> @@ -62,9 +72,13 @@ </include-file> <include-sources> - <path-element>asjs/src</path-element> </include-sources> + <include-classes> + <class>MobileClasses</class> + <!-- <class>CordovaClasses</class> --> + </include-classes> + <include-namespaces> <uri>library://ns.apache.org/flexjs/basic</uri> </include-namespaces> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/44a1bb9a/frameworks/projects/Mobile/compile-config.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/Mobile/compile-config.xml b/frameworks/projects/Mobile/compile-config.xml index 35c7fda..dfe9506 100644 --- a/frameworks/projects/Mobile/compile-config.xml +++ b/frameworks/projects/Mobile/compile-config.xml @@ -24,6 +24,7 @@ <external-library-path> <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element> <path-element>../../libs/Core.swc</path-element> + <path-element>../../libs/Graphics.swc</path-element> <path-element>../../libs/HTML.swc</path-element> </external-library-path> @@ -51,15 +52,10 @@ <uri>library://ns.apache.org/flexjs/basic</uri> <manifest>basic-manifest.xml</manifest> </namespace> - <namespace> - <uri>library://ns.apache.org/flexjs/cordova</uri> - <manifest>cordova-manifest.xml</manifest> - </namespace> </namespaces> <source-path> <path-element>as/src</path-element> - <path-element>asjs/src</path-element> </source-path> <warn-no-constructor>false</warn-no-constructor> @@ -67,7 +63,7 @@ <include-file> <name>defaults.css</name> - <path>asjs/defaults.css</path> + <path>as/defaults.css</path> </include-file> <include-file> <name>js/out/*</name> @@ -80,13 +76,11 @@ <include-classes> <class>MobileClasses</class> - <class>MobileASJSClasses</class> </include-classes> <include-namespaces> <uri>library://ns.apache.org/flexjs/basic</uri> - <uri>library://ns.apache.org/flexjs/cordova</uri> - </include-namespaces> + </include-namespaces> <target-player>${playerglobal.version}</target-player>
