flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [01/55] [abbrv] git commit: [flex-asjs] [refs/heads/develop] - move AS classes from FlexJSJX to final home. Build scripts will be fixed up in a later commit
Date Wed, 15 Apr 2015 21:43:06 GMT
Repository: flex-asjs
Updated Branches:
  refs/heads/develop 1a7aa8ae0 -> 1cd5f16fe


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/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
new file mode 100644
index 0000000..5e7873e
--- /dev/null
+++ b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/NavigationBar.as
@@ -0,0 +1,103 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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/72b21f62/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
new file mode 100644
index 0000000..7ab2047
--- /dev/null
+++ b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/TabBar.as
@@ -0,0 +1,80 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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";
+		}
+		
+		/**
+		 *  Sets the width of the TabBar.
+		 * 
+		 *  @param value The new width in pixels.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		override public function set width(value:Number):void
+		{
+			super.width = value;
+		}
+		
+		/**
+		 *  Sets the height of the TabBar.
+		 * 
+		 *  @param value The new height in pixels.
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		override public function set height(value:Number):void
+		{
+			super.height = value;
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/72b21f62/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
new file mode 100644
index 0000000..6c8c748
--- /dev/null
+++ b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/chrome/ToolBar.as
@@ -0,0 +1,81 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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/72b21f62/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
new file mode 100644
index 0000000..faa3936
--- /dev/null
+++ b/frameworks/projects/Mobile/asjs/src/org/apache/flex/mobile/models/ViewManagerModel.as
@@ -0,0 +1,257 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.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;
+		}
+		
+		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


Mime
View raw message