You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ma...@apache.org on 2013/10/05 01:03:07 UTC

[01/15] git commit: [flex-sdk] [refs/heads/develop] - Initial draft experimental mobile project structure.

Updated Branches:
  refs/heads/develop c1173bda4 -> 25d74edaf


Initial draft experimental mobile project structure.


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/35c802c5
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/35c802c5
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/35c802c5

Branch: refs/heads/develop
Commit: 35c802c5fbaf9a25044da8ebe4e7f430519b8860
Parents: 54f51a3
Author: Justin Mclean <jm...@apache.org>
Authored: Fri Sep 27 10:42:44 2013 +1000
Committer: Justin Mclean <jm...@apache.org>
Committed: Fri Sep 27 10:42:44 2013 +1000

----------------------------------------------------------------------
 build.xml                                       |   5 +-
 frameworks/build.xml                            |  13 +-
 .../projects/experimental_mobile/build.xml      | 232 +++++++++++++++++++
 .../experimental_mobile/bundle-config.xml       |  52 +++++
 .../bundles/da_DK/experimental.properties       |  18 ++
 .../bundles/de_CH/experimental.properties       |  18 ++
 .../bundles/de_DE/experimental.properties       |  18 ++
 .../bundles/el_GR/experimental.properties       |  18 ++
 .../bundles/en_AU/experimental.properties       |  18 ++
 .../bundles/en_CA/experimental.properties       |  18 ++
 .../bundles/en_GB/experimental.properties       |  18 ++
 .../bundles/en_US/experimental.properties       |  18 ++
 .../bundles/es_ES/experimental.properties       |  18 ++
 .../bundles/fi_FI/experimental.properties       |  18 ++
 .../bundles/fr_CH/experimental.properties       |  18 ++
 .../bundles/fr_FR/experimental.properties       |  18 ++
 .../bundles/it_IT/experimental.properties       |  18 ++
 .../bundles/ja_JP/experimental.properties       |  18 ++
 .../bundles/ko_KR/experimental.properties       |  18 ++
 .../bundles/nb_NO/experimental.properties       |  18 ++
 .../bundles/nl_NL/experimental.properties       |  18 ++
 .../bundles/pt_BR/experimental.properties       |  18 ++
 .../bundles/pt_PT/experimental.properties       |  18 ++
 .../bundles/ru_RU/experimental.properties       |  18 ++
 .../bundles/sv_SE/experimental.properties       |  18 ++
 .../bundles/zh_CN/experimental.properties       |  18 ++
 .../bundles/zh_TW/experimental.properties       |  18 ++
 .../experimental_mobile/compile-config.xml      |  80 +++++++
 .../projects/experimental_mobile/defaults.css   |  20 ++
 .../projects/experimental_mobile/manifest.xml   |  29 +++
 .../experimental_mobile/spark-manifest.xml      |  49 ++++
 .../src/ExperimentalMobileClasses.as            |  30 +++
 32 files changed, 920 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/build.xml
----------------------------------------------------------------------
diff --git a/build.xml b/build.xml
index 99160d8..b4a685d 100644
--- a/build.xml
+++ b/build.xml
@@ -491,6 +491,8 @@
 		<create-rsl rsl-dir="${basedir}/frameworks/rsls" swc-dir="${basedir}/frameworks/libs" swc-name="apache" build-number="${release.version}.${build.number.date}"/>		
 		<!-- experimental RSL -->
 		<create-rsl rsl-dir="${basedir}/frameworks/rsls" swc-dir="${basedir}/frameworks/libs" swc-name="experimental" build-number="${release.version}.${build.number.date}"/>		
+		<!-- mobile experimental RSL -->
+		<create-rsl rsl-dir="${basedir}/frameworks/rsls" swc-dir="${basedir}/frameworks/libs" swc-name="experimental_mobile" build-number="${release.version}.${build.number.date}"/>		
 	</target>
 
     <target name="other.locales" description="Build resource SWCs for additional locales">
@@ -893,7 +895,8 @@
                 <include name="apache.swc"/>
                 <include name="authoringsupport.swc"/>
                 <include name="core.swc"/>
-                <include name="experimental.swc"/>
+            	<include name="experimental.swc"/>
+            	<include name="experimental_mobile.swc"/>
                 <include name="spark.swc"/>
                 <include name="framework.swc"/>
                 <include name="mx/mx.swc"/>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/build.xml b/frameworks/build.xml
index fc3f96b..ce42555 100644
--- a/frameworks/build.xml
+++ b/frameworks/build.xml
@@ -130,7 +130,7 @@
         <antcall target="aeongraphical"/>
     	<antcall target="apache"/>
     	<antcall target="experimental"/>
-        
+    	<antcall target="experimental_mobile"/>
         <antcall target="compile-automation"/>
     </target>
 	
@@ -216,7 +216,8 @@
         <ant dir="${basedir}/projects/tool" target="other.locales"/>
     	<ant dir="${basedir}/projects/tool_air" target="other.locales"/>
     	<ant dir="${basedir}/projects/apache" target="other.locales"/>
-        <ant dir="${basedir}/projects/experimental" target="other.locales"/>
+    	<ant dir="${basedir}/projects/experimental" target="other.locales"/>
+    	<ant dir="${basedir}/projects/experimental_mobile" target="other.locales"/>
     </target>
     
     <target name="doc" >
@@ -243,6 +244,7 @@
         -->
         <ant dir="${basedir}/projects/apache" target="doc" />
     	<ant dir="${basedir}/projects/experimental" target="doc" />
+    	<ant dir="${basedir}/projects/experimental_mobile" target="doc" />
     </target>
    
     <!--
@@ -277,7 +279,8 @@
         <ant dir="${basedir}/projects/charts" target="clean"/>
         <ant dir="${basedir}/projects/advancedgrids" target="clean"/>
     	<ant dir="${basedir}/projects/apache" target="clean"/>
-        <ant dir="${basedir}/projects/experimental" target="clean"/>
+    	<ant dir="${basedir}/projects/experimental" target="clean"/>
+    	<ant dir="${basedir}/projects/experimental_mobile" target="clean"/>
         <ant dir="${basedir}/javascript" target="clean"/>
     	<ant dir="${basedir}/themes/AeonGraphical" target="clean"/>
         <!-- delete the FlashBuilder executable directories -->
@@ -473,4 +476,8 @@
     <target name="experimental" description="Clean build of experimental.swc">
         <ant dir="${basedir}/projects/experimental"/>
     </target>
+	
+    <target name="experimental_mobile" description="Clean build of experimental_mobile.swc">
+        <ant dir="${basedir}/projects/experimental_mobile"/>
+    </target>
 </project>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/build.xml b/frameworks/projects/experimental_mobile/build.xml
new file mode 100644
index 0000000..4796850
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/build.xml
@@ -0,0 +1,232 @@
+<?xml version="1.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.
+
+-->
+
+
+<project name="experimental_mobile" default="main" basedir=".">
+
+	<property name="FLEX_HOME" location="${basedir}/../../.."/>
+
+    <property file="${FLEX_HOME}/env.properties"/>
+    <property environment="env"/>
+	<property file="${FLEX_HOME}/build.properties"/>
+
+	<macrodef name="bundle">
+		<attribute name="locale"/>
+			<sequential>
+				<echo message="Compiling frameworks/locale/@{locale}/experimental_mobile_rb.swc"/>
+
+			<!-- 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" classpath="${FLEX_HOME}/lib/flexTasks.jar"/>
+                <compc fork="true"
+                       output="${FLEX_HOME}/frameworks/locale/@{locale}/experimental_mobile_rb.swc">
+				<jvmarg line="${compc.jvm.args}"/>
+                <load-config filename="bundle-config.xml" />
+                <arg value="+playerglobal.version=${playerglobal.version}" />
+                <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+                <arg value="+locale=@{locale}" />
+                </compc>
+		</sequential>
+	</macrodef>
+
+	<macrodef name="fat-swc">
+		<attribute name="locale"/>
+		<sequential>
+			<mkdir dir="${basedir}/bundles/@{locale}/docs" />
+			<zip destfile="${FLEX_HOME}/frameworks/locale/@{locale}/experimental_mobile_rb.swc" update="true">
+				<zipfileset dir="${basedir}/bundles/@{locale}/docs" prefix="docs">
+					<include name="*.*"/>
+				</zipfileset>
+				<zipfileset dir="${basedir}/bundles/en_US" prefix="docs">
+					<include name="packages.dita"/>
+				</zipfileset>
+			</zip>
+		</sequential>
+	</macrodef>
+
+	<macrodef name="bundle-clean">
+		<attribute name="locale"/>
+		<sequential>
+			<delete failonerror="false">
+				<fileset dir="${FLEX_HOME}/frameworks/locale">
+					<include name="@{locale}/experimental_mobile_rb.swc"/>
+					<include name="@{locale}/experimental_mobile_rb.swc.incr"/>
+				</fileset>
+			</delete>
+		</sequential>
+	</macrodef>
+
+	<macrodef name="bundler">
+		<attribute name="locale"/>
+		<element name="run.fat.swc" optional="yes"/>
+		<sequential>
+			<bundle-clean locale="@{locale}"/>
+			<bundle locale="@{locale}"/>
+			<run.fat.swc/>
+		</sequential>
+	</macrodef>
+
+	<target name="main" depends="clean,compile" description="Clean build of experimental_mobile.swc and default locale">
+		<bundle locale="${locale}"/>
+	</target>
+
+	<target name="other.locales" depends="bundles" description="Build other locale SWCs"/>
+
+	<!-- This is a private target for building experimental_mobile.swc for various locales. -->
+	<!-- The targets below set the 'locale' parameter and call it with <antcall>. -->
+	<target name="bundles">
+        <!-- these languages do not have localized docs-->
+        <bundler locale="en_AU"/><!-- Australian resources -->
+        <bundler locale="en_GB"/><!-- United Kingdom resources -->
+        <bundler locale="en_CA"/><!-- Canadian resources -->
+        <bundler locale="da_DK"/><!-- Danish resources -->
+        <bundler locale="de_DE"><!-- German resources -->
+            <run.fat.swc>
+                <fat-swc locale="de_DE"/>
+            </run.fat.swc>
+        </bundler>
+        <bundler locale="de_CH"/><!-- Swiss German resources -->
+        <bundler locale="es_ES"/><!-- Spanish resources -->
+        <bundler locale="fi_FI"/><!--  Finnish resources-->
+		<bundler locale="fr_CH"/><!-- Swiss French resources -->
+        <bundler locale="fr_FR"><!-- French resources -->
+            <run.fat.swc>
+                <fat-swc locale="fr_FR"/>
+            </run.fat.swc>
+        </bundler>
+        <bundler locale="it_IT"/><!-- Italian resources -->
+        <bundler locale="ja_JP"><!-- Japanese resources -->
+            <run.fat.swc>
+                <fat-swc locale="ja_JP"/>
+            </run.fat.swc>
+        </bundler>
+        <bundler locale="ko_KR"/><!-- Korean resources -->
+        <bundler locale="nb_NO"/><!-- Norwegian Bokmal resources -->
+        <bundler locale="nl_NL"/><!-- Dutch resources -->
+        <bundler locale="pt_BR"/><!-- Brazilian Portuguese resources -->
+        <bundler locale="pt_PT"/><!-- Portugal Portuguese resources -->
+        <bundler locale="ru_RU"><!-- Russian resources -->
+            <run.fat.swc>
+                <fat-swc locale="ru_RU"/>
+            </run.fat.swc>
+        </bundler>
+        <bundler locale="sv_SE"/><!-- Swedish resources -->
+        <bundler locale="zh_CN"><!-- Simplified Chinese resources -->
+            <run.fat.swc>
+                <fat-swc locale="zh_CN"/>
+            </run.fat.swc>
+        </bundler>
+        <bundler locale="zh_TW"/><!-- Traditional Chinese resources -->
+        <bundler locale="el_GR"/><!-- Greek Language  resources -->
+	</target>
+
+	<target name="clean" depends="bundles-clean">
+		<delete failonerror="false">
+			<fileset dir="${basedir}" >
+				<include name="bundles.properties"/>
+			    <include name="bundles/en_US/packages.dita"/>
+			</fileset>
+			<fileset dir="${FLEX_HOME}/frameworks/libs">
+				<include name="experimental_mobile.swc"/>
+				<include name="experimental_mobile.swc.incr"/>
+			</fileset>
+		</delete>
+	</target>
+
+	<target name="bundles-clean">
+		<delete failonerror="false">
+			<fileset dir="${FLEX_HOME}/frameworks/locale">
+				<include name="*/experimental_mobile_rb.swc"/>
+				<include name="*/experimental_mobile_rb.swc.incr"/>
+			</fileset>
+		</delete>
+	</target>
+
+	<target name="compile" description="Compiles experimental_mobile.swc">
+		<echo message="Compiling frameworks/libs/experimental_mobile.swc"/>
+
+		<!-- 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" classpath="${FLEX_HOME}/lib/flexTasks.jar"/>
+		<!--
+			Link in the classes (and their dependencies) for the experimental classes
+			listed in this project's manifest.xml.
+			Also link the additional classes (and their dependencies)
+			listed in ExperimentalMobileClasses.as,
+			because these aren't referenced by the manifest classes.
+			Keep the standard metadata when compiling.
+			Link in accessibility support.
+			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="${FLEX_HOME}/frameworks/libs/experimental_mobile.swc">
+			<jvmarg line="${compc.jvm.args}"/>
+            <load-config filename="compile-config.xml" />
+            <arg value="+playerglobal.version=${playerglobal.version}" />
+            <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+        </compc>
+	</target>
+
+	<target name="doc" depends="clean-temp-docs" description="updates experimental_mobile.swc with asdoc xml">
+		<!-- Load the <asdoc> 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" classpath="${FLEX_HOME}/lib/flexTasks.jar"/>
+
+	    <condition property="asdoc.jvm.args" value="-Xmx384m">
+	        <os family="windows"/>
+	    </condition>
+
+	    <condition property="asdoc.jvm.args" value="-Xmx512m">
+	        <os family="mac"/>
+	    </condition>
+
+	    <condition property="asdoc.jvm.args" value="-Xmx512m">
+	        <os family="unix"/>
+	    </condition>
+
+
+		<!-- Call asdoc to generate dita xml files -->
+		<asdoc output="${FLEX_HOME}/tempDoc" lenient="true" failonerror="true" keep-xml="true" skip-xsl="true" fork="true">
+		    <compiler.source-path path-element="${basedir}/src"/>
+		    <doc-classes class="ExperimentalMobileClasses"/>
+		    <namespace uri="http://flex.apache.org/experimental/ns" manifest="${basedir}/manifest.xml"/>
+		    <namespace uri="library://ns.adobe.com/flex/spark" manifest="${basedir}/spark-manifest.xml"/>
+		    <jvmarg line="${asdoc.jvm.args}"/>
+		</asdoc>
+
+		<!-- updates experimental.swc with asdoc xml -->
+		<zip destfile="${FLEX_HOME}/frameworks/locale/en_US/experimental_mobile_rb.swc" update="true">
+		    <zipfileset dir="${FLEX_HOME}/tempDoc/tempdita" prefix="docs">
+			    <include name="*.*"/>
+				<exclude name="ASDoc_Config.xml"/>
+				<exclude name="overviews.xml"/>
+		    </zipfileset>
+		</zip>
+		<copy file="${FLEX_HOME}/tempDoc/tempdita/packages.dita" tofile="${basedir}/bundles/en_US/packages.dita"/>
+	</target>
+
+	<target name="clean-temp-docs">
+		<delete dir="${FLEX_HOME}/tempDoc" failonerror="false" includeEmptyDirs="true"/>
+		<delete file="${basedir}/bundles/en_US/packages.dita" failonerror="false"/>
+	</target>
+</project>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundle-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundle-config.xml b/frameworks/projects/experimental_mobile/bundle-config.xml
new file mode 100644
index 0000000..0fce3e0
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundle-config.xml
@@ -0,0 +1,52 @@
+<!--
+
+  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.
+
+-->
+<flex-config>
+
+    <compiler>        
+        <external-library-path>
+            <path-element>${env.PLAYERGLOBAL_HOME}/${playerglobal.version}/playerglobal.swc</path-element>
+            <path-element>../../libs/framework.swc</path-element>
+            <path-element>../../libs/spark.swc</path-element>
+            <path-element>../../libs/mobile/mobilecomponents.swc</path-element>
+        </external-library-path>
+        
+        <include-libraries/>
+        
+        <library-path/>
+        
+        <locale>
+            <locale-element>${locale}</locale-element>
+        </locale>
+        
+        <source-path>
+            <path-element>src</path-element>
+            <path-element>bundles/${locale}</path-element>
+        </source-path>
+    </compiler>
+    
+    <include-classes/>
+    
+    <include-namespaces/>
+    
+    <include-resource-bundles>
+        <bundle>experimental</bundle>
+    </include-resource-bundles>
+        
+    <target-player>${playerglobal.version}</target-player>
+</flex-config>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/da_DK/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/da_DK/experimental.properties b/frameworks/projects/experimental_mobile/bundles/da_DK/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/da_DK/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/de_CH/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/de_CH/experimental.properties b/frameworks/projects/experimental_mobile/bundles/de_CH/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/de_CH/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/de_DE/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/de_DE/experimental.properties b/frameworks/projects/experimental_mobile/bundles/de_DE/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/de_DE/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/el_GR/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/el_GR/experimental.properties b/frameworks/projects/experimental_mobile/bundles/el_GR/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/el_GR/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/en_AU/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/en_AU/experimental.properties b/frameworks/projects/experimental_mobile/bundles/en_AU/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/en_AU/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/en_CA/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/en_CA/experimental.properties b/frameworks/projects/experimental_mobile/bundles/en_CA/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/en_CA/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/en_GB/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/en_GB/experimental.properties b/frameworks/projects/experimental_mobile/bundles/en_GB/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/en_GB/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/en_US/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/en_US/experimental.properties b/frameworks/projects/experimental_mobile/bundles/en_US/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/en_US/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/es_ES/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/es_ES/experimental.properties b/frameworks/projects/experimental_mobile/bundles/es_ES/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/es_ES/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/fi_FI/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/fi_FI/experimental.properties b/frameworks/projects/experimental_mobile/bundles/fi_FI/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/fi_FI/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/fr_CH/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/fr_CH/experimental.properties b/frameworks/projects/experimental_mobile/bundles/fr_CH/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/fr_CH/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/fr_FR/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/fr_FR/experimental.properties b/frameworks/projects/experimental_mobile/bundles/fr_FR/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/fr_FR/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/it_IT/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/it_IT/experimental.properties b/frameworks/projects/experimental_mobile/bundles/it_IT/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/it_IT/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/ja_JP/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/ja_JP/experimental.properties b/frameworks/projects/experimental_mobile/bundles/ja_JP/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/ja_JP/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/ko_KR/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/ko_KR/experimental.properties b/frameworks/projects/experimental_mobile/bundles/ko_KR/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/ko_KR/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/nb_NO/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/nb_NO/experimental.properties b/frameworks/projects/experimental_mobile/bundles/nb_NO/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/nb_NO/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/nl_NL/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/nl_NL/experimental.properties b/frameworks/projects/experimental_mobile/bundles/nl_NL/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/nl_NL/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/pt_BR/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/pt_BR/experimental.properties b/frameworks/projects/experimental_mobile/bundles/pt_BR/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/pt_BR/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/pt_PT/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/pt_PT/experimental.properties b/frameworks/projects/experimental_mobile/bundles/pt_PT/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/pt_PT/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/ru_RU/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/ru_RU/experimental.properties b/frameworks/projects/experimental_mobile/bundles/ru_RU/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/ru_RU/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/sv_SE/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/sv_SE/experimental.properties b/frameworks/projects/experimental_mobile/bundles/sv_SE/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/sv_SE/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/zh_CN/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/zh_CN/experimental.properties b/frameworks/projects/experimental_mobile/bundles/zh_CN/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/zh_CN/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/bundles/zh_TW/experimental.properties
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundles/zh_TW/experimental.properties b/frameworks/projects/experimental_mobile/bundles/zh_TW/experimental.properties
new file mode 100644
index 0000000..29940f7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/bundles/zh_TW/experimental.properties
@@ -0,0 +1,18 @@
+################################################################################
+##
+##  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.
+##
+################################################################################

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/compile-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/compile-config.xml b/frameworks/projects/experimental_mobile/compile-config.xml
new file mode 100644
index 0000000..4e0ee97
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/compile-config.xml
@@ -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.
+
+-->
+<flex-config>
+
+    <compiler>
+        <accessible>true</accessible>
+
+        <external-library-path>
+            <path-element>${env.PLAYERGLOBAL_HOME}/${playerglobal.version}/playerglobal.swc</path-element>
+            <path-element>../../libs/framework.swc</path-element>
+            <path-element>../../libs/spark.swc</path-element>
+            <path-element>../../libs/textlayout.swc</path-element>
+            <path-element>../../libs/mobile/mobilecomponents.swc</path-element>
+        </external-library-path>
+
+        <keep-as3-metadata>
+            <name>Bindable</name>
+            <name>Managed</name>
+            <name>ChangeEvent</name>
+            <name>NonCommittingChangeEvent</name>
+            <name>Transient</name>
+            <name>SkinPart</name>
+        </keep-as3-metadata>
+
+        <locale/>
+
+        <library-path/>
+
+        <namespaces>
+            <namespace>
+                <uri>http://flex.apache.org/experimental/ns</uri>
+                <manifest>manifest.xml</manifest>
+            </namespace>
+            <namespace>
+                <uri>library://ns.adobe.com/flex/spark</uri>
+                <manifest>spark-manifest.xml</manifest>
+            </namespace>
+        </namespaces>
+
+        <source-path>
+            <path-element>src</path-element>
+        </source-path>
+
+        <show-deprecation-warnings>false</show-deprecation-warnings>
+        <warn-no-constructor>false</warn-no-constructor>
+    </compiler>
+
+	<include-namespaces>
+		 <uri>http://flex.apache.org/experimental/ns</uri>
+	</include-namespaces>
+
+    <include-classes>
+        <class>ExperimentalMobileClasses</class>
+    </include-classes>
+
+    <include-file>
+        <name>defaults.css</name>
+        <path>defaults.css</path>
+    </include-file>
+
+    <resource-bundle-list>bundles.properties</resource-bundle-list>
+
+    <target-player>${playerglobal.version}</target-player>
+</flex-config>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/defaults.css b/frameworks/projects/experimental_mobile/defaults.css
new file mode 100644
index 0000000..66188a1
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/defaults.css
@@ -0,0 +1,20 @@
+/*
+*
+*  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.
+*
+*/
+@namespace "http://flex.apache.org/experimental/ns";
+@namespace s "library://ns.adobe.com/flex/spark";

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/manifest.xml b/frameworks/projects/experimental_mobile/manifest.xml
new file mode 100644
index 0000000..4864d95
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/manifest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.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.
+
+-->
+
+<!--
+
+    Experimental Mobile Components
+
+-->
+<componentPackage>
+
+    
+</componentPackage>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/spark-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/spark-manifest.xml b/frameworks/projects/experimental_mobile/spark-manifest.xml
new file mode 100644
index 0000000..563a4cc
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/spark-manifest.xml
@@ -0,0 +1,49 @@
+<?xml version="1.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.
+
+-->
+
+<!--
+
+    Experimental Mobile Components
+
+-->
+<componentPackage>
+
+    <!-- Special Components -->
+    <component id="State" class="mx.states.State" lookupOnly="true"/>
+    <component id="Transition" class="mx.states.Transition" lookupOnly="true"/>
+
+    <!-- Flex 3 Graphics -->
+    <component id="BitmapFill" class="mx.graphics.BitmapFill" lookupOnly="true"/>
+    <component id="BitmapResizeMode" class="mx.graphics.BitmapResizeMode" lookupOnly="true"/>
+    <component id="CompoundTransform" class="mx.geom.CompoundTransform" lookupOnly="true"/>
+    <component id="GradientEntry" class="mx.graphics.GradientEntry" lookupOnly="true"/>
+    <component id="LinearGradient" class="mx.graphics.LinearGradient" lookupOnly="true"/>
+    <component id="LinearGradientStroke" class="mx.graphics.LinearGradientStroke" lookupOnly="true"/>
+    <component id="RadialGradient" class="mx.graphics.RadialGradient" lookupOnly="true"/>
+    <component id="RadialGradientStroke" class="mx.graphics.RadialGradientStroke" lookupOnly="true"/>
+    <component id="SolidColor" class="mx.graphics.SolidColor" lookupOnly="true"/>
+    <component id="SolidColorStroke" class="mx.graphics.SolidColorStroke" lookupOnly="true"/>
+    <component id="Stroke" class="mx.graphics.Stroke" lookupOnly="true"/>
+    <component id="Transform" class="mx.geom.Transform" lookupOnly="true"/>
+
+    <!-- Spark Graphics -->
+    <component id="BitmapGraphic" class="spark.primitives.BitmapImage" lookupOnly="true"/>
+    <component id="BitmapImage" class="spark.primitives.BitmapImage" lookupOnly="true"/>
+</componentPackage>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/35c802c5/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as b/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
new file mode 100644
index 0000000..76e561c
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
@@ -0,0 +1,30 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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
+{
+	internal class ExperimentalMobileClasses
+	{
+		/**
+		 *  @private
+		 *  This class is used to link additional classes into experimental.swc
+		 *  beyond those that are found by dependecy analysis starting
+		 *  from the classes specified in manifest.xml.
+		 */
+	}
+}


[05/15] git commit: [flex-sdk] [refs/heads/develop] - https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile - formatted sources code - added ASDOC (almost all) - bug: Bitmap renderer does not support MultiDPI when appDPI is set

Posted by ma...@apache.org.
https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile
- formatted sources code
- added ASDOC (almost all)
- bug:  Bitmap renderer does not support MultiDPI when appDPI is set


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/b78de5c0
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/b78de5c0
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/b78de5c0

Branch: refs/heads/develop
Commit: b78de5c0c4b019c2d928d21f6fb2a8eb485161e6
Parents: aef85b3
Author: mamsellem <ma...@systar.com>
Authored: Tue Oct 1 12:02:14 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Tue Oct 1 12:02:14 2013 +0200

----------------------------------------------------------------------
 asdoc/build.xml                                 |   2 +
 .../assets/images/mobile160/dg_header_asc.png   | Bin 0 -> 447 bytes
 .../assets/images/mobile160/dg_header_desc.png  | Bin 0 -> 418 bytes
 .../assets/images/mobile160/dg_header_sep.png   | Bin 0 -> 201 bytes
 .../images/mobile160/dg_header_shadow.png       | Bin 0 -> 277 bytes
 .../assets/images/mobile320/dg_header_asc.png   | Bin 0 -> 527 bytes
 .../assets/images/mobile320/dg_header_desc.png  | Bin 0 -> 496 bytes
 .../assets/images/mobile320/dg_header_sep.png   | Bin 0 -> 215 bytes
 .../images/mobile320/dg_header_shadow.png       | Bin 0 -> 329 bytes
 .../projects/experimental_mobile/build.xml      |  11 +-
 .../experimental_mobile/bundle-config.xml       |  20 +-
 .../experimental_mobile/compile-config.xml      |   5 +-
 .../projects/experimental_mobile/defaults.css   | 129 +++
 .../projects/experimental_mobile/manifest.xml   |  57 +-
 .../src/ExperimentalMobileClasses.as            |  25 +-
 .../src/spark/components/MobileGrid.as          | 302 +++++++
 .../itemRenderers/IItemPartRendererBase.as      |  55 ++
 .../itemRenderers/IItemTextPartRenderer.as      |  35 +
 .../itemRenderers/ItemBitmapPartRenderer.as     | 144 +++
 .../itemRenderers/ItemTextPartRenderer.as       |  97 ++
 .../supportClasses/IPartRendererDescriptor.as   |  34 +
 .../supportClasses/ItemRendererBase.as          | 894 +++++++++++++++++++
 .../ListMultiPartItemRendererBase.as            | 119 +++
 .../supportClasses/ListMultiPartLayoutBase.as   | 141 +++
 .../supportClasses/ListMultiPartTabbedLayout.as |  82 ++
 .../supportClasses/MobileGridColumn.as          | 148 +++
 .../supportClasses/MobileGridHeader.as          | 151 ++++
 .../supportClasses/MobileGridRowRenderer.as     |  34 +
 .../PartRendererDescriptorBase.as               | 184 ++++
 .../src/spark/events/MobileGridHeaderEvent.as   |  58 ++
 .../skins/MobileGridHeaderButtonBarSkin.as      |  89 ++
 .../spark/skins/MobileGridHeaderButtonSkin.as   |  43 +
 .../skins/MobileGridHeaderFirstButtonSkin.as    |  35 +
 .../src/spark/skins/MobileGridSkin.as           | 178 ++++
 .../assets/MobileGridHeaderButton_down.fxg      |  46 +
 .../mobile/assets/MobileGridHeaderButton_up.fxg |  44 +
 .../assets/MobileGridHeaderFirstButton_down.fxg |  34 +
 .../assets/MobileGridHeaderFirstButton_up.fxg   |  32 +
 .../src/spark/utils/DensityUtil2.as             |  88 ++
 .../src/spark/utils/MultiDPIBitmapSourceExt.as  |  44 +
 .../src/spark/utils/UIComponentUtils.as         | 163 ++++
 41 files changed, 3471 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/asdoc/build.xml
----------------------------------------------------------------------
diff --git a/asdoc/build.xml b/asdoc/build.xml
index 8803daf..ed9ea86 100644
--- a/asdoc/build.xml
+++ b/asdoc/build.xml
@@ -105,6 +105,7 @@
             <!--  added for Apache -->
 			<compiler.source-path path-element="${flexlib}/projects/apache/src"/>
 			<compiler.source-path path-element="${flexlib}/projects/experimental/src"/>
+            <compiler.source-path path-element="${flexlib}/projects/experimental_mobile/src"/>
 						
 			<!-- namespaces to include in asdoc -->
 		    <doc-namespaces uri="http://www.adobe.com/2006/airmxml"/>
@@ -141,6 +142,7 @@
             <!--  added for Apache -->
 		    <namespace uri="http://flex.apache.org/ns" manifest="${flexlib}/projects/apache/manifest.xml"/>
 		    <namespace uri="http://flex.apache.org/experimental/ns" manifest="${flexlib}/projects/experimental/manifest.xml"/>
+            <namespace uri="http://flex.apache.org/experimental/ns"  manifest="${flexlib}/projects/experimental_mobile/manifest.xml"/>
 
 			<library-path/>
             <external-library-path dir="${env.AIR_HOME}/frameworks/libs/air">

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_asc.png
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_asc.png b/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_asc.png
new file mode 100644
index 0000000..6da01b4
Binary files /dev/null and b/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_asc.png differ

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_desc.png
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_desc.png b/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_desc.png
new file mode 100644
index 0000000..3b0d1d0
Binary files /dev/null and b/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_desc.png differ

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_sep.png
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_sep.png b/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_sep.png
new file mode 100644
index 0000000..67aa576
Binary files /dev/null and b/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_sep.png differ

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_shadow.png
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_shadow.png b/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_shadow.png
new file mode 100644
index 0000000..d97bbcd
Binary files /dev/null and b/frameworks/projects/experimental_mobile/assets/images/mobile160/dg_header_shadow.png differ

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_asc.png
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_asc.png b/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_asc.png
new file mode 100644
index 0000000..cec2d5a
Binary files /dev/null and b/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_asc.png differ

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_desc.png
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_desc.png b/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_desc.png
new file mode 100644
index 0000000..e4bf91c
Binary files /dev/null and b/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_desc.png differ

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_sep.png
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_sep.png b/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_sep.png
new file mode 100644
index 0000000..fd9800a
Binary files /dev/null and b/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_sep.png differ

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_shadow.png
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_shadow.png b/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_shadow.png
new file mode 100644
index 0000000..b92d426
Binary files /dev/null and b/frameworks/projects/experimental_mobile/assets/images/mobile320/dg_header_shadow.png differ

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/build.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/build.xml b/frameworks/projects/experimental_mobile/build.xml
index 4796850..735e5e2 100644
--- a/frameworks/projects/experimental_mobile/build.xml
+++ b/frameworks/projects/experimental_mobile/build.xml
@@ -161,8 +161,9 @@
 
 	<target name="compile" description="Compiles experimental_mobile.swc">
 		<echo message="Compiling frameworks/libs/experimental_mobile.swc"/>
+        <echo message="Using ${env.AIR_HOME}/frameworks/libs/air/airglobal.swc" level="info"/>
 
-		<!-- Load the <compc> task. We can't do this at the <project> level -->
+        <!-- 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" classpath="${FLEX_HOME}/lib/flexTasks.jar"/>
 		<!--
@@ -183,7 +184,7 @@
 			<jvmarg line="${compc.jvm.args}"/>
             <load-config filename="compile-config.xml" />
             <arg value="+playerglobal.version=${playerglobal.version}" />
-            <arg value="+env.PLAYERGLOBAL_HOME=${env.PLAYERGLOBAL_HOME}" />
+            <arg value="+env.AIR_HOME=${env.AIR_HOME}"/>
         </compc>
 	</target>
 
@@ -209,6 +210,12 @@
 		<asdoc output="${FLEX_HOME}/tempDoc" lenient="true" failonerror="true" keep-xml="true" skip-xsl="true" fork="true">
 		    <compiler.source-path path-element="${basedir}/src"/>
 		    <doc-classes class="ExperimentalMobileClasses"/>
+            <external-library-path dir="${FLEX_HOME}/frameworks/themes/Mobile">
+                <include name="mobile.swc"/>
+            </external-library-path>
+            <external-library-path dir="${FLEX_HOME}/frameworks/libs/mobile">
+                <include name="mobilecomponents.swc"/>
+            </external-library-path>
 		    <namespace uri="http://flex.apache.org/experimental/ns" manifest="${basedir}/manifest.xml"/>
 		    <namespace uri="library://ns.adobe.com/flex/spark" manifest="${basedir}/spark-manifest.xml"/>
 		    <jvmarg line="${asdoc.jvm.args}"/>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/bundle-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/bundle-config.xml b/frameworks/projects/experimental_mobile/bundle-config.xml
index 0fce3e0..3a1117c 100644
--- a/frameworks/projects/experimental_mobile/bundle-config.xml
+++ b/frameworks/projects/experimental_mobile/bundle-config.xml
@@ -18,35 +18,33 @@
 -->
 <flex-config>
 
-    <compiler>        
+    <compiler>
         <external-library-path>
             <path-element>${env.PLAYERGLOBAL_HOME}/${playerglobal.version}/playerglobal.swc</path-element>
             <path-element>../../libs/framework.swc</path-element>
-            <path-element>../../libs/spark.swc</path-element>
-            <path-element>../../libs/mobile/mobilecomponents.swc</path-element>
         </external-library-path>
-        
+
         <include-libraries/>
-        
+
         <library-path/>
-        
+
         <locale>
             <locale-element>${locale}</locale-element>
         </locale>
-        
+
         <source-path>
             <path-element>src</path-element>
             <path-element>bundles/${locale}</path-element>
         </source-path>
     </compiler>
-    
+
     <include-classes/>
-    
+
     <include-namespaces/>
-    
+
     <include-resource-bundles>
         <bundle>experimental</bundle>
     </include-resource-bundles>
-        
+
     <target-player>${playerglobal.version}</target-player>
 </flex-config>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/compile-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/compile-config.xml b/frameworks/projects/experimental_mobile/compile-config.xml
index 4e0ee97..7a21013 100644
--- a/frameworks/projects/experimental_mobile/compile-config.xml
+++ b/frameworks/projects/experimental_mobile/compile-config.xml
@@ -22,11 +22,14 @@
         <accessible>true</accessible>
 
         <external-library-path>
-            <path-element>${env.PLAYERGLOBAL_HOME}/${playerglobal.version}/playerglobal.swc</path-element>
+            <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element>
+            <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element>
             <path-element>../../libs/framework.swc</path-element>
+            <path-element>../../libs/apache.swc</path-element>
             <path-element>../../libs/spark.swc</path-element>
             <path-element>../../libs/textlayout.swc</path-element>
             <path-element>../../libs/mobile/mobilecomponents.swc</path-element>
+            <path-element>../../themes/Mobile/mobile.swc</path-element>
         </external-library-path>
 
         <keep-as3-metadata>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/defaults.css b/frameworks/projects/experimental_mobile/defaults.css
index 66188a1..236ea6f 100644
--- a/frameworks/projects/experimental_mobile/defaults.css
+++ b/frameworks/projects/experimental_mobile/defaults.css
@@ -18,3 +18,132 @@
 */
 @namespace "http://flex.apache.org/experimental/ns";
 @namespace s "library://ns.adobe.com/flex/spark";
+@namespace supportClasses "spark.components.supportClasses.*";
+
+MobileGrid
+{
+    skinClass: ClassReference('spark.skins.MobileGridSkin');
+    contentBackgroundColor: #202020;
+    alternatingItemColors: #202020, #2a2a2a;
+    color: white;
+    selection-color: #00a2ff; /* blue  */
+}
+
+supportClasses|MobileGridHeader
+{
+    chromeColor: #383838;
+    skinClass: ClassReference('spark.skins.MobileGridHeaderButtonBarSkin');
+    fontWeight: bold;
+    /*   color: #f0f0f0;  */
+}
+
+supportClasses|ItemRendererBase
+{
+    verticalAlign: "middle";
+}
+
+@media (application-dpi: 120)
+{
+
+    supportClasses|MobileGridHeader
+    {
+        fontSize: 10;
+    }
+
+    supportClasses|MobileGridRowRenderer
+    {
+        paddingTop: 1;
+        paddingLeft: 7;
+        paddingRight: 7;
+        paddingBottom: 0;
+    }
+
+    supportClasses|ItemRendererBase
+    {
+        color: #bae5ff;
+        paddingBottom: 12;
+        paddingLeft: 7;
+        paddingRight: 7;
+        paddingTop: 12;
+    }
+}
+
+@media (application-dpi: 160)
+{
+
+    supportClasses|MobileGridHeader
+    {
+        fontSize: 14;
+    }
+
+    supportClasses|MobileGridRowRenderer
+    {
+        paddingTop: 1;
+        paddingLeft: 10;
+        paddingRight: 10;
+        paddingBottom: 0;
+    }
+
+    supportClasses|ItemRendererBase
+    {
+        color: #acffb5;
+        paddingBottom: 16;
+        paddingLeft: 10;
+        paddingRight: 10;
+        paddingTop: 16;
+    }
+}
+
+@media (application-dpi: 240)
+{
+
+    supportClasses|MobileGridHeader
+    {
+        fontSize: 20;
+    }
+
+    supportClasses|MobileGridRowRenderer
+    {
+        paddingTop: 2;
+        paddingLeft: 14;
+        paddingRight: 14;
+        paddingBottom: 0;
+    }
+
+    supportClasses|ItemRendererBase
+    {
+        color: #fbffa0;
+        paddingBottom: 24;
+        paddingLeft: 14;
+        paddingRight: 14;
+        paddingTop: 24;
+    }
+}
+
+@media (application-dpi: 320)
+{
+
+    supportClasses|MobileGridHeader
+    {
+        fontSize: 28;
+    }
+
+    supportClasses|MobileGridRowRenderer
+    {
+        color: #ffc2aa;
+        paddingTop: 2;
+        paddingLeft: 20;
+        paddingRight: 20;
+        paddingBottom: 0;
+    }
+
+    supportClasses|ItemRendererBase
+    {
+        paddingBottom: 32;
+        paddingLeft: 20;
+        paddingRight: 20;
+        paddingTop: 32;
+    }
+}
+
+

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/manifest.xml b/frameworks/projects/experimental_mobile/manifest.xml
index 4864d95..9cb9823 100644
--- a/frameworks/projects/experimental_mobile/manifest.xml
+++ b/frameworks/projects/experimental_mobile/manifest.xml
@@ -1,29 +1,28 @@
-<?xml version="1.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.
-
--->
-
-<!--
-
-    Experimental Mobile Components
-
--->
-<componentPackage>
-
-    
-</componentPackage>
+<?xml version="1.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.
+-->
+
+<!--
+    Experimental Mobile Components
+-->
+<componentPackage>
+    <component class="spark.components.MobileGrid"/>
+    <component class="spark.components.supportClasses.MobileGridColumn"/>
+    <component class="spark.components.itemRenderers.ItemBitmapPartRenderer"/>
+    <component class="spark.components.itemRenderers.ItemTextPartRenderer"/>
+</componentPackage>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as b/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
index 76e561c..215735f 100644
--- a/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
+++ b/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
@@ -18,13 +18,20 @@
 ////////////////////////////////////////////////////////////////////////////////
 package
 {
-	internal class ExperimentalMobileClasses
-	{
-		/**
-		 *  @private
-		 *  This class is used to link additional classes into experimental.swc
-		 *  beyond those that are found by dependecy analysis starting
-		 *  from the classes specified in manifest.xml.
-		 */
-	}
+import spark.components.MobileGrid;
+import spark.components.supportClasses.MobileGridColumn;
+import spark.skins.MobileGridHeaderButtonBarSkin;
+import spark.skins.MobileGridSkin;
+
+/*
+ classes that won't be detected through dependencies
+* and classes that needs to be includes in ASDOC
+* */
+
+ internal class ExperimentalMobileClasses
+{
+
+    // mamsellem: for some reason, the import statements alone are not enough to have the classes included
+    private static const classes:Array = [MobileGrid, MobileGridColumn, MobileGridSkin, MobileGridHeaderButtonBarSkin];
+}
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
new file mode 100644
index 0000000..618a1bc
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
@@ -0,0 +1,302 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components
+{
+
+import mx.collections.ICollectionView;
+import mx.collections.ISort;
+import mx.collections.ISortField;
+import mx.core.ClassFactory;
+import mx.core.ScrollPolicy;
+import mx.core.mx_internal;
+
+import spark.collections.Sort;
+import spark.components.supportClasses.IPartRendererDescriptor;
+import spark.components.supportClasses.MobileGridColumn;
+import spark.components.supportClasses.MobileGridHeader;
+import spark.components.supportClasses.MobileGridRowRenderer;
+import spark.events.MobileGridHeaderEvent;
+import spark.layouts.VerticalLayout;
+import spark.layouts.supportClasses.LayoutBase;
+
+use namespace  mx_internal;
+
+/**
+ *  Dispatched when the user releases the mouse button on a column header
+ *  to request the control to sort  the grid contents based on the contents of the column.
+ *  Only dispatched if the column is sortable and the data provider supports
+ *  sorting. The DataGrid control has a default handler for this event that implements
+ *  a single-column sort.
+ * <b>Note</b>: The sort arrows are defined by the default event handler for
+ * the headerRelease event. If you call the <code>preventDefault()</code> method
+ * in your event handler, the arrows are not drawn.
+ * </p>
+ *
+ *  @eventType mx.events.DataGridEvent.HEADER_RELEASE
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ */
+[Event(name="sortChange", type="spark.events.MobileGridHeaderEvent")]
+
+/**
+ *  The MobileGrid displays a collection of items in a grid of rows and columns, with column headers, optimized for mobile devices.
+ * <p> The MobileGrid component provides the following features:    </p>
+ *  <ul>
+ *      <li> user can swipe through the rows in the datagrid. </li>
+ *      <li> supports single selection of a row. </li>
+ *      <li> rows can be sorted according to a given column by clicking on the column's header. </li>
+ *      <li> cells can be displayed as text in different fonts and formats, as images, or using a custom renderer. </li>
+ *      <li> default  skin uses dark shades of gray, and is available in different screen densities.</li>
+ *  </ul>
+ *
+ * <p> It's important to understand that MobileGrid does not have all the capabilities and flexibility of it's desktop equivalent,
+ * in order to ensure optimal display and scrolling performance on mobile devices. </p>
+ * <p>Typically, the following features are not available in MobileGrid: </p>
+ * <ul>
+ *     <li>the list of columns is static and cannot be changed at runtime</li>
+ *     <li>multiple selection is not supported </li>
+ *     <li>it's not possible to interactively reorder columns </li>
+ *     <li>custom cell renderers must be designed with care, preferably in ActionScript, to ensure good display performance </li>
+ *   </ul>
+ *
+ * <p>Internally,  MobileGrid inherits for Mobile spark.List component rather than any Grid or DataGrid, which means that all cell renderers in a single row are managed
+ * by one single MobileGridRowRenderer that  delegates the individual  cell renderers to light-weight sub-renderers. </p>
+ * <p> You usually don't access this internal row renderer yourself, and will rather define the individual cell renderers.</p>
+ * <p> This technique ensures optimal display and memory performance, which is critical for mobile devices,, at the price of less flexibility for cell renderers </p>
+ *
+ *  @see spark.components.supportClasses.MobileGridColumn
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ */
+public class MobileGrid extends List
+{
+
+    [SkinPart(required="true")]
+    public var headerGroup:MobileGridHeader;
+
+    private var _columns: Array;
+    private var _columnsChanged:Boolean = false;
+    private var _sortableColumns:Boolean = true;
+    private var lastSortIndex:int = -1;
+    private var sortIndex:int = -1;
+    private var sortColumn:MobileGridColumn;
+
+    public function MobileGrid()
+    {
+        layout = getDefaultLayout();
+        scrollSnappingMode = ScrollSnappingMode.LEADING_EDGE;
+        setStyle("horizontalScrollPolicy", ScrollPolicy.OFF);
+        useVirtualLayout = true;
+        columns = [];
+    }
+
+    /**
+     *  An array of MobileGridColumn objects, one for each column that  can be displayed.
+     *  <p>Contrary to desktop DataGrid, this property must be set explicitly , or no columns will be displayed.</p>
+     *  <p>If you want to change the set of columns,you need to re-assign the new array to the columns property.
+     *  Changes to the original array without assigning the property will have no effect.</p>
+     *
+     *  @see   spark.components.supportClasses.MobileGridColumn
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 9
+     *  @playerversion AIR 1.1
+     *  @productversion Flex 3
+     */
+    [Inspectable(arrayType="spark.components.supportClasses.MobileGridColumn")]
+    public function set columns(value:Array):void
+    {
+        _columns = value;
+        _columnsChanged = true;
+        invalidateProperties();
+        // copy  to vector and set indices
+    }
+
+    public function get columns():Array
+    {
+        return _columns.concat();
+    }
+
+    /**
+     *  A flag that indicates whether the user can sort the rows
+     *  by clicking on a column header cell.
+     *  If <code>true</code>, the user can sort the data provider items by
+     *  clicking on a column header cell.
+     *  If <code>true</code>, individual columns can be made to not respond
+     *  to a click on a header by setting the column's <code>sortable</code>
+     *  property to <code>false</code>.
+     *
+     *  <p>When a user releases the mouse button over a header cell, the DataGrid
+     *  control dispatches a <code>headerRelease</code> event if both
+     *  this property and the column's sortable property are <code>true</code>.
+     *  If no handler calls the <code>preventDefault()</code> method on the event, the
+     *  DataGrid sorts using that column's <code>MobileGridColumn.dataField</code> or
+     *  <code>MobileGridColumn.labelFunction</code> properties.</p>
+     *
+     *  @default true
+     *
+     *  @see spark.components.supportClasses.MobileGridColumn#sortable
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3.8
+     *  @productversion Flex 4.11
+     */
+    public function get sortableColumns():Boolean
+    {
+        return _sortableColumns && (dataProvider is ICollectionView);
+    }
+
+    public function set sortableColumns(value:Boolean):void
+    {
+        _sortableColumns = value;
+    }
+
+    override protected function commitProperties():void
+    {
+        super.commitProperties();
+        if (_columnsChanged){
+            _columnsChanged = false;
+            for (var i:int = 0; i < _columns.length; i++)
+            {
+                MobileGridColumn(_columns[i]).colNum = i;
+            }
+            initDefaultItemRenderer(_columns);
+            if (headerGroup)
+                headerGroup.columns = _columns;
+        }
+    }
+
+    /* default layout for row item renderers */
+    protected function getDefaultLayout():LayoutBase
+    {
+        var l:VerticalLayout = new VerticalLayout();
+        l.horizontalAlign = "contentJustify";
+        l.gap = 0;
+        return l;
+    }
+
+    protected function initDefaultItemRenderer(pcolumnDescriptors: Array):void
+    {
+        var cf:ClassFactory;
+        cf = new ClassFactory(MobileGridRowRenderer);
+        cf.properties = {
+            partRendererDescriptors: Vector.<IPartRendererDescriptor>(pcolumnDescriptors)
+        };
+        this.itemRenderer = cf;
+    }
+
+    override protected function partAdded(partName:String, instance:Object):void
+    {
+        if (instance === headerGroup)
+        {
+            headerGroup.dataGrid = this;
+            headerGroup.columns = _columns;
+            headerGroup.addEventListener(MobileGridHeaderEvent.SORT_CHANGE, headerGroup_sortChangeHandler);
+        }
+        super.partAdded(partName, instance);
+    }
+
+    override protected function partRemoved(partName:String, instance:Object):void
+    {
+        if (instance === headerGroup)
+        {
+            headerGroup.columns = null;
+            headerGroup.removeEventListener(MobileGridHeaderEvent.SORT_CHANGE, headerGroup_sortChangeHandler);
+        }
+        super.partRemoved(partName, instance);
+    }
+
+
+    private function headerGroup_sortChangeHandler(event:MobileGridHeaderEvent):void
+    {
+        var e:MobileGridHeaderEvent = MobileGridHeaderEvent(event.clone());
+        dispatchEvent( e)
+        if (!e.isDefaultPrevented())
+        {
+                 sortByColumn(e.columnIndex);
+        }
+    }
+
+    /* roughly same behavior as mx:DataGrid */
+    private function sortByColumn(index:int):void
+    {
+        var collection:ICollectionView = dataProvider as ICollectionView;
+        var c:MobileGridColumn = _columns[index];
+        if (!c.sortable)
+            return ;
+        var desc:Boolean = c.sortDescending;
+
+        // do the sort if we're allowed to
+        if (collection == null)
+            return;
+
+        var s:ISort = collection.sort;
+        var f:ISortField;
+
+        if (s)
+        {
+            s.compareFunction = null;
+            // analyze the current sort to see what we've been given
+            var sf:Array = s.fields;
+            if (sf)
+            {
+                for (var i:int = 0; i < sf.length; i++)
+                {
+
+                    if (sf[i].name == c.dataField)
+                    {
+                        // we're part of the current sort
+                        f = sf[i];
+                        // flip the logic so desc is new desired order
+                        desc = !f.descending;
+                        break;
+                    }
+                }
+            }
+        }
+        else
+            s = new Sort();
+
+        if (!f)
+            f = c.sortField;
+
+        c.sortDescending = desc;
+
+        // set the grid's sortIndex
+        lastSortIndex = sortIndex;
+        sortIndex = index;
+        sortColumn = c;
+        f.name = c.dataField;
+        f.descending = desc;
+        s.fields = [f];
+        collection.sort = s;
+        collection.refresh();
+
+        // update header
+        headerGroup.setSort(sortIndex, desc);
+    }
+
+
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
new file mode 100644
index 0000000..7194e75
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
@@ -0,0 +1,55 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.itemRenderers
+{
+
+import mx.core.IDataRenderer;
+import mx.styles.IStyleClient;
+
+/**
+ * This is the base interface that all mobile cell or other mobile item part renderers must implement.
+ */
+public interface IItemPartRendererBase extends IDataRenderer
+{
+    /** @private
+     *  Object to be used for providing styles to the part renderer.
+     * Mobile part  items renders being lightweight classes, they usually don't manage styles by themselves.
+     * This property is automatically set
+     */
+    function set styleProvider(value:IStyleClient):void ;
+
+    /**
+     * @private
+     */
+    function set cssStyleName(value:String):void;
+
+    /**
+     * @private
+     */
+    function getPreferredBoundsWidth(postLayoutTransform:Boolean = true):Number;
+
+    /**
+     * @private
+     */
+    function getPreferredBoundsHeight(postLayoutTransform:Boolean = true):Number;
+
+
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
new file mode 100644
index 0000000..69c3008
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.itemRenderers
+{
+
+import flash.display.DisplayObjectContainer;
+
+import mx.core.IDataRenderer;
+
+public interface IItemTextPartRenderer extends IItemPartRendererBase
+{
+
+    function set labelField(value:String):void;
+
+    function set labelFunction(value:Function):void;
+
+    function set textAlign(textAlign:String):void;
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
new file mode 100644
index 0000000..b5e7abe
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
@@ -0,0 +1,144 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.itemRenderers
+{
+
+import mx.core.BitmapAsset;
+import mx.styles.IStyleClient;
+
+import spark.utils.MultiDPIBitmapSourceExt;
+
+/** Default lightweight  class for rendering embedded Bitmaps  or Multi-DPI Bitmaps in a MobileGrid cell .
+ * <p> You define the icon to be used in each cell by setting either iconField or iconFunction properties.  </p>
+ *  */
+public class ItemBitmapPartRenderer extends BitmapAsset implements IItemPartRendererBase
+{
+
+    private var _iconFunction:Function = null;
+    private var _iconField:String = null;
+    protected var _data:Object;
+
+    public function ItemBitmapPartRenderer()
+    {
+        super();
+    }
+
+    /**
+     *  The name of the field or property in the DataGrid's dataProvider item that defines the icon to display for this renderer's column.
+     *  <p> The fields value must be either an embedded bitmap's class, or or MultiBitmapSourceExt object.   </p>
+     *   <p> If not set, then iconFunction will be used.  </p>
+     *  @default null
+     *
+     *  @see #iconFunction
+     *  @see  spark.utils.MultiDPIBitmapSourceExt
+     *
+     */
+    public function get iconField():String
+    {
+        return _iconField;
+    }
+
+    public function set iconField(value:String):void
+    {
+        _iconField = value;
+    }
+
+    /**
+     *  An user-provided function that converts a data provider item into an icon to display in each cell for this renderer's column.
+     *
+     *  <p>if set, this property is used even if iconField is also set.</p>
+     *  <p>The function specified to the <code>iconFunction</code> property
+     *  must have the following signature:</p>
+     *
+     *  <pre>iconFunction(item:Object):Object</pre>
+     *
+     *  <p>The <code>item</code> parameter is the data provider item for an entire row.</p>
+     *  <p> The function must return either an embedded bitmap's class, or a MultiBitmapSourceExt object .</p>
+     *
+     *  @default null
+     *
+     *  @see #iconLabel
+     *  @see  spark.utils.MultiDPIBitmapSourceExt
+     *
+     */
+    public function get iconFunction():Function
+    {
+        return _iconFunction;
+    }
+
+    public function set iconFunction(value:Function):void
+    {
+        _iconFunction = value;
+    }
+
+    public function set data(value:Object):void
+    {
+        var iconClass:Class;
+        _data = value;
+        var iconSource:Object = _iconFunction != null ? _iconFunction(_data) : _data[_iconField];
+        if (iconSource is MultiDPIBitmapSourceExt)
+        {
+            iconClass = MultiDPIBitmapSourceExt(iconSource).getSource(NaN) as Class;
+        }
+        else
+        {
+            iconClass = iconSource as Class;
+        }
+        if (iconClass != null)
+        {
+            var icon:BitmapAsset = new iconClass();
+            this.bitmapData = icon.bitmapData;
+        }
+        else
+        {
+            this.bitmapData = null;
+        }
+    }
+
+    public function get data():Object
+    {
+        return _data;
+    }
+
+    public function getPreferredBoundsWidth(postLayoutTransform:Boolean = true):Number
+    {
+        return bitmapData.width;
+    }
+
+    public function getPreferredBoundsHeight(postLayoutTransform:Boolean = true):Number
+    {
+        return bitmapData.height;
+    }
+
+    override public function setActualSize(newWidth:Number, newHeight:Number):void
+    {
+        // do nothing, bitmap renderer don't stretch for now
+    }
+
+    public function set styleProvider(value:IStyleClient):void
+    {
+        // do nothing, this renderer does not manages styles for now.
+    }
+
+    public function set cssStyleName(value:String):void
+    {
+    }
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
new file mode 100644
index 0000000..afb991e
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
@@ -0,0 +1,97 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.itemRenderers
+{
+
+import mx.core.mx_internal;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.IStyleClient;
+import mx.styles.StyleManager;
+
+import spark.components.supportClasses.StyleableTextField;
+import spark.utils.UIComponentUtils;
+
+use namespace mx_internal;
+
+/** Default lightweight  class for rendering formatted text in MobileGrid cells .
+ * <p> You don't have to use this render explicitly as it will be used by default for MobileGrid text cells. </p>
+ *  */
+public class ItemTextPartRenderer extends StyleableTextField implements IItemTextPartRenderer
+{
+
+    private var _labelFunction:Function;
+    private var _labelField:String;
+    private var _data:Object;
+
+    public function ItemTextPartRenderer()
+    {
+        super();
+        editable = false;
+        selectable = false;
+        multiline = true;
+    }
+
+    public function set styleProvider(value:IStyleClient):void
+    {
+        styleName = value;
+        commitStyles();
+    }
+
+    public function set textAlign(value:String):void
+    {
+        setStyle("textAlign", value);
+    }
+
+    public function set cssStyleName(pstyleName:String):void
+    {
+        var css:CSSStyleDeclaration = pstyleName ? StyleManager.getStyleManager(null).getStyleDeclaration("." + pstyleName) : null;
+        // must add to container before working on styles
+        styleDeclaration = css;     // for direct style
+        if (css)
+        {
+            leftMargin = css.getStyle("paddingLeft");
+            rightMargin = css.getStyle("paddingRight");
+            //     multiline = css.get
+        }
+    }
+
+    public function set data(value:Object):void
+    {
+        _data = value;
+        text = UIComponentUtils.itemToLabel(value, _labelField, _labelFunction);
+    }
+
+    public function get data():Object
+    {
+        return _data;
+    }
+
+    public function set labelField(value:String):void
+    {
+        _labelField = value;
+    }
+
+    public function set labelFunction(value:Function):void
+    {
+        _labelFunction = value;
+    }
+}
+}
+
+

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/IPartRendererDescriptor.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/IPartRendererDescriptor.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/IPartRendererDescriptor.as
new file mode 100644
index 0000000..c81f9f6
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/IPartRendererDescriptor.as
@@ -0,0 +1,34 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.supportClasses
+{
+
+import mx.core.IFactory;
+
+import spark.components.itemRenderers.IItemPartRendererBase;
+
+public interface IPartRendererDescriptor
+{
+    function get scaledWidth():Number;
+
+    function get itemRenderer():IFactory;
+
+    function createPartRenderer():IItemPartRendererBase;
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as
new file mode 100644
index 0000000..cf54c6e
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as
@@ -0,0 +1,894 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+/**  @private
+ *  monkey-patched  from LabelItemRenderer, pruned from label/labelDisplay  and change some variable accessibility
+ *  Provides default behavior for  ListMultiPartItemRenderer
+ *  Eventually should  become superclass of LabelItemRenderer
+ *  */
+
+package spark.components.supportClasses
+{
+import flash.display.GradientType;
+import flash.events.Event;
+import flash.geom.Matrix;
+
+import mx.core.DPIClassification;
+import mx.core.FlexGlobals;
+import mx.core.IDataRenderer;
+import mx.core.IFlexDisplayObject;
+import mx.core.ILayoutElement;
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+import mx.events.FlexEvent;
+
+import spark.components.DataGroup;
+import spark.components.IItemRenderer;
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the <code>data</code> property changes.
+ *
+ *  <p>When you use a component as an item renderer,
+ *  the <code>data</code> property contains the data to display.
+ *  You can listen for this event and update the component
+ *  when the <code>data</code> property changes.</p>
+ *
+ *  @eventType mx.events.FlexEvent.DATA_CHANGE
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Event(name="dataChange", type="mx.events.FlexEvent")]
+
+//--------------------------------------
+//  Styles
+//--------------------------------------
+
+[Style(name="paddingLeft", type="Number", format="Length", inherit="no")]
+
+/**
+ *  @copy spark.components.supportClasses.GroupBase#style:alternatingItemColors
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Style(name="alternatingItemColors", type="Array", arrayType="uint", format="Color", inherit="yes", theme="spark, mobile")]
+
+/**
+ *  @copy spark.components.supportClasses.GroupBase#style:chromeColor
+ *
+ *  @default 0xCCCCCC
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 1.5
+ *  @productversion Flex 4
+ */
+[Style(name="chromeColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]
+
+/**
+ *  @copy spark.components.supportClasses.GroupBase#style:downColor
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Style(name="downColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]
+
+/**
+ *  @copy spark.components.supportClasses.GroupBase#style:focusColor
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Style(name="focusColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]
+
+/**
+ *  Number of pixels between the bottom border and the text component
+ *  of the item renderer.
+ *
+ *  @default 5
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Style(name="paddingBottom", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Number of pixels between the top border and the text component
+ *  of the item renderer.
+ *
+ *  @default 5
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Style(name="paddingTop", type="Number", format="Length", inherit="no")]
+
+/**
+ *  @copy spark.components.supportClasses.GroupBase#style:rollOverColor
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Style(name="rollOverColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  @copy spark.components.List#style:selectionColor
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Style(name="selectionColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  @copy spark.components.supportClasses.GroupBase#style:symbolColor
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Style(name="symbolColor", type="uint", format="Color", inherit="yes", theme="spark,mobile")]
+
+/**
+ *  The vertical alignment of the content when it does not have
+ *  a one-to-one aspect ratio.
+ *  Possible values are <code>"top"</code>, <code>"center"</code>,
+ *  and <code>"bottom"</code>.
+ *
+ *  @default "center"
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 2.5
+ *  @productversion Flex 4.5
+ */
+[Style(name="verticalAlign", type="String", enumeration="bottom,middle,top", inherit="no")]
+
+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="focusBlendMode", kind="style")]
+[Exclude(name="focusThickness", kind="style")]
+
+public class ItemRendererBase extends UIComponent implements IDataRenderer, IItemRenderer
+{
+
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Constructor.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function ItemRendererBase()
+    {
+        super();
+
+        switch (applicationDPI)
+        {
+            case DPIClassification.DPI_480:
+            {
+                minHeight = 132;
+                break;
+            }
+            case DPIClassification.DPI_320:
+            {
+                minHeight = 88;
+                break;
+            }
+            case DPIClassification.DPI_240:
+            {
+                minHeight = 66;
+                break;
+            }
+            default:
+            {
+                // default PPI160
+                minHeight = 44;
+                break;
+            }
+        }
+
+        interactionStateDetector = new InteractionStateDetector(this);
+        interactionStateDetector.addEventListener(Event.CHANGE, interactionStateDetector_changeHandler);
+
+        cacheAsBitmap = true;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Private Properties
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     *  Helper class to help determine when we are in the hovered or down states
+     */
+    protected var interactionStateDetector:InteractionStateDetector;
+
+    /**
+     *  @private
+     *  Whether or not we're the last element in the list
+     */
+    mx_internal var isLastItem:Boolean = false;
+
+    //--------------------------------------------------------------------------
+    //
+    //  Public Properties
+    //
+    //--------------------------------------------------------------------------
+
+    //----------------------------------
+    //  data
+    //----------------------------------
+
+    /**
+     *  @private
+     */
+    private var _data:Object;
+
+    [Bindable("dataChange")]
+
+    /**
+     *  The implementation of the <code>data</code> property
+     *  as defined by the IDataRenderer interface.
+     *  When set, it stores the value and invalidates the component
+     *  to trigger a relayout of the component.
+     *
+     *  @see mx.core.IDataRenderer
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get data():Object
+    {
+        return _data;
+    }
+
+    /**
+     *  @private
+     */
+    public function set data(value:Object):void
+    {
+        _data = value;
+
+        if (hasEventListener(FlexEvent.DATA_CHANGE))
+            dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
+
+        if (_data) onDataChanged();
+    }
+
+    protected function onDataChanged():void
+    {
+        // set data related properties
+    }
+
+    //----------------------------------
+    //  down
+    //----------------------------------
+    /**
+     *  @private
+     *  storage for the down property
+     */
+    private var _down:Boolean = false;
+
+    /**
+     *  Set to <code>true</code> when the user is pressing down on an item renderer.
+     *
+     *  @default false
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function get down():Boolean
+    {
+        return _down;
+    }
+
+    /**
+     *  @private
+     */
+    protected function set down(value:Boolean):void
+    {
+        if (value == _down)
+            return;
+
+        _down = value;
+        invalidateDisplayList();
+    }
+
+    //----------------------------------
+    //  hovered
+    //----------------------------------
+    /**
+     *  @private
+     *  storage for the hovered property
+     */
+    private var _hovered:Boolean = false;
+
+    /**
+     *  Set to <code>true</code> when the user is hovered over the item renderer.
+     *
+     *  @default false
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function get hovered():Boolean
+    {
+        return _hovered;
+    }
+
+    /**
+     *  @private
+     */
+    protected function set hovered(value:Boolean):void
+    {
+        if (value == _hovered)
+            return;
+
+        _hovered = value;
+        invalidateDisplayList();
+    }
+
+    //----------------------------------
+    //  itemIndex
+    //----------------------------------
+
+    /**
+     *  @private
+     *  storage for the itemIndex property
+     */
+    private var _itemIndex:int;
+
+    /**
+     *  @inheritDoc
+     *
+     *  @default 0
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get itemIndex():int
+    {
+        return _itemIndex;
+    }
+
+    /**
+     *  @private
+     */
+    public function set itemIndex(value:int):void
+    {
+        var wasLastItem:Boolean = isLastItem;
+        var dataGroup:DataGroup = parent as DataGroup;
+        isLastItem = (dataGroup && (value == dataGroup.numElements - 1));
+
+        // if whether or not we are the last item in the last has changed then
+        // invalidate our display. note:  even if our new index has not changed,
+        // whether or not we're the last item may have so we perform this check
+        // before the value == _itemIndex check below
+        if (wasLastItem != isLastItem)
+            invalidateDisplayList();
+
+        if (value == _itemIndex)
+            return;
+
+        _itemIndex = value;
+
+        // only invalidateDisplayList() if this causes use to redraw which
+        // is only if alternatingItemColors are defined (and technically also
+        // only if we are not selected or down, etc..., but we'll ignore those
+        // as this will shortcut 95% of the time anyways)
+        if (getStyle("alternatingItemColors") !== undefined)
+            invalidateDisplayList();
+    }
+
+    public function get label():String
+    {
+        return "";
+    }
+
+    public function set label(value:String):void
+    {
+    }
+
+    private var _showsCaret:Boolean = false;
+
+    /**
+     *  @inheritDoc
+     *
+     *  @default false
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get showsCaret():Boolean
+    {
+        return _showsCaret;
+    }
+
+    /**
+     *  @private
+     */
+    public function set showsCaret(value:Boolean):void
+    {
+        if (value == _showsCaret)
+            return;
+
+        _showsCaret = value;
+        invalidateDisplayList();
+    }
+
+    //----------------------------------
+    //  selected
+    //----------------------------------
+
+    /**
+     *  @private
+     *  storage for the selected property
+     */
+    private var _selected:Boolean = false;
+
+    /**
+     *  @inheritDoc
+     *
+     *  @default false
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get selected():Boolean
+    {
+        return _selected;
+    }
+
+    /**
+     *  @private
+     */
+    public function set selected(value:Boolean):void
+    {
+        if (value == _selected)
+            return;
+
+        _selected = value;
+        invalidateDisplayList();
+    }
+
+    //----------------------------------
+    //  dragging
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the dragging property.
+     */
+    private var _dragging:Boolean = false;
+
+    /**
+     *  @inheritDoc
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get dragging():Boolean
+    {
+        return _dragging;
+    }
+
+    /**
+     *  @private
+     */
+    public function set dragging(value:Boolean):void
+    {
+        _dragging = value;
+    }
+
+
+    //----------------------------------
+    //  authorDensity
+    //----------------------------------
+    /**
+     *  Returns the DPI of the application.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    public function get applicationDPI():Number
+    {
+        return FlexGlobals.topLevelApplication.applicationDPI;
+    }
+
+
+    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        // clear the graphics before calling super.updateDisplayList()
+        graphics.clear();
+
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        drawBackground(unscaledWidth, unscaledHeight);
+
+        layoutContents(unscaledWidth, unscaledHeight);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Methods
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  Renders a background for the item renderer.
+     *
+     *  <p>This method, along with <code>layoutContents()</code>, is called
+     *  by the <code>updateDisplayList()</code> method.</p>
+     *
+     *  <p>This method draws the background and the outline for this item renderer.
+     *  It knows how to appropriately handle the selected, down, or caretted states.
+     *  However, when <code>alternatingItemColors</code> is set to <code>undefined</code>,
+     *  the default background is transparent.
+     *  Override this method to change the appearance of the background of
+     *  the item renderer.</p>
+     *
+     *  @param unscaledWidth Specifies the width of the component, in pixels,
+     *  in the component's coordinates, regardless of the value of the
+     *  <code>scaleX</code> property of the component.
+     *
+     *  @param unscaledHeight Specifies the height of the component, in pixels,
+     *  in the component's coordinates, regardless of the value of the
+     *  <code>scaleY</code> property of the component.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        // figure out backgroundColor
+        var backgroundColor:*;
+        var downColor:* = getStyle("downColor");
+        var drawBackground:Boolean = true;
+        var opaqueBackgroundColor:* = undefined;
+
+        if (down && downColor !== undefined)
+        {
+            backgroundColor = downColor;
+        }
+        else if (selected)
+        {
+            backgroundColor = getStyle("selectionColor");
+        }
+        else if (hovered)
+        {
+            backgroundColor = getStyle("rollOverColor");
+        }
+        else if (showsCaret)
+        {
+            backgroundColor = getStyle("selectionColor");
+        }
+        else
+        {
+            var alternatingColors:Array;
+            var alternatingColorsStyle:Object = getStyle("alternatingItemColors");
+
+            if (alternatingColorsStyle)
+                alternatingColors = (alternatingColorsStyle is Array) ? (alternatingColorsStyle as Array) : [alternatingColorsStyle];
+
+            if (alternatingColors && alternatingColors.length > 0)
+            {
+                // translate these colors into uints
+                styleManager.getColorNames(alternatingColors);
+
+                backgroundColor = alternatingColors[itemIndex % alternatingColors.length];
+            }
+            else
+            {
+                // don't draw background if it is the contentBackgroundColor. The
+                // list skin handles the background drawing for us.
+                drawBackground = false;
+            }
+
+        }
+
+        // draw backgroundColor
+        // the reason why we draw it in the case of drawBackground == 0 is for
+        // mouse hit testing purposes
+        graphics.beginFill(backgroundColor, drawBackground ? 1 : 0);
+        graphics.lineStyle();
+        graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
+        graphics.endFill();
+
+        // Selected and down states have a gradient overlay as well
+        // as different separators colors/alphas
+        if (selected || down)
+        {
+            var colors:Array = [0x000000, 0x000000 ];
+            var alphas:Array = [.2, .1];
+            var ratios:Array = [0, 255];
+            var matrix:Matrix = new Matrix();
+
+            // gradient overlay
+            matrix.createGradientBox(unscaledWidth, unscaledHeight, Math.PI / 2, 0, 0);
+            graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, matrix);
+            graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
+            graphics.endFill();
+        }
+        else if (drawBackground)
+        {
+            // If our background is a solid color, use it as the opaqueBackground property
+            // for this renderer. This makes scrolling considerably faster.
+            opaqueBackgroundColor = backgroundColor;
+        }
+
+        // Draw the separator for the item renderer
+        drawBorder(unscaledWidth, unscaledHeight, alternatingColorsStyle != null);
+
+        opaqueBackground = opaqueBackgroundColor;
+    }
+
+    /**
+     *  Renders the border for the item renderer.
+     *
+     *  <p>This method is called by <code>drawBackground</code> after the
+     *  background has been rendered.</p>
+     *
+     *  <p>Override this method to change the appearance of the separator or
+     *  border of the item renderer.</p>
+     *
+     *  @param unscaledWidth Specifies the width of the component, in pixels,
+     *  in the component's coordinates, regardless of the value of the
+     *  <code>scaleX</code> property of the component.
+     *
+     *  @param unscaledHeight Specifies the height of the component, in pixels,
+     *  in the component's coordinates, regardless of the value of the
+     *  <code>scaleY</code> property of the component.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 3.0
+     *  @productversion Flex 4.6
+     */
+    protected function drawBorder(unscaledWidth:Number, unscaledHeight:Number, hasAlternatingColors:Boolean):void
+    {
+        var topSeparatorColor:uint;
+        var topSeparatorAlpha:Number;
+        var bottomSeparatorColor:uint;
+        var bottomSeparatorAlpha:Number;
+
+        var borderWidth:Number = 1;
+        var drawBottomBorder:Boolean = !hasAlternatingColors; // if alternating colors, don't draw shadow
+
+        // separators are a highlight on the top and shadow on the bottom
+        topSeparatorColor = 0xFFFFFF;
+        topSeparatorAlpha = .3;
+        bottomSeparatorColor = 0x000000;
+        bottomSeparatorAlpha = .3;
+
+
+        // draw separators
+        // don't draw top separator for down and selected states
+        if (!(selected || down))
+        {
+            graphics.beginFill(topSeparatorColor, topSeparatorAlpha);
+            graphics.drawRect(0, 0, unscaledWidth, borderWidth);
+            graphics.endFill();
+        }
+
+        if (drawBottomBorder)
+            graphics.beginFill(bottomSeparatorColor, bottomSeparatorAlpha);
+        graphics.drawRect(0, unscaledHeight - (isLastItem ? 0 : borderWidth), unscaledWidth, borderWidth);
+        graphics.endFill();
+
+
+        // add extra separators to the first and last items so that
+        // the list looks correct during the scrolling bounce/pull effect
+        // top
+        if (itemIndex == 0 && drawBottomBorder)
+        {
+            graphics.beginFill(bottomSeparatorColor, bottomSeparatorAlpha);
+            graphics.drawRect(0, -borderWidth, unscaledWidth, borderWidth);
+            graphics.endFill();
+        }
+
+        // bottom
+        if (isLastItem)
+        {
+            // we want to offset the bottom by 1 so that we don't get
+            // a double line at the bottom of the list if there's a
+            // border
+            graphics.beginFill(topSeparatorColor, topSeparatorAlpha);
+            graphics.drawRect(0, unscaledHeight + borderWidth, unscaledWidth, borderWidth);
+            graphics.endFill();
+        }
+    }
+
+    /**
+     *  Positions the children for this item renderer.
+     *
+     *  <p>This method, along with <code>drawBackground()</code>, is called
+     *  by the <code>updateDisplayList()</code> method.</p>
+     *
+     *  <p>This method positions the <code>labelDisplay</code> component.
+     *  Subclasses should override this to position their children.</p>
+     *
+     *  @param unscaledWidth Specifies the width of the component, in pixels,
+     *  in the component's coordinates, regardless of the value of the
+     *  <code>scaleX</code> property of the component.
+     *
+     *  @param unscaledHeight Specifies the height of the component, in pixels,
+     *  in the component's coordinates, regardless of the value of the
+     *  <code>scaleY</code> property of the component.
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+
+    }
+
+    protected function setElementPosition(element:Object, x:Number, y:Number):void
+    {
+        if (element is ILayoutElement)
+        {
+            ILayoutElement(element).setLayoutBoundsPosition(x, y, false);
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            IFlexDisplayObject(element).move(x, y);
+        }
+        else
+        {
+            element.x = x;
+            element.y = y;
+        }
+    }
+
+    /**
+     *  @copy spark.skins.mobile.supportClasses.MobileSkin#setElementSize()
+     *
+     *  @see #setElementPosition
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function setElementSize(element:Object, width:Number, height:Number):void
+    {
+        if (element is ILayoutElement)
+        {
+            ILayoutElement(element).setLayoutBoundsSize(width, height, false);
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            IFlexDisplayObject(element).setActualSize(width, height);
+        }
+        else
+        {
+            element.width = width;
+            element.height = height;
+        }
+    }
+
+    /**
+     *  @copy spark.skins.mobile.supportClasses.MobileSkin#getElementPreferredWidth()
+     *
+     *  @see #setElementPosition
+     *  @see #setElementSize
+     *  @see #getElementPreferredHeight
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function getElementPreferredWidth(element:Object):Number
+    {
+        var result:Number;
+
+        if (element is ILayoutElement)
+        {
+            result = ILayoutElement(element).getPreferredBoundsWidth();
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            result = IFlexDisplayObject(element).measuredWidth;
+        }
+        else
+        {
+            result = element.width;
+        }
+
+        return Math.round(result);
+    }
+
+    /**
+     *  @copy spark.skins.mobile.supportClasses.MobileSkin#getElementPreferredHeight()
+     *
+     *  @see #setElementPosition
+     *  @see #setElementSize
+     *  @see #getElementPreferredWidth
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 2.5
+     *  @productversion Flex 4.5
+     */
+    protected function getElementPreferredHeight(element:Object):Number
+    {
+        var result:Number;
+
+        if (element is ILayoutElement)
+        {
+            result = ILayoutElement(element).getPreferredBoundsHeight();
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            result = IFlexDisplayObject(element).measuredHeight;
+        }
+        else
+        {
+            result = element.height;
+        }
+
+        return Math.ceil(result);
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  Event Handlers
+    //
+    //--------------------------------------------------------------------------
+
+    /**
+     *  @private
+     */
+    private function interactionStateDetector_changeHandler(event:Event):void
+    {
+        down = (interactionStateDetector.state == InteractionState.DOWN);
+        hovered = (interactionStateDetector.state == InteractionState.OVER);
+    }
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
new file mode 100644
index 0000000..e53a968
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
@@ -0,0 +1,119 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.supportClasses
+{
+import flash.display.DisplayObject;
+
+import spark.components.itemRenderers.IItemPartRendererBase;
+
+/**  @private
+ *  This is the base class for multi-part renderers that manages a vector of part renderers.
+ *  This class is responsible for creating and storing  the actual renderers from their descriptors
+ *  the layout of the part renderers is delegated to a subclass of ListMultiPartLayoutBase;
+ */
+public class ListMultiPartItemRendererBase extends ItemRendererBase
+{
+    private var _partRendererDescriptors:Vector.<IPartRendererDescriptor>;
+    private var _partRenderers:Vector.<IItemPartRendererBase>;
+    private var _partRenderersLayout:ListMultiPartLayoutBase;
+
+    public function ListMultiPartItemRendererBase()
+    {
+    }
+
+    /* set by DataGridMobile Factory */
+    public function set partRendererDescriptors(value:Vector.<IPartRendererDescriptor>):void
+    {
+        _partRendererDescriptors = value;
+        _partRenderers = new Vector.<IItemPartRendererBase>(_partRendererDescriptors.length);
+    }
+
+    public function get partRendererDescriptors():Vector.<IPartRendererDescriptor>
+    {
+        return _partRendererDescriptors;
+    }
+
+    public function get partRenderersLayout():ListMultiPartLayoutBase
+    {
+        return _partRenderersLayout;
+    }
+
+    public function set partRenderersLayout(value:ListMultiPartLayoutBase):void
+    {
+        _partRenderersLayout = value;
+    }
+
+    public function get partRenderers():Vector.<IItemPartRendererBase>
+    {
+        return _partRenderers;
+    }
+
+    override protected function createChildren():void
+    {
+        super.createChildren();
+        var desc:IPartRendererDescriptor;
+        var pr:IItemPartRendererBase;
+        for (var i:int = 0; i < _partRendererDescriptors.length; i++)
+        {
+            desc = _partRendererDescriptors[i];
+            pr = desc.createPartRenderer();
+            if (pr != null)
+            {
+                pr.styleProvider = this;
+                addChild(DisplayObject(pr));
+                _partRenderers[i] = pr;
+            }
+            else
+            {
+                //TODO move to resource bundle
+                throw  new Error("MobileGridColumn item renderer must implement spark.components.itemRenderers.IItemPartRendererBase") ;
+            }
+        }
+    }
+
+    override protected function measure():void
+    {
+        super.measure();
+        _partRenderersLayout.measure();
+    }
+
+   /** delegate children layout to its partRendererLayout
+    subclasses can override this method to layout chrome content
+    */
+    override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        _partRenderersLayout.layoutContents(unscaledWidth, unscaledHeight);
+    }
+
+    override protected function onDataChanged():void
+    {
+        var dpr:IItemPartRendererBase;
+        for (var i:int = 0; i < _partRenderers.length; i++)
+        {
+            dpr = _partRenderers[i];
+            dpr.data = data;
+        }
+        invalidateSize();
+    }
+
+
+
+}
+
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
new file mode 100644
index 0000000..0c8c5ff
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
@@ -0,0 +1,141 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.supportClasses
+{
+import mx.core.IFlexDisplayObject;
+import mx.core.ILayoutElement;
+
+import spark.components.itemRenderers.IItemPartRendererBase;
+
+/** @private
+ *   Abstract base class for laying out part renderers in a multi-part renderer.
+ *   Subclasses must override measure() and layoutContents() methods
+ */
+public class ListMultiPartLayoutBase extends Object
+{
+    private var _target:ListMultiPartItemRendererBase;
+
+    public function ListMultiPartLayoutBase(target:ListMultiPartItemRendererBase)
+    {
+        _target = target;
+    }
+
+    public function get target():ListMultiPartItemRendererBase
+    {
+        return _target;
+    }
+
+    protected function get partRendererDescriptors():Vector.<IPartRendererDescriptor>
+    {
+        return target.partRendererDescriptors;
+    }
+
+    protected function get partRenderers():Vector.<IItemPartRendererBase>
+    {
+        return target.partRenderers;
+    }
+
+    public function measure():void
+    {
+
+    }
+
+    /* vertical align middle
+     * give all columns the requested sizes, and the last column the remaining width  */
+    public function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+
+    }
+
+    protected function setElementPosition(element:Object, x:Number, y:Number):void
+    {
+        if (element is ILayoutElement)
+        {
+            ILayoutElement(element).setLayoutBoundsPosition(x, y, false);
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            IFlexDisplayObject(element).move(x, y);
+        }
+        else
+        {
+            element.x = x;
+            element.y = y;
+        }
+    }
+
+    protected function setElementSize(element:Object, width:Number, height:Number):void
+    {
+        if (element is ILayoutElement)
+        {
+            ILayoutElement(element).setLayoutBoundsSize(width, height, false);
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            IFlexDisplayObject(element).setActualSize(width, height);
+        }
+        else
+        {
+            element.width = width;
+            element.height = height;
+        }
+    }
+
+    protected function getElementPreferredWidth(element:Object):Number
+    {
+        var result:Number;
+
+        if (element is ILayoutElement)
+        {
+            result = ILayoutElement(element).getPreferredBoundsWidth();
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            result = IFlexDisplayObject(element).measuredWidth;
+        }
+        else
+        {
+            result = element.width;
+        }
+
+        return Math.round(result);
+    }
+
+    protected function getElementPreferredHeight(element:Object):Number
+    {
+        var result:Number;
+
+        if (element is ILayoutElement)
+        {
+            result = ILayoutElement(element).getPreferredBoundsHeight();
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            result = IFlexDisplayObject(element).measuredHeight;
+        }
+        else
+        {
+            result = element.height;
+        }
+
+        return Math.ceil(result);
+    }
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartTabbedLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartTabbedLayout.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartTabbedLayout.as
new file mode 100644
index 0000000..f211a8c
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartTabbedLayout.as
@@ -0,0 +1,82 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.supportClasses
+{
+import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.utils.UIComponentUtils;
+
+/** @private
+ *    this class is reponsible for laying out grid cells in a given MobileGrid row.
+ *    It will make sure that cell content is aligned according to the column widths.
+ */
+public class ListMultiPartTabbedLayout extends ListMultiPartLayoutBase
+{
+
+    public function ListMultiPartTabbedLayout(target:ListMultiPartItemRendererBase)
+    {
+        super(target);
+    }
+
+    override public function measure():void
+    {
+        super.measure();
+        var totalWidth:Number = 0;
+        for each (var ld:IPartRendererDescriptor in partRendererDescriptors)
+        {
+            totalWidth += ld.scaledWidth;
+        }
+        target.measuredWidth = totalWidth;
+        target.measuredMinWidth = 50;
+    }
+
+    /* vertical align middle
+     * Layout algorithm:   give all columns the requested sizes, and the last column the remaining width  */
+    override public function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+
+        if (unscaledWidth == 0 && unscaledHeight == 0)
+            return;   // not ready
+        var cellPaddingLeft:Number = target.getStyle("paddingLeft");
+        var cellPaddingRight:Number = target.getStyle("paddingRight");
+        var paddingTop:Number = target.getStyle("paddingTop");
+        var paddingBottom:Number = target.getStyle("paddingBottom");
+        var cellHeight:Number = unscaledHeight - paddingTop - paddingBottom;
+
+        var desc:IPartRendererDescriptor;
+        var dpr:IItemPartRendererBase;
+        var remainingWidth:Number = unscaledWidth;
+        var curX:Number = cellPaddingLeft;
+        var curY:Number = paddingTop;
+        var partWidth:Number;
+        var partHeight:Number;
+        var count:int = partRenderers.length - 1;
+        for (var i:int = 0; i <= count; i++)
+        {
+            dpr = partRenderers[i];
+            desc = partRendererDescriptors[i];
+            partHeight = dpr.getPreferredBoundsHeight();
+            partWidth = Math.max(0, i == count ? remainingWidth : desc.scaledWidth - cellPaddingLeft - cellPaddingRight);
+            setElementSize(dpr, partWidth, partHeight);
+            setElementPosition(dpr, curX, curY + UIComponentUtils.offsetForCenter(partHeight, cellHeight));
+            curX += partWidth + cellPaddingRight + cellPaddingLeft;
+            remainingWidth -= desc.scaledWidth;
+        }
+    }
+}
+}


[08/15] git commit: [flex-sdk] [refs/heads/develop] - https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile - refactoring: more user friendly class names

Posted by ma...@apache.org.
https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile
- refactoring:  more user friendly class names


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/b68e1828
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/b68e1828
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/b68e1828

Branch: refs/heads/develop
Commit: b68e18285862309dd5f2419d13a2e23e415a2c69
Parents: 4482660
Author: mamsellem <ma...@systar.com>
Authored: Wed Oct 2 02:56:01 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Wed Oct 2 02:56:01 2013 +0200

----------------------------------------------------------------------
 .../projects/experimental_mobile/manifest.xml   |   4 +-
 .../itemRenderers/IItemPartRendererBase.as      |  64 ---------
 .../itemRenderers/IItemTextPartRenderer.as      |  39 ------
 .../itemRenderers/IMobileGridCellRenderer.as    |  64 +++++++++
 .../IMobileGridTextCellRenderer.as              |  39 ++++++
 .../itemRenderers/ItemBitmapPartRenderer.as     | 133 -------------------
 .../itemRenderers/ItemTextPartRenderer.as       | 112 ----------------
 .../MobileGridBitmapCellRenderer.as             | 133 +++++++++++++++++++
 .../itemRenderers/MobileGridTextCellRenderer.as | 112 ++++++++++++++++
 .../supportClasses/ListMultiPartColumnLayout.as |   6 +-
 .../supportClasses/MobileGridColumn.as          |  26 ++--
 .../supportClasses/MobileGridRowRenderer.as     |  14 +-
 12 files changed, 373 insertions(+), 373 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b68e1828/frameworks/projects/experimental_mobile/manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/manifest.xml b/frameworks/projects/experimental_mobile/manifest.xml
index 9cb9823..e4762f6 100644
--- a/frameworks/projects/experimental_mobile/manifest.xml
+++ b/frameworks/projects/experimental_mobile/manifest.xml
@@ -23,6 +23,6 @@
 <componentPackage>
     <component class="spark.components.MobileGrid"/>
     <component class="spark.components.supportClasses.MobileGridColumn"/>
-    <component class="spark.components.itemRenderers.ItemBitmapPartRenderer"/>
-    <component class="spark.components.itemRenderers.ItemTextPartRenderer"/>
+    <component class="spark.components.itemRenderers.MobileGridBitmapCellRenderer"/>
+    <component class="spark.components.itemRenderers.MobileGridTextCellRenderer"/>
 </componentPackage>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b68e1828/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
deleted file mode 100644
index 37ca652..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
+++ /dev/null
@@ -1,64 +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 spark.components.itemRenderers
-{
-
-import mx.core.IDataRenderer;
-import mx.styles.IStyleClient;
-
-/**
- * This is the base interface that all mobile cell or other mobile item part renderers must implement.
- * Contrary to desktop DataGrid control, there is no default base renderer,
- * because mobile renderers must be lightweight, and derive directly for the existing component, (ie. s:Button or s:CheckBox ).
- *
- *  @langversion 3.0
- *  @playerversion AIR 3.8
- *  @productversion Flex 4.11
- */
-public interface IItemPartRendererBase extends IDataRenderer
-{
-    /** @private
-     *  Object to be used for providing styles to the part renderer.
-     * Mobile part  items renders being lightweight classes, they usually don't manage styles by themselves.
-     * This property is automatically set
-     */
-    function set styleProvider(value:IStyleClient):void ;
-
-    function get canSetContentWidth():Boolean;
-
-    function get canSetContentHeight():Boolean;
-
-    /**
-     * @private
-     */
-    function set cssStyleName(value:String):void;
-
-    /**
-     * @private
-     */
-    function getPreferredBoundsWidth(postLayoutTransform:Boolean = true):Number;
-
-    /**
-     * @private
-     */
-    function getPreferredBoundsHeight(postLayoutTransform:Boolean = true):Number;
-
-
-}
-}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b68e1828/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
deleted file mode 100644
index 90ca694..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
+++ /dev/null
@@ -1,39 +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 spark.components.itemRenderers
-{
-
-/**  Extended interface for renderer that include text
- *  @langversion 3.0
- *  @playerversion AIR 3.8
- *  @productversion Flex 4.11
- */
-
-public interface IItemTextPartRenderer extends IItemPartRendererBase
-{
-    /* implement this property so that the renderer can receive the dataField from the renderer's MobileGridColumn*/
-    function set labelField(value:String):void;
-
-    /* implement this property so that the renderer can receive the labelFunction from the renderers' MobileGridColumn*/
-    function set labelFunction(value:Function):void;
-
-    /* implement this property so that the renderer can receive the textAlign property from the renderers' MobileGridColumn*/
-    function set textAlign(textAlign:String):void;
-}
-}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b68e1828/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridCellRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridCellRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridCellRenderer.as
new file mode 100644
index 0000000..eb5ddc7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridCellRenderer.as
@@ -0,0 +1,64 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.itemRenderers
+{
+
+import mx.core.IDataRenderer;
+import mx.styles.IStyleClient;
+
+/**
+ * This is the base interface that all mobile cell or other mobile item part renderers must implement.
+ * Contrary to desktop DataGrid control, there is no default base renderer,
+ * because mobile renderers must be lightweight, and derive directly for the existing component, (ie. s:Button or s:CheckBox ).
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ */
+public interface IMobileGridCellRenderer extends IDataRenderer
+{
+    /** @private
+     *  Object to be used for providing styles to the part renderer.
+     * Mobile part  items renders being lightweight classes, they usually don't manage styles by themselves.
+     * This property is automatically set
+     */
+    function set styleProvider(value:IStyleClient):void ;
+
+    function get canSetContentWidth():Boolean;
+
+    function get canSetContentHeight():Boolean;
+
+    /**
+     * @private
+     */
+    function set cssStyleName(value:String):void;
+
+    /**
+     * @private
+     */
+    function getPreferredBoundsWidth(postLayoutTransform:Boolean = true):Number;
+
+    /**
+     * @private
+     */
+    function getPreferredBoundsHeight(postLayoutTransform:Boolean = true):Number;
+
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b68e1828/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridTextCellRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridTextCellRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridTextCellRenderer.as
new file mode 100644
index 0000000..d26c312
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridTextCellRenderer.as
@@ -0,0 +1,39 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.itemRenderers
+{
+
+/**  Extended interface for renderer that include text
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ */
+
+public interface IMobileGridTextCellRenderer extends IMobileGridCellRenderer
+{
+    /* implement this property so that the renderer can receive the dataField from the renderer's MobileGridColumn*/
+    function set labelField(value:String):void;
+
+    /* implement this property so that the renderer can receive the labelFunction from the renderers' MobileGridColumn*/
+    function set labelFunction(value:Function):void;
+
+    /* implement this property so that the renderer can receive the textAlign property from the renderers' MobileGridColumn*/
+    function set textAlign(textAlign:String):void;
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b68e1828/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
deleted file mode 100644
index 29db838..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
+++ /dev/null
@@ -1,133 +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 spark.components.itemRenderers
-{
-
-import mx.core.mx_internal;
-import mx.graphics.BitmapFillMode;
-import mx.styles.IStyleClient;
-
-import spark.primitives.BitmapImage;
-
-use namespace mx_internal;
-
-/** Default lightweight  class for rendering embedded Bitmaps  or Multi-DPI Bitmaps in a MobileGrid cell .
- *You define the icon to be used in each cell by setting either iconField or iconFunction properties.
- *
- *  @langversion 3.0
- *  @playerversion AIR 3.8
- *  @productversion Flex 4.11
- *
- *  */
-public class ItemBitmapPartRenderer extends BitmapImage implements IItemPartRendererBase
-{
-
-    private var _iconFunction:Function = null;
-    private var _iconField:String = null;
-    protected var _data:Object;
-
-    public function ItemBitmapPartRenderer()
-    {
-        super();
-        _fillMode = BitmapFillMode.REPEAT; // do not stretch
-    }
-
-    /**
-     *  The name of the field or property in the DataGrid's dataProvider item that defines the icon to display for this renderer's column.
-     *  <p> The field value must be either an embedded bitmap's class, or or MultiBitmapSource object.   </p>
-     *   <p> If not set, then iconFunction will be used.  </p>
-     *  @default null
-     *
-     *  @see #iconFunction
-     *  @see  spark.utils.MultiDPIBitmapSource
-     *
-     */
-    public function get iconField():String
-    {
-        return _iconField;
-    }
-
-    public function set iconField(value:String):void
-    {
-        _iconField = value;
-    }
-
-    /**
-     *  An user-provided function that converts a data provider item into an icon to display in each cell for this renderer's column.
-     *
-     *  <p>if set, this property is used even if iconField is also set.</p>
-     *  <p>The function specified to the <code>iconFunction</code> property
-     *  must have the following signature:</p>
-     *
-     *  <pre>iconFunction(item:Object):Object</pre>
-     *
-     *  <p>The <code>item</code> parameter is the data provider item for an entire row.</p>
-     *  <p> The function must return either an embedded bitmap's class, or a MultiBitmapSource object .</p>
-     *
-     *  @default null
-     *
-     *  @see #iconLabel
-     *  @see  spark.utils.MultiDPIBitmapSource
-     *
-     */
-    public function get iconFunction():Function
-    {
-        return _iconFunction;
-    }
-
-    public function set iconFunction(value:Function):void
-    {
-        _iconFunction = value;
-    }
-
-    public function set data(value:Object):void
-    {
-        _data = value;
-        var iconSource:Object = _iconFunction != null ? _iconFunction(_data) : _data[_iconField];
-        this.source = iconSource;
-    }
-
-    public function get data():Object
-    {
-        return _data;
-    }
-
-    public function set styleProvider(value:IStyleClient):void
-    {
-        // do nothing, this renderer does not manages styles for now.
-    }
-
-    public function set cssStyleName(value:String):void
-    {
-
-    }
-
-    /* to avoid any scaling artifacts, we do not allow bitmap to be stretcghed */
-
-    public function get canSetContentWidth():Boolean
-    {
-        return false;
-    }
-
-    public function get canSetContentHeight():Boolean
-    {
-        return false;
-    }
-}
-}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b68e1828/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
deleted file mode 100644
index 2ad7118..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
+++ /dev/null
@@ -1,112 +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 spark.components.itemRenderers
-{
-
-import mx.core.mx_internal;
-import mx.styles.CSSStyleDeclaration;
-import mx.styles.IStyleClient;
-import mx.styles.StyleManager;
-
-import spark.components.supportClasses.StyleableTextField;
-import spark.utils.UIComponentUtils;
-
-use namespace mx_internal;
-
-/** Default lightweight  class for rendering formatted text in MobileGrid cells .
- * <p> You don't have to use this render explicitly as it will be used by default for MobileGrid text cells. </p>
- *
- *  @langversion 3.0
- *  @playerversion AIR 3.8
- *  @productversion Flex 4.11
- *
- *  */
-public class ItemTextPartRenderer extends StyleableTextField implements IItemTextPartRenderer
-{
-
-    private var _labelFunction:Function;
-    private var _labelField:String;
-    private var _data:Object;
-
-    public function ItemTextPartRenderer()
-    {
-        super();
-        editable = false;
-        selectable = false;
-        multiline = true;
-    }
-
-    public function set styleProvider(value:IStyleClient):void
-    {
-        styleName = value;
-        commitStyles();
-    }
-
-    public function set textAlign(value:String):void
-    {
-        setStyle("textAlign", value);
-    }
-
-    public function set cssStyleName(pstyleName:String):void
-    {
-        var css:CSSStyleDeclaration = pstyleName ? StyleManager.getStyleManager(null).getStyleDeclaration("." + pstyleName) : null;
-        // must add to container before working on styles
-        styleDeclaration = css;     // for direct style
-        if (css)
-        {
-            leftMargin = css.getStyle("paddingLeft");
-            rightMargin = css.getStyle("paddingRight");
-            //     multiline = css.get
-        }
-    }
-
-    public function set data(value:Object):void
-    {
-        _data = value;
-        text = UIComponentUtils.itemToLabel(value, _labelField, _labelFunction);
-    }
-
-    public function get data():Object
-    {
-        return _data;
-    }
-
-    public function set labelField(value:String):void
-    {
-        _labelField = value;
-    }
-
-    public function set labelFunction(value:Function):void
-    {
-        _labelFunction = value;
-    }
-
-    public function get canSetContentWidth():Boolean
-    {
-        return true;
-    }
-
-    public function get canSetContentHeight():Boolean
-    {
-        return false;
-    }
-}
-}
-
-

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b68e1828/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridBitmapCellRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridBitmapCellRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridBitmapCellRenderer.as
new file mode 100644
index 0000000..1eed532
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridBitmapCellRenderer.as
@@ -0,0 +1,133 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.itemRenderers
+{
+
+import mx.core.mx_internal;
+import mx.graphics.BitmapFillMode;
+import mx.styles.IStyleClient;
+
+import spark.primitives.BitmapImage;
+
+use namespace mx_internal;
+
+/** Default lightweight  class for rendering embedded Bitmaps  or Multi-DPI Bitmaps in a MobileGrid cell .
+ *You define the icon to be used in each cell by setting either iconField or iconFunction properties.
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ *
+ *  */
+public class MobileGridBitmapCellRenderer extends BitmapImage implements IMobileGridCellRenderer
+{
+
+    private var _iconFunction:Function = null;
+    private var _iconField:String = null;
+    protected var _data:Object;
+
+    public function MobileGridBitmapCellRenderer()
+    {
+        super();
+        _fillMode = BitmapFillMode.REPEAT; // do not stretch
+    }
+
+    /**
+     *  The name of the field or property in the DataGrid's dataProvider item that defines the icon to display for this renderer's column.
+     *  <p> The field value must be either an embedded bitmap's class, or or MultiBitmapSource object.   </p>
+     *   <p> If not set, then iconFunction will be used.  </p>
+     *  @default null
+     *
+     *  @see #iconFunction
+     *  @see  spark.utils.MultiDPIBitmapSource
+     *
+     */
+    public function get iconField():String
+    {
+        return _iconField;
+    }
+
+    public function set iconField(value:String):void
+    {
+        _iconField = value;
+    }
+
+    /**
+     *  An user-provided function that converts a data provider item into an icon to display in each cell for this renderer's column.
+     *
+     *  <p>if set, this property is used even if iconField is also set.</p>
+     *  <p>The function specified to the <code>iconFunction</code> property
+     *  must have the following signature:</p>
+     *
+     *  <pre>iconFunction(item:Object):Object</pre>
+     *
+     *  <p>The <code>item</code> parameter is the data provider item for an entire row.</p>
+     *  <p> The function must return either an embedded bitmap's class, or a MultiBitmapSource object .</p>
+     *
+     *  @default null
+     *
+     *  @see #iconLabel
+     *  @see  spark.utils.MultiDPIBitmapSource
+     *
+     */
+    public function get iconFunction():Function
+    {
+        return _iconFunction;
+    }
+
+    public function set iconFunction(value:Function):void
+    {
+        _iconFunction = value;
+    }
+
+    public function set data(value:Object):void
+    {
+        _data = value;
+        var iconSource:Object = _iconFunction != null ? _iconFunction(_data) : _data[_iconField];
+        this.source = iconSource;
+    }
+
+    public function get data():Object
+    {
+        return _data;
+    }
+
+    public function set styleProvider(value:IStyleClient):void
+    {
+        // do nothing, this renderer does not manages styles for now.
+    }
+
+    public function set cssStyleName(value:String):void
+    {
+
+    }
+
+    /* to avoid any scaling artifacts, we do not allow bitmap to be stretcghed */
+
+    public function get canSetContentWidth():Boolean
+    {
+        return false;
+    }
+
+    public function get canSetContentHeight():Boolean
+    {
+        return false;
+    }
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b68e1828/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as
new file mode 100644
index 0000000..139d9a3
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as
@@ -0,0 +1,112 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.itemRenderers
+{
+
+import mx.core.mx_internal;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.IStyleClient;
+import mx.styles.StyleManager;
+
+import spark.components.supportClasses.StyleableTextField;
+import spark.utils.UIComponentUtils;
+
+use namespace mx_internal;
+
+/** Default lightweight  class for rendering formatted text in MobileGrid cells .
+ * <p> You don't have to use this render explicitly as it will be used by default for MobileGrid text cells. </p>
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ *
+ *  */
+public class MobileGridTextCellRenderer extends StyleableTextField implements IMobileGridTextCellRenderer
+{
+
+    private var _labelFunction:Function;
+    private var _labelField:String;
+    private var _data:Object;
+
+    public function MobileGridTextCellRenderer()
+    {
+        super();
+        editable = false;
+        selectable = false;
+        multiline = true;
+    }
+
+    public function set styleProvider(value:IStyleClient):void
+    {
+        styleName = value;
+        commitStyles();
+    }
+
+    public function set textAlign(value:String):void
+    {
+        setStyle("textAlign", value);
+    }
+
+    public function set cssStyleName(pstyleName:String):void
+    {
+        var css:CSSStyleDeclaration = pstyleName ? StyleManager.getStyleManager(null).getStyleDeclaration("." + pstyleName) : null;
+        // must add to container before working on styles
+        styleDeclaration = css;     // for direct style
+        if (css)
+        {
+            leftMargin = css.getStyle("paddingLeft");
+            rightMargin = css.getStyle("paddingRight");
+            //     multiline = css.get
+        }
+    }
+
+    public function set data(value:Object):void
+    {
+        _data = value;
+        text = UIComponentUtils.itemToLabel(value, _labelField, _labelFunction);
+    }
+
+    public function get data():Object
+    {
+        return _data;
+    }
+
+    public function set labelField(value:String):void
+    {
+        _labelField = value;
+    }
+
+    public function set labelFunction(value:Function):void
+    {
+        _labelFunction = value;
+    }
+
+    public function get canSetContentWidth():Boolean
+    {
+        return true;
+    }
+
+    public function get canSetContentHeight():Boolean
+    {
+        return false;
+    }
+}
+}
+
+

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b68e1828/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
index 8cd7e27..1da5268 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
@@ -22,7 +22,7 @@ import mx.core.IFlexDisplayObject;
 import mx.core.ILayoutElement;
 import mx.core.mx_internal;
 
-import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.components.itemRenderers.IMobileGridCellRenderer;
 import spark.core.IGraphicElement;
 import spark.utils.UIComponentUtils;
 
@@ -56,7 +56,7 @@ public class ListMultiPartColumnLayout extends Object
         return target.graphicElementPartRenderers;
     }
 
-    protected function get partRenderers():Vector.<IItemPartRendererBase>
+    protected function get partRenderers():Vector.<IMobileGridCellRenderer>
     {
         return target.partRenderers;
     }
@@ -82,7 +82,7 @@ public class ListMultiPartColumnLayout extends Object
         var cellHeight:Number = unscaledHeight - paddingTop - paddingBottom;
 
         var desc:MobileGridColumn;
-        var dpr:IItemPartRendererBase;
+        var dpr:IMobileGridCellRenderer;
         var curX:Number = cellPaddingLeft;
         var curY:Number = paddingTop;
         var colWidth:Number;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b68e1828/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
index b7508f1..95d2d85 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
@@ -28,9 +28,9 @@ import mx.core.mx_internal;
 import mx.utils.ObjectUtil;
 
 import spark.collections.SortField;
-import spark.components.itemRenderers.IItemPartRendererBase;
-import spark.components.itemRenderers.IItemTextPartRenderer;
-import spark.components.itemRenderers.ItemTextPartRenderer;
+import spark.components.itemRenderers.IMobileGridCellRenderer;
+import spark.components.itemRenderers.IMobileGridTextCellRenderer;
+import spark.components.itemRenderers.MobileGridTextCellRenderer;
 
 /**
  *  The MobileGridColumn class defines  a column to display in a MobileGrid control.
@@ -150,19 +150,19 @@ public class MobileGridColumn extends EventDispatcher
     private var _itemRenderer:IFactory;
 
     /**
-     *  The class factory for the IItemPartRendererBase  class used to
+     *  The class factory for the IMobileGridCellRenderer  class used to
      *  render individual grid cells.
      *
      *  <p>The default item renderer is the ItemTextPartRenderer class,
      *  which displays the data item as text, optimized for mobile.  </p>
      *  <p>You can use also ItemBitmapPartRenderer to display embedded bitmaps, in which case you need to define the iconField or iconFunction </p>
-     *  <p>You can also  create custom item renderers by deriving any subclass of UIComponent (eg. s:Button) and implementing IItemPartRendererBase.
+     *  <p>You can also  create custom item renderers by deriving any subclass of UIComponent (eg. s:Button) and implementing IMobileGridCellRenderer.
      *  for performance reasons  it's preferable that your renderer be written in ActionScript
      *
      *  @see #dataField
-     *  @see spark.components.itemRenderers.ItemTextPartRenderer
-     *  @see spark.components.itemRenderers.ItemBitmapPartRenderer
-     *  @see spark.components.itemRenderers.IItemPartRendererBase
+     *  @see spark.components.itemRenderers.MobileGridTextCellRenderer
+     *  @see spark.components.itemRenderers.MobileGridBitmapCellRenderer
+     *  @see spark.components.itemRenderers.IMobileGridCellRenderer
      *
      */
     public function get itemRenderer():IFactory
@@ -172,7 +172,7 @@ public class MobileGridColumn extends EventDispatcher
 
     public function set itemRenderer(value:IFactory):void
     {
-        _itemRenderer = value ? value : new ClassFactory(ItemTextPartRenderer);
+        _itemRenderer = value ? value : new ClassFactory(MobileGridTextCellRenderer);
     }
 
     private var _labelFunction:Function;
@@ -325,15 +325,15 @@ public class MobileGridColumn extends EventDispatcher
         return sortField;
     }
 
-    public function createPartRenderer():IItemPartRendererBase
+    public function createPartRenderer():IMobileGridCellRenderer
     {
-        var pr:IItemPartRendererBase = _itemRenderer.newInstance() as IItemPartRendererBase;
+        var pr:IMobileGridCellRenderer = _itemRenderer.newInstance() as IMobileGridCellRenderer;
         if (pr)
         {
             pr.cssStyleName = _styleName;
-            if (pr is IItemTextPartRenderer)
+            if (pr is IMobileGridTextCellRenderer)
             {
-                with (IItemTextPartRenderer(pr))
+                with (IMobileGridTextCellRenderer(pr))
                 {
                     labelField = _dataField;
                     labelFunction = _labelFunction;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b68e1828/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
index c3a1446..832997d 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
@@ -20,7 +20,7 @@ package spark.components.supportClasses
 {
 import flash.display.DisplayObject;
 
-import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.components.itemRenderers.IMobileGridCellRenderer;
 import spark.core.DisplayObjectSharingMode;
 import spark.core.IGraphicElement;
 import spark.core.IGraphicElementContainer;
@@ -42,7 +42,7 @@ import spark.core.ISharedDisplayObject;
 public class MobileGridRowRenderer extends ItemRendererBase implements IGraphicElementContainer, ISharedDisplayObject
 {
     private var _columns:Vector.<MobileGridColumn>;
-    private var _partRenderers:Vector.<IItemPartRendererBase>;
+    private var _partRenderers:Vector.<IMobileGridCellRenderer>;
     private var _graphicElementPartRenderers:Vector.<IGraphicElement>;
     private var _partRenderersLayout:ListMultiPartColumnLayout;
 
@@ -63,7 +63,7 @@ public class MobileGridRowRenderer extends ItemRendererBase implements IGraphicE
     public function set columns(value:Vector.<MobileGridColumn>):void
     {
         _columns = value;
-        _partRenderers = new Vector.<IItemPartRendererBase>(_columns.length, true);
+        _partRenderers = new Vector.<IMobileGridCellRenderer>(_columns.length, true);
         _graphicElementPartRenderers = new Vector.<IGraphicElement>();
     }
 
@@ -72,7 +72,7 @@ public class MobileGridRowRenderer extends ItemRendererBase implements IGraphicE
         return _columns;
     }
 
-    public function get partRenderers():Vector.<IItemPartRendererBase>
+    public function get partRenderers():Vector.<IMobileGridCellRenderer>
     {
         return _partRenderers;
     }
@@ -86,7 +86,7 @@ public class MobileGridRowRenderer extends ItemRendererBase implements IGraphicE
     {
         super.createChildren();
         var desc:MobileGridColumn;
-        var pr:IItemPartRendererBase;
+        var pr:IMobileGridCellRenderer;
         var ge:IGraphicElement;
         for (var i:int = 0; i < _columns.length; i++)
         {
@@ -115,7 +115,7 @@ public class MobileGridRowRenderer extends ItemRendererBase implements IGraphicE
             else
             {
                 //TODO move to resource bundle
-                throw  new Error("MobileGridColumn item renderer must implement spark.components.itemRenderers.IItemPartRendererBase");
+                throw  new Error("MobileGridColumn item renderer must implement spark.components.itemRenderers.IMobileGridCellRenderer");
             }
         }
     }
@@ -136,7 +136,7 @@ public class MobileGridRowRenderer extends ItemRendererBase implements IGraphicE
 
     override protected function onDataChanged():void
     {
-        var dpr:IItemPartRendererBase;
+        var dpr:IMobileGridCellRenderer;
         for (var i:int = 0; i < _partRenderers.length; i++)
         {
             dpr = _partRenderers[i];


[06/15] git commit: [flex-sdk] [refs/heads/develop] - https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile - fixed Bitmap scaling using BitmapImage instead of BitmapAsset - fixed last column width

Posted by ma...@apache.org.
https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile
- fixed Bitmap scaling using BitmapImage instead of BitmapAsset
- fixed last column width


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/fe39973b
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/fe39973b
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/fe39973b

Branch: refs/heads/develop
Commit: fe39973bd62f7ebac64a16de58f8070517bba877
Parents: b78de5c
Author: mamsellem <ma...@systar.com>
Authored: Tue Oct 1 23:05:14 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Tue Oct 1 23:05:14 2013 +0200

----------------------------------------------------------------------
 .../projects/experimental_mobile/defaults.css   |  38 +++-
 .../src/ExperimentalMobileClasses.as            |   6 +-
 .../src/spark/components/MobileGrid.as          |  34 ++--
 .../itemRenderers/IItemPartRendererBase.as      |   5 +-
 .../itemRenderers/IItemTextPartRenderer.as      |   4 -
 .../itemRenderers/ItemBitmapPartRenderer.as     |  54 ++----
 .../itemRenderers/ItemTextPartRenderer.as       |  10 ++
 .../supportClasses/IPartRendererDescriptor.as   |  34 ----
 .../supportClasses/ListMultiPartColumnLayout.as |  97 +++++++++++
 .../ListMultiPartItemRendererBase.as            | 172 +++++++++++++++++--
 .../supportClasses/ListMultiPartLayoutBase.as   |   9 +-
 .../supportClasses/ListMultiPartTabbedLayout.as |  82 ---------
 .../supportClasses/MobileGridColumn.as          |   6 +-
 .../supportClasses/MobileGridHeader.as          |  15 +-
 .../supportClasses/MobileGridRowRenderer.as     |   2 +-
 .../PartRendererDescriptorBase.as               |  69 ++++----
 .../src/spark/events/MobileGridHeaderEvent.as   |   2 +-
 .../src/spark/skins/MobileGridSkin.as           |   3 +-
 .../src/spark/utils/DensityUtil2.as             |  38 +---
 .../src/spark/utils/MultiDPIBitmapSourceExt.as  |  23 ++-
 .../src/spark/utils/UIComponentUtils.as         |  34 ----
 21 files changed, 433 insertions(+), 304 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/defaults.css b/frameworks/projects/experimental_mobile/defaults.css
index 236ea6f..aaf188b 100644
--- a/frameworks/projects/experimental_mobile/defaults.css
+++ b/frameworks/projects/experimental_mobile/defaults.css
@@ -26,7 +26,8 @@ MobileGrid
     contentBackgroundColor: #202020;
     alternatingItemColors: #202020, #2a2a2a;
     color: white;
-    selection-color: #00a2ff; /* blue  */
+     selection-color: #00a2ff; /* blue  */
+
 }
 
 supportClasses|MobileGridHeader
@@ -37,9 +38,10 @@ supportClasses|MobileGridHeader
     /*   color: #f0f0f0;  */
 }
 
-supportClasses|ItemRendererBase
+supportClasses|MobileGridRowRenderer
 {
     verticalAlign: "middle";
+    downColor: #000000;;
 }
 
 @media (application-dpi: 120)
@@ -60,7 +62,6 @@ supportClasses|ItemRendererBase
 
     supportClasses|ItemRendererBase
     {
-        color: #bae5ff;
         paddingBottom: 12;
         paddingLeft: 7;
         paddingRight: 7;
@@ -73,7 +74,7 @@ supportClasses|ItemRendererBase
 
     supportClasses|MobileGridHeader
     {
-        fontSize: 14;
+        fontSize: 18;
     }
 
     supportClasses|MobileGridRowRenderer
@@ -86,7 +87,6 @@ supportClasses|ItemRendererBase
 
     supportClasses|ItemRendererBase
     {
-        color: #acffb5;
         paddingBottom: 16;
         paddingLeft: 10;
         paddingRight: 10;
@@ -112,7 +112,6 @@ supportClasses|ItemRendererBase
 
     supportClasses|ItemRendererBase
     {
-        color: #fbffa0;
         paddingBottom: 24;
         paddingLeft: 14;
         paddingRight: 14;
@@ -130,7 +129,6 @@ supportClasses|ItemRendererBase
 
     supportClasses|MobileGridRowRenderer
     {
-        color: #ffc2aa;
         paddingTop: 2;
         paddingLeft: 20;
         paddingRight: 20;
@@ -146,4 +144,30 @@ supportClasses|ItemRendererBase
     }
 }
 
+@media (application-dpi: 480)
+{
+
+    supportClasses|MobileGridHeader
+    {
+        fontSize: 40;
+    }
+
+    supportClasses|MobileGridRowRenderer
+    {
+        paddingTop: 4;
+        paddingLeft: 28;
+        paddingRight: 28;
+        paddingBottom: 0;
+    }
+
+    supportClasses|ItemRendererBase
+    {
+        paddingBottom: 48;
+        paddingLeft: 28;
+        paddingRight: 28;
+        paddingTop: 48;
+    }
+}
+
+
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as b/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
index 215735f..b695712 100644
--- a/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
+++ b/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
@@ -25,10 +25,10 @@ import spark.skins.MobileGridSkin;
 
 /*
  classes that won't be detected through dependencies
-* and classes that needs to be includes in ASDOC
-* */
+ * and classes that needs to be includes in ASDOC
+ * */
 
- internal class ExperimentalMobileClasses
+internal class ExperimentalMobileClasses
 {
 
     // mamsellem: for some reason, the import statements alone are not enough to have the classes included

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
index 618a1bc..4161580 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
@@ -27,10 +27,10 @@ import mx.core.ScrollPolicy;
 import mx.core.mx_internal;
 
 import spark.collections.Sort;
-import spark.components.supportClasses.IPartRendererDescriptor;
 import spark.components.supportClasses.MobileGridColumn;
 import spark.components.supportClasses.MobileGridHeader;
 import spark.components.supportClasses.MobileGridRowRenderer;
+import spark.components.supportClasses.PartRendererDescriptorBase;
 import spark.events.MobileGridHeaderEvent;
 import spark.layouts.VerticalLayout;
 import spark.layouts.supportClasses.LayoutBase;
@@ -58,7 +58,7 @@ use namespace  mx_internal;
 
 /**
  *  The MobileGrid displays a collection of items in a grid of rows and columns, with column headers, optimized for mobile devices.
- * <p> The MobileGrid component provides the following features:    </p>
+ *  The MobileGrid component provides the following features:
  *  <ul>
  *      <li> user can swipe through the rows in the datagrid. </li>
  *      <li> supports single selection of a row. </li>
@@ -69,18 +69,18 @@ use namespace  mx_internal;
  *
  * <p> It's important to understand that MobileGrid does not have all the capabilities and flexibility of it's desktop equivalent,
  * in order to ensure optimal display and scrolling performance on mobile devices. </p>
- * <p>Typically, the following features are not available in MobileGrid: </p>
+ * <p>Typically, the following features are not available in MobileGrid:
  * <ul>
  *     <li>the list of columns is static and cannot be changed at runtime</li>
  *     <li>multiple selection is not supported </li>
  *     <li>it's not possible to interactively reorder columns </li>
  *     <li>custom cell renderers must be designed with care, preferably in ActionScript, to ensure good display performance </li>
  *   </ul>
- *
- * <p>Internally,  MobileGrid inherits for Mobile spark.List component rather than any Grid or DataGrid, which means that all cell renderers in a single row are managed
- * by one single MobileGridRowRenderer that  delegates the individual  cell renderers to light-weight sub-renderers. </p>
+ *  </p>
+ * <p>Internally,  MobileGrid inherits for Mobile spark.List component rather than any Grid or DataGrid, which means that all cell renderers
+ * in a single row are managed   by one single MobileGridRowRenderer that  delegates the individual  cell renderers to light-weight sub-renderers. </p>
  * <p> You usually don't access this internal row renderer yourself, and will rather define the individual cell renderers.</p>
- * <p> This technique ensures optimal display and memory performance, which is critical for mobile devices,, at the price of less flexibility for cell renderers </p>
+ * <p> This technique ensures optimal display and memory performance, which is critical for mobile devices,, at the price of less flexibility for cell renderers. </p>
  *
  *  @see spark.components.supportClasses.MobileGridColumn
  *
@@ -94,7 +94,7 @@ public class MobileGrid extends List
     [SkinPart(required="true")]
     public var headerGroup:MobileGridHeader;
 
-    private var _columns: Array;
+    private var _columns:Array;
     private var _columnsChanged:Boolean = false;
     private var _sortableColumns:Boolean = true;
     private var lastSortIndex:int = -1;
@@ -174,7 +174,8 @@ public class MobileGrid extends List
     override protected function commitProperties():void
     {
         super.commitProperties();
-        if (_columnsChanged){
+        if (_columnsChanged)
+        {
             _columnsChanged = false;
             for (var i:int = 0; i < _columns.length; i++)
             {
@@ -195,12 +196,12 @@ public class MobileGrid extends List
         return l;
     }
 
-    protected function initDefaultItemRenderer(pcolumnDescriptors: Array):void
+    protected function initDefaultItemRenderer(pcolumnDescriptors:Array):void
     {
         var cf:ClassFactory;
         cf = new ClassFactory(MobileGridRowRenderer);
         cf.properties = {
-            partRendererDescriptors: Vector.<IPartRendererDescriptor>(pcolumnDescriptors)
+            partRendererDescriptors: Vector.<PartRendererDescriptorBase>(pcolumnDescriptors)
         };
         this.itemRenderer = cf;
     }
@@ -230,10 +231,10 @@ public class MobileGrid extends List
     private function headerGroup_sortChangeHandler(event:MobileGridHeaderEvent):void
     {
         var e:MobileGridHeaderEvent = MobileGridHeaderEvent(event.clone());
-        dispatchEvent( e)
+        dispatchEvent(e)
         if (!e.isDefaultPrevented())
         {
-                 sortByColumn(e.columnIndex);
+            sortByColumn(e.columnIndex);
         }
     }
 
@@ -243,7 +244,7 @@ public class MobileGrid extends List
         var collection:ICollectionView = dataProvider as ICollectionView;
         var c:MobileGridColumn = _columns[index];
         if (!c.sortable)
-            return ;
+            return;
         var desc:Boolean = c.sortDescending;
 
         // do the sort if we're allowed to
@@ -297,6 +298,11 @@ public class MobileGrid extends List
     }
 
 
+    override public function validateSize(recursive:Boolean = false):void
+    {
+        super.validateSize(recursive);
+    }
+
 
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
index 7194e75..ab802f3 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
@@ -34,6 +34,10 @@ public interface IItemPartRendererBase extends IDataRenderer
      */
     function set styleProvider(value:IStyleClient):void ;
 
+    function get canSetWidth():Boolean;
+
+    function get canSetHeight():Boolean;
+
     /**
      * @private
      */
@@ -50,6 +54,5 @@ public interface IItemPartRendererBase extends IDataRenderer
     function getPreferredBoundsHeight(postLayoutTransform:Boolean = true):Number;
 
 
-
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
index 69c3008..edcc0f9 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
@@ -19,10 +19,6 @@
 package spark.components.itemRenderers
 {
 
-import flash.display.DisplayObjectContainer;
-
-import mx.core.IDataRenderer;
-
 public interface IItemTextPartRenderer extends IItemPartRendererBase
 {
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
index b5e7abe..c95195b 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
@@ -19,15 +19,18 @@
 package spark.components.itemRenderers
 {
 
-import mx.core.BitmapAsset;
+import mx.core.mx_internal;
+import mx.graphics.BitmapFillMode;
 import mx.styles.IStyleClient;
 
-import spark.utils.MultiDPIBitmapSourceExt;
+import spark.primitives.BitmapImage;
+
+use namespace mx_internal;
 
 /** Default lightweight  class for rendering embedded Bitmaps  or Multi-DPI Bitmaps in a MobileGrid cell .
  * <p> You define the icon to be used in each cell by setting either iconField or iconFunction properties.  </p>
  *  */
-public class ItemBitmapPartRenderer extends BitmapAsset implements IItemPartRendererBase
+public class ItemBitmapPartRenderer extends BitmapImage implements IItemPartRendererBase
 {
 
     private var _iconFunction:Function = null;
@@ -37,6 +40,7 @@ public class ItemBitmapPartRenderer extends BitmapAsset implements IItemPartRend
     public function ItemBitmapPartRenderer()
     {
         super();
+        _fillMode = BitmapFillMode.REPEAT; // do not stretch
     }
 
     /**
@@ -69,12 +73,12 @@ public class ItemBitmapPartRenderer extends BitmapAsset implements IItemPartRend
      *  <pre>iconFunction(item:Object):Object</pre>
      *
      *  <p>The <code>item</code> parameter is the data provider item for an entire row.</p>
-     *  <p> The function must return either an embedded bitmap's class, or a MultiBitmapSourceExt object .</p>
+     *  <p> The function must return either an embedded bitmap's class, or a MultiBitmapSource object .</p>
      *
      *  @default null
      *
      *  @see #iconLabel
-     *  @see  spark.utils.MultiDPIBitmapSourceExt
+     *  @see  spark.utils.MultiDPIBitmapSource
      *
      */
     public function get iconFunction():Function
@@ -89,26 +93,9 @@ public class ItemBitmapPartRenderer extends BitmapAsset implements IItemPartRend
 
     public function set data(value:Object):void
     {
-        var iconClass:Class;
         _data = value;
         var iconSource:Object = _iconFunction != null ? _iconFunction(_data) : _data[_iconField];
-        if (iconSource is MultiDPIBitmapSourceExt)
-        {
-            iconClass = MultiDPIBitmapSourceExt(iconSource).getSource(NaN) as Class;
-        }
-        else
-        {
-            iconClass = iconSource as Class;
-        }
-        if (iconClass != null)
-        {
-            var icon:BitmapAsset = new iconClass();
-            this.bitmapData = icon.bitmapData;
-        }
-        else
-        {
-            this.bitmapData = null;
-        }
+        this.source = iconSource;
     }
 
     public function get data():Object
@@ -116,29 +103,26 @@ public class ItemBitmapPartRenderer extends BitmapAsset implements IItemPartRend
         return _data;
     }
 
-    public function getPreferredBoundsWidth(postLayoutTransform:Boolean = true):Number
+    public function set styleProvider(value:IStyleClient):void
     {
-        return bitmapData.width;
+        // do nothing, this renderer does not manages styles for now.
     }
 
-    public function getPreferredBoundsHeight(postLayoutTransform:Boolean = true):Number
+    public function set cssStyleName(value:String):void
     {
-        return bitmapData.height;
-    }
 
-    override public function setActualSize(newWidth:Number, newHeight:Number):void
-    {
-        // do nothing, bitmap renderer don't stretch for now
     }
 
-    public function set styleProvider(value:IStyleClient):void
+    /* to avoid any scaling artifacts, we do not allow bitmap to be stretcghed */
+
+    public function get canSetWidth():Boolean
     {
-        // do nothing, this renderer does not manages styles for now.
+        return false;
     }
 
-    public function set cssStyleName(value:String):void
+    public function get canSetHeight():Boolean
     {
+        return false;
     }
-
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
index afb991e..ca3f542 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
@@ -91,6 +91,16 @@ public class ItemTextPartRenderer extends StyleableTextField implements IItemTex
     {
         _labelFunction = value;
     }
+
+    public function get canSetWidth():Boolean
+    {
+        return true;
+    }
+
+    public function get canSetHeight():Boolean
+    {
+        return false;
+    }
 }
 }
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/IPartRendererDescriptor.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/IPartRendererDescriptor.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/IPartRendererDescriptor.as
deleted file mode 100644
index c81f9f6..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/IPartRendererDescriptor.as
+++ /dev/null
@@ -1,34 +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 spark.components.supportClasses
-{
-
-import mx.core.IFactory;
-
-import spark.components.itemRenderers.IItemPartRendererBase;
-
-public interface IPartRendererDescriptor
-{
-    function get scaledWidth():Number;
-
-    function get itemRenderer():IFactory;
-
-    function createPartRenderer():IItemPartRendererBase;
-}
-}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
new file mode 100644
index 0000000..44c2c46
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
@@ -0,0 +1,97 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.supportClasses
+{
+import mx.core.mx_internal;
+
+import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.utils.UIComponentUtils;
+
+use namespace  mx_internal;
+
+/** @private
+ *    this class is responsible for laying out grid cells in a given MobileGrid row.
+ *    It will make sure that cell content is aligned according to the column widths.
+ */
+public class ListMultiPartColumnLayout extends ListMultiPartLayoutBase
+{
+
+    public function ListMultiPartColumnLayout(target:ListMultiPartItemRendererBase)
+    {
+        super(target);
+    }
+
+    override public function measure():void
+    {
+        super.measure();
+        var totalWidth:Number = 0;
+        for each (var ld:PartRendererDescriptorBase in partRendererDescriptors)
+        {
+            totalWidth += ld.dpiScaledWidth;
+        }
+        target.measuredWidth = totalWidth;
+        target.measuredMinWidth = 50;
+    }
+
+    /* vertical align middle
+     * Layout algorithm:   give all columns the requested sizes, and the last column the remaining width  */
+    override public function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+
+        if (unscaledWidth == 0 && unscaledHeight == 0)
+            return;   // not ready
+        var cellPaddingLeft:Number = target.getStyle("paddingLeft");
+        var cellPaddingRight:Number = target.getStyle("paddingRight");
+        var paddingTop:Number = target.getStyle("paddingTop");
+        var paddingBottom:Number = target.getStyle("paddingBottom");
+        var cellHeight:Number = unscaledHeight - paddingTop - paddingBottom;
+
+        var desc:PartRendererDescriptorBase;
+        var dpr:IItemPartRendererBase;
+        var remainingWidth:Number = unscaledWidth;
+        var curX:Number = cellPaddingLeft;
+        var curY:Number = paddingTop;
+        var colWidth:Number;
+        var partWidth:Number;
+        var partHeight:Number;
+        var count:int = partRenderers.length - 1;
+        for (var i:int = 0; i <= count; i++)
+        {
+            dpr = partRenderers[i];
+            desc = partRendererDescriptors[i];
+            colWidth = desc.dpiScaledWidth;
+            if (dpr.canSetWidth)
+            {
+                // expand last column to fill width, unless it has explicity width
+                partWidth = Math.max(0, ( i == count && !desc.hasExplicitWidth) ? remainingWidth : colWidth - cellPaddingLeft - cellPaddingRight);
+            }
+            else
+            {
+                partWidth = dpr.getPreferredBoundsHeight();
+            }
+            partHeight = dpr.canSetHeight ? cellHeight : dpr.getPreferredBoundsHeight();
+            ;
+            setElementSize(dpr, partWidth, partHeight);
+            setElementPosition(dpr, curX, curY + UIComponentUtils.offsetForCenter(partHeight, cellHeight));
+            curX += colWidth;
+            remainingWidth -= colWidth;
+        }
+    }
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
index e53a968..8f07d5c 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
@@ -21,30 +21,44 @@ package spark.components.supportClasses
 import flash.display.DisplayObject;
 
 import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.core.DisplayObjectSharingMode;
+import spark.core.IGraphicElement;
+import spark.core.IGraphicElementContainer;
+import spark.core.ISharedDisplayObject;
 
 /**  @private
  *  This is the base class for multi-part renderers that manages a vector of part renderers.
  *  This class is responsible for creating and storing  the actual renderers from their descriptors
  *  the layout of the part renderers is delegated to a subclass of ListMultiPartLayoutBase;
  */
-public class ListMultiPartItemRendererBase extends ItemRendererBase
+public class ListMultiPartItemRendererBase extends ItemRendererBase implements IGraphicElementContainer, ISharedDisplayObject
 {
-    private var _partRendererDescriptors:Vector.<IPartRendererDescriptor>;
+    private var _partRendererDescriptors:Vector.<PartRendererDescriptorBase>;
     private var _partRenderers:Vector.<IItemPartRendererBase>;
+    private var _graphicElementPartRenderers:Vector.<IGraphicElement>;
     private var _partRenderersLayout:ListMultiPartLayoutBase;
 
+    /**
+     * Management of graphicElement part renderers  lifeCycle
+     */
+    private var _redrawRequested:Boolean = false;
+    private var graphicElementsNeedValidateProperties:Boolean = false;
+    private var graphicElementsNeedValidateSize:Boolean = false;
+
     public function ListMultiPartItemRendererBase()
     {
     }
 
-    /* set by DataGridMobile Factory */
-    public function set partRendererDescriptors(value:Vector.<IPartRendererDescriptor>):void
+    /** @private
+     * set in List itemRenderer Factory properties */
+    public function set partRendererDescriptors(value:Vector.<PartRendererDescriptorBase>):void
     {
         _partRendererDescriptors = value;
-        _partRenderers = new Vector.<IItemPartRendererBase>(_partRendererDescriptors.length);
+        _partRenderers = new Vector.<IItemPartRendererBase>(_partRendererDescriptors.length, true);
+        _graphicElementPartRenderers = new Vector.<IGraphicElement>();
     }
 
-    public function get partRendererDescriptors():Vector.<IPartRendererDescriptor>
+    public function get partRendererDescriptors():Vector.<PartRendererDescriptorBase>
     {
         return _partRendererDescriptors;
     }
@@ -64,11 +78,17 @@ public class ListMultiPartItemRendererBase extends ItemRendererBase
         return _partRenderers;
     }
 
+    public function get graphicElementPartRenderers():Vector.<IGraphicElement>
+    {
+        return _graphicElementPartRenderers;
+    }
+
     override protected function createChildren():void
     {
         super.createChildren();
-        var desc:IPartRendererDescriptor;
+        var desc:PartRendererDescriptorBase;
         var pr:IItemPartRendererBase;
+        var ge:IGraphicElement;
         for (var i:int = 0; i < _partRendererDescriptors.length; i++)
         {
             desc = _partRendererDescriptors[i];
@@ -76,13 +96,27 @@ public class ListMultiPartItemRendererBase extends ItemRendererBase
             if (pr != null)
             {
                 pr.styleProvider = this;
-                addChild(DisplayObject(pr));
+
+                if (pr is IGraphicElement)
+                {
+                    ge = IGraphicElement(pr);
+                    ge.parentChanged(this);
+                    if (ge.setSharedDisplayObject(this))
+                    {
+                        ge.displayObjectSharingMode = DisplayObjectSharingMode.USES_SHARED_OBJECT;
+                    }
+                    _graphicElementPartRenderers.push(ge);
+                }
+                else if (pr is DisplayObject)
+                {
+                    addChild(DisplayObject(pr));
+                }
                 _partRenderers[i] = pr;
             }
             else
             {
                 //TODO move to resource bundle
-                throw  new Error("MobileGridColumn item renderer must implement spark.components.itemRenderers.IItemPartRendererBase") ;
+                throw  new Error("MobileGridColumn item renderer must implement spark.components.itemRenderers.IItemPartRendererBase");
             }
         }
     }
@@ -93,9 +127,9 @@ public class ListMultiPartItemRendererBase extends ItemRendererBase
         _partRenderersLayout.measure();
     }
 
-   /** delegate children layout to its partRendererLayout
-    subclasses can override this method to layout chrome content
-    */
+    /** delegate children layout to its partRendererLayout
+     subclasses can override this method to layout chrome content
+     */
     override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
     {
         _partRenderersLayout.layoutContents(unscaledWidth, unscaledHeight);
@@ -112,6 +146,120 @@ public class ListMultiPartItemRendererBase extends ItemRendererBase
         invalidateSize();
     }
 
+    /*  graphic element sub renderers lifecycle management */
+
+    override protected function commitProperties():void
+    {
+        if (graphicElementsNeedValidateProperties)
+        {
+            graphicElementsNeedValidateProperties = false;
+            for (var i:int = 0; i < _graphicElementPartRenderers.length; i++)
+            {
+                _graphicElementPartRenderers[i].validateProperties();
+            }
+        }
+        super.commitProperties();
+    }
+
+
+    override public function validateSize(recursive:Boolean = false):void
+    {
+        if (graphicElementsNeedValidateSize)
+        {
+            graphicElementsNeedValidateSize = false;
+            for (var i:int = 0; i < _graphicElementPartRenderers.length; i++)
+            {
+                _graphicElementPartRenderers[i].validateSize();
+            }
+        }
+        super.validateSize(recursive);
+    }
+
+
+    /* copied from Group*/
+    override public function validateDisplayList():void
+    {
+        super.validateDisplayList();
+        if (_redrawRequested)
+        {
+            for (var i:int = 0; i < _graphicElementPartRenderers.length; i++)
+            {
+                _graphicElementPartRenderers[i].validateDisplayList();
+            }
+        }
+    }
+
+    /* interfaces implementation, copied from spark.components.IconItemRender  */
+
+    /**
+     *  @inheritDoc
+     *
+     *  <p>We implement this as part of ISharedDisplayObject so the iconDisplay
+     *  can share our display object.</p>
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get redrawRequested():Boolean
+    {
+        return _redrawRequested;
+    }
+
+    /**
+     *  @private
+     */
+    public function set redrawRequested(value:Boolean):void
+    {
+        _redrawRequested = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  IGraphicElementContainer
+    //
+    // -------------------------------------------------------------------------
+
+    /**
+     * @private
+     *
+     *  Notify the host component that an element changed and needs to validate properties.
+     */
+    public function invalidateGraphicElementSharing(element:IGraphicElement):void
+    {
+        //do nothing because all has been done in createChildren and won't change
+    }
+
+    /**
+     * @private
+     *
+     *  Notify the host component that an element changed and needs to validate properties.
+     */
+    public function invalidateGraphicElementProperties(element:IGraphicElement):void
+    {
+        graphicElementsNeedValidateProperties = true;
+        invalidateProperties();
+    }
+
+    /**
+     * @private
+     */
+    public function invalidateGraphicElementSize(element:IGraphicElement):void
+    {
+        graphicElementsNeedValidateSize = true;
+        invalidateSize();
+    }
+
+    /**
+     * @private
+     *
+     */
+    public function invalidateGraphicElementDisplayList(element:IGraphicElement):void
+    {
+        if (element.displayObject is ISharedDisplayObject)
+            ISharedDisplayObject(element.displayObject).redrawRequested = true;
+        invalidateDisplayList();
+    }
 
 
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
index 0c8c5ff..21593b1 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
@@ -22,6 +22,7 @@ import mx.core.IFlexDisplayObject;
 import mx.core.ILayoutElement;
 
 import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.core.IGraphicElement;
 
 /** @private
  *   Abstract base class for laying out part renderers in a multi-part renderer.
@@ -41,11 +42,17 @@ public class ListMultiPartLayoutBase extends Object
         return _target;
     }
 
-    protected function get partRendererDescriptors():Vector.<IPartRendererDescriptor>
+    protected function get partRendererDescriptors():Vector.<PartRendererDescriptorBase>
     {
         return target.partRendererDescriptors;
     }
 
+    protected function get graphicElementPartRenderers():Vector.<IGraphicElement>
+    {
+        return target.graphicElementPartRenderers;
+    }
+
+
     protected function get partRenderers():Vector.<IItemPartRendererBase>
     {
         return target.partRenderers;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartTabbedLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartTabbedLayout.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartTabbedLayout.as
deleted file mode 100644
index f211a8c..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartTabbedLayout.as
+++ /dev/null
@@ -1,82 +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 spark.components.supportClasses
-{
-import spark.components.itemRenderers.IItemPartRendererBase;
-import spark.utils.UIComponentUtils;
-
-/** @private
- *    this class is reponsible for laying out grid cells in a given MobileGrid row.
- *    It will make sure that cell content is aligned according to the column widths.
- */
-public class ListMultiPartTabbedLayout extends ListMultiPartLayoutBase
-{
-
-    public function ListMultiPartTabbedLayout(target:ListMultiPartItemRendererBase)
-    {
-        super(target);
-    }
-
-    override public function measure():void
-    {
-        super.measure();
-        var totalWidth:Number = 0;
-        for each (var ld:IPartRendererDescriptor in partRendererDescriptors)
-        {
-            totalWidth += ld.scaledWidth;
-        }
-        target.measuredWidth = totalWidth;
-        target.measuredMinWidth = 50;
-    }
-
-    /* vertical align middle
-     * Layout algorithm:   give all columns the requested sizes, and the last column the remaining width  */
-    override public function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-
-        if (unscaledWidth == 0 && unscaledHeight == 0)
-            return;   // not ready
-        var cellPaddingLeft:Number = target.getStyle("paddingLeft");
-        var cellPaddingRight:Number = target.getStyle("paddingRight");
-        var paddingTop:Number = target.getStyle("paddingTop");
-        var paddingBottom:Number = target.getStyle("paddingBottom");
-        var cellHeight:Number = unscaledHeight - paddingTop - paddingBottom;
-
-        var desc:IPartRendererDescriptor;
-        var dpr:IItemPartRendererBase;
-        var remainingWidth:Number = unscaledWidth;
-        var curX:Number = cellPaddingLeft;
-        var curY:Number = paddingTop;
-        var partWidth:Number;
-        var partHeight:Number;
-        var count:int = partRenderers.length - 1;
-        for (var i:int = 0; i <= count; i++)
-        {
-            dpr = partRenderers[i];
-            desc = partRendererDescriptors[i];
-            partHeight = dpr.getPreferredBoundsHeight();
-            partWidth = Math.max(0, i == count ? remainingWidth : desc.scaledWidth - cellPaddingLeft - cellPaddingRight);
-            setElementSize(dpr, partWidth, partHeight);
-            setElementPosition(dpr, curX, curY + UIComponentUtils.offsetForCenter(partHeight, cellHeight));
-            curX += partWidth + cellPaddingRight + cellPaddingLeft;
-            remainingWidth -= desc.scaledWidth;
-        }
-    }
-}
-}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
index a404bb2..9c49428 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
@@ -48,13 +48,13 @@ public class MobileGridColumn extends PartRendererDescriptorBase
     private var _headerText:String = null;
     private var _headerStyleName:String;
     private var _sortDescending:Boolean;
-    private var _sortable: Boolean = true;
+    private var _sortable:Boolean = true;
 
     public function MobileGridColumn(target:IEventDispatcher = null)
     {
         super(target);
         labelFunction = null;
-        width = 100; // default width;
+        setWidth(100); // default width;
         itemRenderer = null; // will set default ;
     }
 
@@ -64,7 +64,7 @@ public class MobileGridColumn extends PartRendererDescriptorBase
      */
     public function get headerText():String
     {
-        return _headerText != null ? _headerText : dataField ;
+        return _headerText != null ? _headerText : dataField;
     }
 
     public function set headerText(value:String):void

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
index 1cdfbf6..f92075b 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
@@ -60,10 +60,10 @@ public class MobileGridHeader extends ButtonBar
     protected var ascIconCls:MultiDPIBitmapSource;
 
     private var _dataGrid:MobileGrid;
-    private var _columns: Array;
+    private var _columns:Array;
     private var _sortIndex:int = -1;
 
-      public function MobileGridHeader()
+    public function MobileGridHeader()
     {
         this.labelField = "headerText";
         this.iconFunction = getIconForButton;
@@ -103,8 +103,9 @@ public class MobileGridHeader extends ButtonBar
     {
         event.preventDefault();      // to clear selection
         var i:int = event.newIndex;
-        var c: MobileGridColumn = _columns[i];
-        if (_dataGrid.sortableColumns && c.sortable)   {
+        var c:MobileGridColumn = _columns[i];
+        if (_dataGrid.sortableColumns && c.sortable)
+        {
             var headerEvent:MobileGridHeaderEvent = new MobileGridHeaderEvent(MobileGridHeaderEvent.SORT_CHANGE, c.colNum, false, true);
             // HEADER_RELEASE event is cancelable
             dispatchEvent(headerEvent);
@@ -129,9 +130,9 @@ public class MobileGridHeader extends ButtonBar
         var button:UIComponent = UIComponent(event.renderer);
         var index:int = event.index;
         var col:MobileGridColumn = MobileGridColumn(_columns[index]);
-        // don't size the last button
-        if (index != dataProvider.length - 1)
-            button.explicitWidth = col.scaledWidth;
+        // expand the last button
+        if ((index != dataProvider.length - 1) || col.hasExplicitWidth)
+            button.explicitWidth = col.dpiScaledWidth;
         else
             button.percentWidth = 100;
     }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
index 0461d22..b2a8d3e 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
@@ -27,7 +27,7 @@ public class MobileGridRowRenderer extends ListMultiPartItemRendererBase
 {
     public function MobileGridRowRenderer()
     {
-        partRenderersLayout = new ListMultiPartTabbedLayout(this);
+        partRenderersLayout = new ListMultiPartColumnLayout(this);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
index 57a3cbb..23ce03e 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
@@ -34,23 +34,25 @@ import spark.utils.DensityUtil2;
 /**  This is the base class for GridColumn
  *
  */
-public class PartRendererDescriptorBase extends EventDispatcher implements IPartRendererDescriptor
+public class PartRendererDescriptorBase extends EventDispatcher
 {
 
     private var _colNum:int;
     private var _dataField:String;
     private var _width:Number;
-    private var _scaledWidth:Number;
+    private var _hasExplicitWidth:Boolean;
+    private var _dpiScaledWidth:Number;
     private var _itemRenderer:IFactory;
     private var _labelFunction:Function;
     private var _styleName:String;
     private var _textAlign:String;
 
+
     public function PartRendererDescriptorBase(target:IEventDispatcher = null)
     {
         super(target);
         _labelFunction = null;
-        width = 100; // default width;
+        setWidth(100); // default width;
         itemRenderer = null; // will set default ;
     }
 
@@ -103,44 +105,25 @@ public class PartRendererDescriptorBase extends EventDispatcher implements IPart
         _styleName = value;
     }
 
-    /** set the desired width of the column at the application's current DPI (or 160 if none)
-     * default value is 100
-     * the actual pixel width maybe higher if the runtimeDPI or application DPI  are different than 160
+    /** Set the desired width for this column.
+     * <p> Width value is expressed in current applicationDPI, or at 160 DPI  if applicationDPI is not set.</p>
+     * Default value is 100.
+     * Note that the last column will always expand
      *
      * @param value = desired width of the column at 160 DPI
      */
     public function set width(value:Number):void
     {
-        _width = value;
-        _scaledWidth = DensityUtil2.dpiScale(value, DPIClassification.DPI_160);
+        setWidth(value);
+        _hasExplicitWidth = true;
     }
 
-    /** set the desired width of the column at the application's current DPI (or 160 if none)
-     * default value is 100
-     * the actual pixel width maybe higher if the runtimeDPI or application DPI  are different than 160
-     *
-     * @param value = desired width of the column at 160 DPI
-     */
-    public function set widthAt160DPI(value:Number):void
+    protected function setWidth(value:Number):void
     {
         _width = value;
-        _scaledWidth = DensityUtil2.dpiScale(value, DPIClassification.DPI_160);
+        _dpiScaledWidth = DensityUtil2.dpiScale(value, DPIClassification.DPI_160);
     }
 
-    public function get scaledWidth():Number
-    {
-        return  _scaledWidth;
-    }
-
-    mx_internal function get colNum():int
-    {
-        return _colNum;
-    }
-
-    mx_internal function set colNum(value:int):void
-    {
-        _colNum = value;
-    }
 
     public function get itemRenderer():IFactory
     {
@@ -169,8 +152,10 @@ public class PartRendererDescriptorBase extends EventDispatcher implements IPart
         if (pr)
         {
             pr.cssStyleName = _styleName;
-            if (pr is IItemTextPartRenderer)  {
-                with( IItemTextPartRenderer(pr)){
+            if (pr is IItemTextPartRenderer)
+            {
+                with (IItemTextPartRenderer(pr))
+                {
                     labelField = _dataField;
                     labelFunction = _labelFunction;
                     textAlign = _textAlign;
@@ -180,5 +165,25 @@ public class PartRendererDescriptorBase extends EventDispatcher implements IPart
         return pr;
     }
 
+    mx_internal function get hasExplicitWidth():Boolean
+    {
+        return _hasExplicitWidth;
+    }
+
+    mx_internal function get dpiScaledWidth():Number
+    {
+        return  _dpiScaledWidth;
+    }
+
+    mx_internal function get colNum():int
+    {
+        return _colNum;
+    }
+
+    mx_internal function set colNum(value:int):void
+    {
+        _colNum = value;
+    }
+
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as b/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
index 06558b7..31e1462 100644
--- a/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
+++ b/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
@@ -22,7 +22,7 @@ import flash.events.Event;
 
 /**
  *  The MobileGridHeaderEvent class represents events that are dispatched when
-    the user clicks  on the header of a column in the DataGrid to sort it.
+ the user clicks  on the header of a column in the DataGrid to sort it.
  *
  *  @see spark.components.MobileGrid
  *

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
index 20c46a0..35353f8 100644
--- a/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
+++ b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
@@ -33,7 +33,6 @@ import spark.components.supportClasses.MobileGridHeader;
 import spark.layouts.HorizontalAlign;
 import spark.layouts.VerticalLayout;
 import spark.skins.mobile.supportClasses.MobileSkin;
-import spark.utils.MultiDPIBitmapSource;
 import spark.utils.MultiDPIBitmapSourceExt;
 
 use namespace mx_internal;
@@ -73,7 +72,7 @@ public class MobileGridSkin extends MobileSkin
                 minWidth = 100;
                 break;
         }
-        var headerShadowSrc:MultiDPIBitmapSource = new MultiDPIBitmapSourceExt();
+        var headerShadowSrc:MultiDPIBitmapSourceExt = new MultiDPIBitmapSourceExt();
         headerShadowSrc.source320dpi = headerShadowCls320;
         headerShadowSrc.source160dpi = headerShadowCls160;
         headerShadowCls = Class(headerShadowSrc.getSource(NaN));

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as b/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
index 8c76e73..7f447ad 100644
--- a/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
@@ -20,7 +20,6 @@ package spark.utils
 {
 
 import mx.core.FlexGlobals;
-import mx.core.mx_internal;
 import mx.managers.SystemManager;
 
 import spark.components.Application;
@@ -28,38 +27,16 @@ import spark.components.Application;
 public class DensityUtil2
 {
 
-    use namespace mx_internal;
-
     private static var _setApplicationDPI:Number = 0;
 
-    /**  Calculates a scale factor to be used when element authored for  <code>sourceDPI</code>
-     *   two algorithms: <br/>
-     *   Application.applicationDPI has been set, which means scaling factor  occurs already, so additional scaling is required, return 1
-     *  Application.applicationDPI has not been set, then return runTimeDPI / sourceDPI
-     *  examples:
-     *  runtimeDPI = 320 and sourceDPI = 160 and  applicationDPI not set  (ie=320) => 2
-     *  runtimeDPI = 160 and sourceDPI = 160 and applicationDPI not set (ie=160)  => 1
-     *  runtimeDPI = 160 and sourceDPI = 160 and applicationDPI = 160 => 1
-     *  runtimeDPI = 320 and sourceDPI = 160 and applicationDPI = 160 => 1 (scaling occurs)
+    /**  returns the actual  value for  a value authored for  <code>sourceDPI</code>, taking into account any dpi scaling.
+     *  <ul>
+     *      <li> If Application.applicationDPI has been set, which means dpi scaling factor is already applied, return the original value.</li>
+     *     <li> If Application.applicationDPI has not been set, then return scaled value runTimeDPI / sourceDPI   </li>
+     *  </li>
      * @param sourceDPI
-     * @return  scale factor
+     * @return  scaled value
      */
-
-    public static function getPostDPIScale(sourceDPI:Number):Number
-    {
-
-        var appDPI:Number = getSetApplicationDPI();
-        if (isNaN(appDPI))
-        {
-            // was not set,
-            var runDPI:Number = FlexGlobals.topLevelApplication.runtimeDPI;
-            return runDPI / sourceDPI;
-        }
-        else
-            return 1.0; //  already scaled
-    }
-
-
     public static function dpiScale(value:Number, sourceDPI:Number):Number
     {
         var appDPI:Number = getSetApplicationDPI();
@@ -70,9 +47,10 @@ public class DensityUtil2
         }
         else
             return value; //  already scaled
-
     }
 
+    /**
+     *  returns the applicationDPI that was explicitly set in top level application , or NaN if none */
     private static function getSetApplicationDPI():Number
     {
         if (_setApplicationDPI == 0)

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as b/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
index eb3ac03..ce17ffe 100644
--- a/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
@@ -24,10 +24,28 @@ import mx.utils.DensityUtil;
 public class MultiDPIBitmapSourceExt extends MultiDPIBitmapSource
 {
 
+    /**
+     *  Select one of the sourceXXXdpi properties based on the given DPI.  This
+     *  function handles the fallback to different sourceXXXdpi properties
+     *  if the given one is null.
+     *  The strategy is to try to choose the next highest
+     *  property if it is not null, then return a lower property if not null, then
+     *  just return null.
+     *  If desiredDPI is NaN or 0, return the sourceXXXdpi for the  runtime DPI .
+     *
+     *  @param The desired DPI.
+     *
+     *  @return One of the sourceXXXdpi properties based on the desired DPI.
+     *
+     *  @langversion 3.0
+     *  @playerversion Flash 10.2
+     *  @playerversion AIR 2.6
+     *  @productversion Flex 4.5
+     */
 
     override public function getSource(desiredDPI:Number):Object
     {
-        if (isNaN(desiredDPI))
+        if (isNaN(desiredDPI) || (desiredDPI == 0))
         {
             var app:Object = FlexGlobals.topLevelApplication;
             var dpi:Number;
@@ -40,5 +58,8 @@ public class MultiDPIBitmapSourceExt extends MultiDPIBitmapSource
         else
             return super.getSource(desiredDPI);
     }
+
+    //TODO mamsellem move this code to parent class, updates any callers, and remove this class
+
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/fe39973b/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as b/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
index 0ecf82c..93f6f8e 100644
--- a/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
@@ -18,40 +18,12 @@
 ////////////////////////////////////////////////////////////////////////////////
 package spark.utils
 {
-import mx.collections.IList;
 import mx.core.IFlexDisplayObject;
 import mx.core.ILayoutElement;
-import mx.core.UIComponent;
-
-import spark.components.IItemRendererOwner;
 
 public class UIComponentUtils
 {
 
-    /* fast function based on char length and not on pixel length*/
-    public static function computeLongestItem(listComponent:IItemRendererOwner, dataProvider:IList, max:int = 10):Object
-    {
-        if (!dataProvider)
-        {
-            return null;
-        }
-        max = Math.min(max, dataProvider.length);
-        var maxLength:int = 0;
-        var longestItem:Object;
-        var item:Object;
-        var itemStringLength:int;
-        for (var i:int = 0; i < max; i++)
-        {
-            item = dataProvider.getItemAt(i);
-            itemStringLength = listComponent.itemToLabel(item).length;
-            if (itemStringLength >= maxLength)
-            {
-                maxLength = itemStringLength;
-                longestItem = item;
-            }
-        }
-        return longestItem;
-    }
 
     public static function itemToLabel(item:Object, labelField:String, labelFunction:Function, nullLabel:String = '-'):String
     {
@@ -69,12 +41,6 @@ public class UIComponentUtils
         }
     }
 
-    public static function clearBoundsSize(comp:UIComponent):void
-    {
-        comp.explicitWidth = NaN; // was set before
-        comp.explicitHeight = NaN;
-        comp.setLayoutBoundsSize(NaN, NaN);
-    }
 
     public static function setElementSize(element:Object, width:Number, height:Number):void
     {


[14/15] git commit: [flex-sdk] [refs/heads/develop] - INTEGRATION https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile - use SDK new MultiBitmapSource.getMultiSource() in MobileGridSkin

Posted by ma...@apache.org.
INTEGRATION https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile
- use SDK new MultiBitmapSource.getMultiSource() in MobileGridSkin


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/f775f9b4
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/f775f9b4
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/f775f9b4

Branch: refs/heads/develop
Commit: f775f9b4af1c1df3ad8bb7aebb93b1c538aad5a6
Parents: d2becdf
Author: mamsellem <ma...@systar.com>
Authored: Fri Oct 4 18:30:43 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Fri Oct 4 18:30:43 2013 +0200

----------------------------------------------------------------------
 .../src/spark/skins/MobileGridSkin.as           |  6 +-
 .../src/spark/utils/MultiDPIBitmapSourceExt.as  | 69 --------------------
 2 files changed, 3 insertions(+), 72 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f775f9b4/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
index 35353f8..4956dd5 100644
--- a/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
+++ b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
@@ -33,7 +33,7 @@ import spark.components.supportClasses.MobileGridHeader;
 import spark.layouts.HorizontalAlign;
 import spark.layouts.VerticalLayout;
 import spark.skins.mobile.supportClasses.MobileSkin;
-import spark.utils.MultiDPIBitmapSourceExt;
+import spark.utils.MultiDPIBitmapSource;
 
 use namespace mx_internal;
 
@@ -72,10 +72,10 @@ public class MobileGridSkin extends MobileSkin
                 minWidth = 100;
                 break;
         }
-        var headerShadowSrc:MultiDPIBitmapSourceExt = new MultiDPIBitmapSourceExt();
+        var headerShadowSrc:MultiDPIBitmapSource = new MultiDPIBitmapSource();
         headerShadowSrc.source320dpi = headerShadowCls320;
         headerShadowSrc.source160dpi = headerShadowCls160;
-        headerShadowCls = Class(headerShadowSrc.getSource(NaN));
+        headerShadowCls = Class(headerShadowSrc.getMultiSource());
     }
 
     override protected function commitCurrentState():void

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/f775f9b4/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as b/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
deleted file mode 100644
index 0a01f34..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
+++ /dev/null
@@ -1,69 +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 spark.utils
-{
-import mx.core.FlexGlobals;
-import mx.utils.DensityUtil;
-
-//TODO mamsellem move this code to parent class, updates any callers, and remove this class
-
-/**  @private
- * Adds default behavior to its parent class MultiDPIBitmapSource.
- *
- */
-public class MultiDPIBitmapSourceExt extends MultiDPIBitmapSource
-{
-
-    /**
-     *  Select one of the sourceXXXdpi properties based on the given DPI.  This
-     *  function handles the fallback to different sourceXXXdpi properties
-     *  if the given one is null.
-     *  The strategy is to try to choose the next highest
-     *  property if it is not null, then return a lower property if not null, then
-     *  just return null.
-     *  If desiredDPI is NaN or 0, return the sourceXXXdpi for the  runtime DPI .
-     *
-     *  @param The desired DPI.
-     *
-     *  @return One of the sourceXXXdpi properties based on the desired DPI.
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 3.8
-     *  @productversion Flex 4.11
-     */
-
-    override public function getSource(desiredDPI:Number):Object
-    {
-        if (isNaN(desiredDPI) || (desiredDPI == 0))
-        {
-            var app:Object = FlexGlobals.topLevelApplication;
-            var dpi:Number;
-            if ("runtimeDPI" in app)
-                dpi = app["runtimeDPI"];
-            else
-                dpi = DensityUtil.getRuntimeDPI();
-            return getSource(dpi);
-        }
-        else
-            return super.getSource(desiredDPI);
-    }
-
-
-}
-}


[15/15] git commit: [flex-sdk] [refs/heads/develop] - INTEGRATION https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile - removed link to flex-examples github from asdoc comment

Posted by ma...@apache.org.
INTEGRATION https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile
- removed link to flex-examples github from asdoc comment


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/25d74eda
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/25d74eda
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/25d74eda

Branch: refs/heads/develop
Commit: 25d74edafa004055245c6149010113f5aa232630
Parents: f775f9b
Author: mamsellem <ma...@systar.com>
Authored: Sat Oct 5 00:58:26 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Sat Oct 5 00:58:26 2013 +0200

----------------------------------------------------------------------
 .../experimental_mobile/src/spark/components/MobileGrid.as        | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/25d74eda/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
index ce76f6f..003339b 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
@@ -73,10 +73,9 @@ use namespace  mx_internal;
  * in a single row are managed   by one single MobileGridRowRenderer that  delegates the individual  cell renderers to light-weight sub-renderers. </p>
  * <p> You usually don't access this internal row renderer yourself, and will rather define the individual cell renderers.</p>
  * <p> This technique ensures optimal display and memory performance, which is critical for mobile devices, at the price of less flexibility for cell renderers. </p>
- * <p>Click the link below to view examples of MobileGrid usage on the ApacheFlex github repository.</p>
  *
  *    @see spark.components.supportClasses.MobileGridColumn
- *    @see https://github.com/apache/flex-examples/tree/develop/showcase/4.11/components/mobilegrid/index.html Examples of MobileGrid usage on ApacheFlex github
+ *
  *  @langversion 3.0
  *  @playerversion AIR 3.8
  *  @productversion Flex 4.11


[13/15] git commit: [flex-sdk] [refs/heads/develop] - Merge branch 'mobileexperimental' into develop

Posted by ma...@apache.org.
Merge branch 'mobileexperimental' into develop


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/d2becdf8
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/d2becdf8
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/d2becdf8

Branch: refs/heads/develop
Commit: d2becdf8dfcfb406dc6ebbf03c0fc761b7e4ab91
Parents: c1173bd 4c4d2dc
Author: mamsellem <ma...@systar.com>
Authored: Fri Oct 4 18:17:38 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Fri Oct 4 18:17:38 2013 +0200

----------------------------------------------------------------------
 SVN-TEST.txt                                    |  13 +-
 asdoc/build.xml                                 |   2 +
 build.xml                                       |   5 +-
 frameworks/build.xml                            |  13 +-
 .../assets/images/mobile160/dg_header_asc.png   | Bin 0 -> 447 bytes
 .../assets/images/mobile160/dg_header_desc.png  | Bin 0 -> 418 bytes
 .../assets/images/mobile160/dg_header_sep.png   | Bin 0 -> 201 bytes
 .../images/mobile160/dg_header_shadow.png       | Bin 0 -> 277 bytes
 .../assets/images/mobile320/dg_header_asc.png   | Bin 0 -> 527 bytes
 .../assets/images/mobile320/dg_header_desc.png  | Bin 0 -> 496 bytes
 .../assets/images/mobile320/dg_header_sep.png   | Bin 0 -> 215 bytes
 .../images/mobile320/dg_header_shadow.png       | Bin 0 -> 329 bytes
 .../projects/experimental_mobile/build.xml      | 239 +++++++++++++
 .../experimental_mobile/bundle-config.xml       |  50 +++
 .../bundles/da_DK/experimental.properties       |  18 +
 .../bundles/de_CH/experimental.properties       |  18 +
 .../bundles/de_DE/experimental.properties       |  18 +
 .../bundles/el_GR/experimental.properties       |  18 +
 .../bundles/en_AU/experimental.properties       |  18 +
 .../bundles/en_CA/experimental.properties       |  18 +
 .../bundles/en_GB/experimental.properties       |  18 +
 .../bundles/en_US/experimental.properties       |  18 +
 .../bundles/es_ES/experimental.properties       |  18 +
 .../bundles/fi_FI/experimental.properties       |  18 +
 .../bundles/fr_CH/experimental.properties       |  18 +
 .../bundles/fr_FR/experimental.properties       |  18 +
 .../bundles/it_IT/experimental.properties       |  18 +
 .../bundles/ja_JP/experimental.properties       |  18 +
 .../bundles/ko_KR/experimental.properties       |  18 +
 .../bundles/nb_NO/experimental.properties       |  18 +
 .../bundles/nl_NL/experimental.properties       |  18 +
 .../bundles/pt_BR/experimental.properties       |  18 +
 .../bundles/pt_PT/experimental.properties       |  18 +
 .../bundles/ru_RU/experimental.properties       |  18 +
 .../bundles/sv_SE/experimental.properties       |  18 +
 .../bundles/zh_CN/experimental.properties       |  18 +
 .../bundles/zh_TW/experimental.properties       |  18 +
 .../experimental_mobile/compile-config.xml      |  83 +++++
 .../projects/experimental_mobile/defaults.css   | 138 ++++++++
 .../projects/experimental_mobile/manifest.xml   |  28 ++
 .../experimental_mobile/spark-manifest.xml      |  49 +++
 .../src/ExperimentalMobileClasses.as            |  37 ++
 .../src/spark/components/MobileGrid.as          | 295 ++++++++++++++++
 .../itemRenderers/IMobileGridCellRenderer.as    |  70 ++++
 .../IMobileGridTextCellRenderer.as              |  50 +++
 .../MobileGridBitmapCellRenderer.as             | 151 ++++++++
 .../itemRenderers/MobileGridTextCellRenderer.as | 139 ++++++++
 .../supportClasses/ListMultiPartColumnLayout.as | 188 ++++++++++
 .../supportClasses/MobileGridColumn.as          | 351 +++++++++++++++++++
 .../supportClasses/MobileGridHeader.as          | 163 +++++++++
 .../supportClasses/MobileGridRowRenderer.as     | 278 +++++++++++++++
 .../src/spark/events/MobileGridHeaderEvent.as   |  58 +++
 .../src/spark/layouts/MobileGridLayout.as       |  95 +++++
 .../skins/MobileGridHeaderButtonBarSkin.as      |  89 +++++
 .../spark/skins/MobileGridHeaderButtonSkin.as   |  43 +++
 .../skins/MobileGridHeaderFirstButtonSkin.as    |  35 ++
 .../src/spark/skins/MobileGridSkin.as           | 177 ++++++++++
 .../assets/MobileGridHeaderButton_down.fxg      |  46 +++
 .../mobile/assets/MobileGridHeaderButton_up.fxg |  44 +++
 .../assets/MobileGridHeaderFirstButton_down.fxg |  34 ++
 .../assets/MobileGridHeaderFirstButton_up.fxg   |  32 ++
 .../src/spark/utils/MobileGridUtil.as           |  80 +++++
 .../src/spark/utils/MultiDPIBitmapSourceExt.as  |  69 ++++
 63 files changed, 3549 insertions(+), 9 deletions(-)
----------------------------------------------------------------------



[09/15] git commit: [flex-sdk] [refs/heads/develop] - https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile - fixed ASDOC

Posted by ma...@apache.org.
https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile
- fixed ASDOC


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/37832b98
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/37832b98
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/37832b98

Branch: refs/heads/develop
Commit: 37832b98d62a63315488133959d722027deadb0c
Parents: b68e182
Author: mamsellem <ma...@systar.com>
Authored: Thu Oct 3 23:04:11 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Thu Oct 3 23:04:11 2013 +0200

----------------------------------------------------------------------
 .../src/spark/components/MobileGrid.as          | 28 +++++++++---------
 .../itemRenderers/IMobileGridCellRenderer.as    | 16 +++++++----
 .../IMobileGridTextCellRenderer.as              | 19 ++++++++++---
 .../MobileGridBitmapCellRenderer.as             | 26 ++++++++++++++---
 .../itemRenderers/MobileGridTextCellRenderer.as | 27 ++++++++++++++++++
 .../supportClasses/MobileGridColumn.as          | 30 ++++++++++----------
 .../supportClasses/MobileGridRowRenderer.as     |  4 +++
 7 files changed, 109 insertions(+), 41 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/37832b98/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
index 39977d7..ce76f6f 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
@@ -49,36 +49,38 @@ use namespace  mx_internal;
 [Event(name="sortChange", type="spark.events.MobileGridHeaderEvent")]
 
 /**
- *  The MobileGrid displays a collection of items in a grid of rows and columns, with column headers, optimized for mobile devices.
- *  The MobileGrid component provides the following features:
- *  <ul>
+ * The MobileGrid displays a collection of items in a grid of rows and columns and column headers and is optimized for speed on mobile devices.
+ * <p> The MobileGrid component provides the following features:
+ * <ul>
  *      <li> user can swipe through the rows in the datagrid. </li>
  *      <li> supports single selection of a row. </li>
  *      <li> rows can be sorted according to a given column by clicking on the column's header. </li>
  *      <li> cells can be displayed as text in different fonts and formats, as images, or using a custom renderer. </li>
  *      <li> default  skin uses dark shades of gray, and is available in different screen densities.</li>
  *  </ul>
- *
+ * </p>
  * <p> It's important to understand that MobileGrid does not have all the capabilities and flexibility of it's desktop equivalent,
  * in order to ensure optimal display and scrolling performance on mobile devices. </p>
  * <p>Typically, the following features are not available in MobileGrid:
- * <ul>
- *     <li>the list of columns is static and cannot be changed at runtime</li>
+ *  <ul>
  *     <li>multiple selection is not supported </li>
  *     <li>it's not possible to interactively reorder columns </li>
+ *     <li> MobileGrid does  not scroll horizontally, even when the column widths exceeds the component's width.</li>
  *     <li>custom cell renderers must be designed with care, preferably in ActionScript, to ensure good display performance </li>
- *   </ul>
- *  </p>
+ *  </ul>
+ * </p>
  * <p>Internally,  MobileGrid inherits for Mobile spark.List component rather than any Grid or DataGrid, which means that all cell renderers
  * in a single row are managed   by one single MobileGridRowRenderer that  delegates the individual  cell renderers to light-weight sub-renderers. </p>
  * <p> You usually don't access this internal row renderer yourself, and will rather define the individual cell renderers.</p>
- * <p> This technique ensures optimal display and memory performance, which is critical for mobile devices,, at the price of less flexibility for cell renderers. </p>
- *
- *  @see spark.components.supportClasses.MobileGridColumn
+ * <p> This technique ensures optimal display and memory performance, which is critical for mobile devices, at the price of less flexibility for cell renderers. </p>
+ * <p>Click the link below to view examples of MobileGrid usage on the ApacheFlex github repository.</p>
  *
+ *    @see spark.components.supportClasses.MobileGridColumn
+ *    @see https://github.com/apache/flex-examples/tree/develop/showcase/4.11/components/mobilegrid/index.html Examples of MobileGrid usage on ApacheFlex github
  *  @langversion 3.0
  *  @playerversion AIR 3.8
  *  @productversion Flex 4.11
+ *
  */
 public class MobileGrid extends List
 {
@@ -103,9 +105,9 @@ public class MobileGrid extends List
     }
 
     /**
-     *  An array of MobileGridColumn objects, one for each column that  can be displayed.
+     *  An array of MobileGridColumn objects, one for each column to display.
      *  <p>Contrary to desktop DataGrid, this property must be set explicitly , or no columns will be displayed.</p>
-     *  <p>If you want to change the set of columns,you need to re-assign the new array to the columns property.
+     *  <p>If you want to change the set of columns, you need to re-assign the new array to the columns property.
      *  Changes to the original array without assigning the property will have no effect.</p>
      *
      *  @see   spark.components.supportClasses.MobileGridColumn

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/37832b98/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridCellRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridCellRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridCellRenderer.as
index eb5ddc7..abac1db 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridCellRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridCellRenderer.as
@@ -23,9 +23,9 @@ import mx.core.IDataRenderer;
 import mx.styles.IStyleClient;
 
 /**
- * This is the base interface that all mobile cell or other mobile item part renderers must implement.
- * Contrary to desktop DataGrid control, there is no default base renderer,
- * because mobile renderers must be lightweight, and derive directly for the existing component, (ie. s:Button or s:CheckBox ).
+ * This is the base interface that all mobile grid cell renderers must implement.
+ * <p>Contrary to desktop DataGrid control, there is no default implementation for this interface,
+ * because mobile renderers must be lightweight, and derive directly for an existing component, (eg.. s:Button or s:CheckBox ).</p>
  *
  *  @langversion 3.0
  *  @playerversion AIR 3.8
@@ -40,12 +40,18 @@ public interface IMobileGridCellRenderer extends IDataRenderer
      */
     function set styleProvider(value:IStyleClient):void ;
 
+    /** Flag indicating whether the layout manager can stretch the width of this renderer to match the column's width.
+     <p> default value is false.  Override the getter to return a difference value </p>
+     */
     function get canSetContentWidth():Boolean;
 
+    /** Flag indicating whether the layout manager can stretch the height of this renderer to match the column's height.
+     <p> default value is false.  Override the getter to return a difference value </p>
+     */
     function get canSetContentHeight():Boolean;
 
-    /**
-     * @private
+    /** this property is set with the GridColumn's styleName property.
+     <p> you can override it to extract information from the style and pass them to this renderer.</p>
      */
     function set cssStyleName(value:String):void;
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/37832b98/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridTextCellRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridTextCellRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridTextCellRenderer.as
index d26c312..694ed1c 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridTextCellRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IMobileGridTextCellRenderer.as
@@ -19,7 +19,10 @@
 package spark.components.itemRenderers
 {
 
-/**  Extended interface for renderer that include text
+/**  Extends IMobileGridCellRenderers with APIs for rendering text in MobileGrid cells.
+ *  <p>Typically , implementors will set the text to render using labelField and/or labelFunction this way:      </p>
+ *  <code> text = UIComponentUtils.itemToLabel(value, _labelField, _labelFunction); </code>
+ *
  *  @langversion 3.0
  *  @playerversion AIR 3.8
  *  @productversion Flex 4.11
@@ -27,13 +30,21 @@ package spark.components.itemRenderers
 
 public interface IMobileGridTextCellRenderer extends IMobileGridCellRenderer
 {
-    /* implement this property so that the renderer can receive the dataField from the renderer's MobileGridColumn*/
+    /**
+     *  Implement this property so that the renderer can receive the dataField from its MobileGridColumn.
+     * @see spark.components.supportClasses.MobileGridColumn#labelField
+     *  */
     function set labelField(value:String):void;
 
-    /* implement this property so that the renderer can receive the labelFunction from the renderers' MobileGridColumn*/
+    /**
+     *  Implement this property so that the renderer can receive the labelFunction its MobileGridColumn
+     *  @see spark.components.supportClasses.MobileGridColumn#labelFunction */
     function set labelFunction(value:Function):void;
 
-    /* implement this property so that the renderer can receive the textAlign property from the renderers' MobileGridColumn*/
+    /**
+     *  Implement this property so that the renderer can receive the textAlign property from the renderers' MobileGridColumn
+     *  @see spark.components.supportClasses.MobileGridColumn#textAlign
+     *  */
     function set textAlign(textAlign:String):void;
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/37832b98/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridBitmapCellRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridBitmapCellRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridBitmapCellRenderer.as
index 1eed532..8ed04c4 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridBitmapCellRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridBitmapCellRenderer.as
@@ -50,7 +50,7 @@ public class MobileGridBitmapCellRenderer extends BitmapImage implements IMobile
 
     /**
      *  The name of the field or property in the DataGrid's dataProvider item that defines the icon to display for this renderer's column.
-     *  <p> The field value must be either an embedded bitmap's class, or or MultiBitmapSource object.   </p>
+     *  <p> The field value must be either an embedded bitmap's class, or a MultiBitmapSource object.   </p>
      *   <p> If not set, then iconFunction will be used.  </p>
      *  @default null
      *
@@ -82,7 +82,7 @@ public class MobileGridBitmapCellRenderer extends BitmapImage implements IMobile
      *
      *  @default null
      *
-     *  @see #iconLabel
+     *  @see #iconField
      *  @see  spark.utils.MultiDPIBitmapSource
      *
      */
@@ -96,6 +96,9 @@ public class MobileGridBitmapCellRenderer extends BitmapImage implements IMobile
         _iconFunction = value;
     }
 
+    /**
+     *  @inheritDoc
+     */
     public function set data(value:Object):void
     {
         _data = value;
@@ -103,28 +106,43 @@ public class MobileGridBitmapCellRenderer extends BitmapImage implements IMobile
         this.source = iconSource;
     }
 
+    /**
+     *  @inheritDoc
+     */
     public function get data():Object
     {
         return _data;
     }
 
+    /**
+     *  @inheritDoc
+     */
     public function set styleProvider(value:IStyleClient):void
     {
         // do nothing, this renderer does not manages styles for now.
     }
 
+    /**
+     *  @inheritDoc
+     */
     public function set cssStyleName(value:String):void
     {
 
     }
 
-    /* to avoid any scaling artifacts, we do not allow bitmap to be stretcghed */
-
+    /**
+     *  Returns false to avoid any density scaling artifacts.
+     *   @inheritDoc
+     *  */
     public function get canSetContentWidth():Boolean
     {
         return false;
     }
 
+    /**
+     *  Returns false to avoid any density scaling artifacts.
+     *   @inheritDoc
+     *  */
     public function get canSetContentHeight():Boolean
     {
         return false;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/37832b98/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as
index 139d9a3..8a74e88 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as
@@ -52,17 +52,26 @@ public class MobileGridTextCellRenderer extends StyleableTextField implements IM
         multiline = true;
     }
 
+    /**
+     *  @inheritDoc
+     */
     public function set styleProvider(value:IStyleClient):void
     {
         styleName = value;
         commitStyles();
     }
 
+    /**
+   *  @inheritDoc
+     */
     public function set textAlign(value:String):void
     {
         setStyle("textAlign", value);
     }
 
+    /**
+     *  @inheritDoc
+     */
     public function set cssStyleName(pstyleName:String):void
     {
         var css:CSSStyleDeclaration = pstyleName ? StyleManager.getStyleManager(null).getStyleDeclaration("." + pstyleName) : null;
@@ -76,32 +85,50 @@ public class MobileGridTextCellRenderer extends StyleableTextField implements IM
         }
     }
 
+    /**
+     *  @inheritDoc
+     */
     public function set data(value:Object):void
     {
         _data = value;
         text = UIComponentUtils.itemToLabel(value, _labelField, _labelFunction);
     }
 
+    /**
+     *  @inheritDoc
+     */
     public function get data():Object
     {
         return _data;
     }
 
+    /**
+     *  @inheritDoc
+     */
     public function set labelField(value:String):void
     {
         _labelField = value;
     }
 
+    /**
+     *  @inheritDoc
+     */
     public function set labelFunction(value:Function):void
     {
         _labelFunction = value;
     }
 
+    /**
+     *  @inheritDoc
+     */
     public function get canSetContentWidth():Boolean
     {
         return true;
     }
 
+    /**
+     *  @inheritDoc
+     */
     public function get canSetContentHeight():Boolean
     {
         return false;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/37832b98/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
index 95d2d85..23b9f87 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
@@ -38,8 +38,8 @@ import spark.components.itemRenderers.MobileGridTextCellRenderer;
  * such as the field of the data provider item whose value is to be displayed in the column.
  * MobileGridColumn takes most of its properties  from its parent class and adds the following Grid-specific options:</p>
  * <ul>
- *     <li>headerText and headerStyleName: optional label and style to display in the header for this column </li>
- *     <li>sortable, sortDescending and sortField: sorting options for this column </li>
+ *     <li>headerText and headerStyleName: optional label and style to display in the header for this column.</li>
+ *     <li>sortable, sortDescending and sortField: sorting options for this column.</li>
  *  </ul>
  *
  *  @see spark.components.MobileGrid
@@ -97,8 +97,7 @@ public class MobileGridColumn extends EventDispatcher
 
 
     /** Set the desired width for this column.
-     * <p> Width value is expressed in current applicationDPI, or at 160 DPI  if applicationDPI is not set.
-     * The default value is 100.
+     * <p> Width value is expressed in current applicationDPI, or at 160 DPI  if applicationDPI is not set. </p>
      *
      *  <p>Note: You can specify a percentage value in the MXML
      *  <code>width</code> attribute, such as <code>width="50%"</code>,
@@ -132,7 +131,7 @@ public class MobileGridColumn extends EventDispatcher
      *      <li> First, honor all columns with fixed widths.  Columns with no width or percentWidth receive a width of 100.</li>
      *      <li> Then distribute the remainder of width between all the columns with percentage widths.
      *      If the total of percentages is greater that 100%, it's will be normalized first..</li>
-     *   <ul>
+     *   </ul>
      *  </p>
      *
      * @default NaN
@@ -155,9 +154,11 @@ public class MobileGridColumn extends EventDispatcher
      *
      *  <p>The default item renderer is the ItemTextPartRenderer class,
      *  which displays the data item as text, optimized for mobile.  </p>
-     *  <p>You can use also ItemBitmapPartRenderer to display embedded bitmaps, in which case you need to define the iconField or iconFunction </p>
-     *  <p>You can also  create custom item renderers by deriving any subclass of UIComponent (eg. s:Button) and implementing IMobileGridCellRenderer.
-     *  for performance reasons  it's preferable that your renderer be written in ActionScript
+     *  <p>You can use also ItemBitmapPartRenderer to display embedded bitmaps,
+     *  in which case you need to define the iconField or iconFunction </p>
+     *  <p>You can also  create custom item renderers by deriving any subclass of UIComponent (eg. s:Button)
+     *  and implementing IMobileGridCellRenderer.</p>
+     *  <p>For performance reasons  it's preferable that your renderer be written in ActionScript and be as light as possible.</p>
      *
      *  @see #dataField
      *  @see spark.components.itemRenderers.MobileGridTextCellRenderer
@@ -179,7 +180,7 @@ public class MobileGridColumn extends EventDispatcher
 
 
     /**
-     *  An idempotent function that converts a data provider item into a column-specific string
+     *  An user-defined function that converts a data provider item into a column-specific string
      *  that's used to initialize the item renderer's <code>label</code> property.
      *
      *  <p>You can use a label function to combine the values of several data provider items
@@ -193,8 +194,7 @@ public class MobileGridColumn extends EventDispatcher
      *
      *  <pre>labelFunction(item:Object):String</pre>
      *
-     *  <p>The <code>item</code> parameter is the data provider item for an entire row.
-     *  The second parameter is this column object.</p>
+     *  <p>The <code>item</code> parameter is the data provider item for an entire row.</p>
      *
      *  <p>A typical label function could concatenate the firstName and
      *  lastName properties of the data provider item ,
@@ -212,8 +212,8 @@ public class MobileGridColumn extends EventDispatcher
 
     private var _styleName:String;
 
-    /** The css style name to apply to the renderer
-     *  the style items in the css will depend on the renderer. For example, text renderers will accept fontSize, color, fontWeight, etc.
+    /** The css style name to apply to the renderer.
+     * <p>The style items in the css entry will depend on the renderer. For example, text renderers will accept fontSize, color, fontWeight, etc.  </p>
      */
     public function get styleName():String
     {
@@ -282,7 +282,7 @@ public class MobileGridColumn extends EventDispatcher
     private var _sortable:Boolean = true;
 
     /** Flag indicating whether a column can be sorted by clicking on its header.
-     *  <p>This flag is effective only if the MobileGrid </p>
+     *  <p>This flag is effective only if the MobileGrid sortableColumn is not set or set to true.</p>
      */
     public function get sortable():Boolean
     {
@@ -325,7 +325,7 @@ public class MobileGridColumn extends EventDispatcher
         return sortField;
     }
 
-    public function createPartRenderer():IMobileGridCellRenderer
+    mx_internal function createPartRenderer():IMobileGridCellRenderer
     {
         var pr:IMobileGridCellRenderer = _itemRenderer.newInstance() as IMobileGridCellRenderer;
         if (pr)

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/37832b98/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
index 832997d..61aea73 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
@@ -20,12 +20,16 @@ package spark.components.supportClasses
 {
 import flash.display.DisplayObject;
 
+import mx.core.mx_internal;
+
 import spark.components.itemRenderers.IMobileGridCellRenderer;
 import spark.core.DisplayObjectSharingMode;
 import spark.core.IGraphicElement;
 import spark.core.IGraphicElementContainer;
 import spark.core.ISharedDisplayObject;
 
+use namespace mx_internal;
+
 /**  @private
  *  This is the base class for multi-part renderers that manages a vector of part renderers.
  *  This class is responsible for creating and storing  the actual renderers from their descriptors


[10/15] git commit: [flex-sdk] [refs/heads/develop] - https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile - clean up code to prepare integration with SDK - used core classes or methods whenever possible - removed unused classes ( ItemR

Posted by ma...@apache.org.
https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile
- clean up code to prepare integration with SDK
  - used core classes or methods whenever possible
  - removed unused classes ( ItemRendererBase and UIComponentUtils)


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/b2fb601f
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/b2fb601f
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/b2fb601f

Branch: refs/heads/develop
Commit: b2fb601fd7989456069fa1a89054f5420eafadf1
Parents: 37832b9
Author: mamsellem <ma...@systar.com>
Authored: Fri Oct 4 00:49:23 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Fri Oct 4 00:49:23 2013 +0200

----------------------------------------------------------------------
 .../projects/experimental_mobile/defaults.css   |  37 +-
 .../itemRenderers/MobileGridTextCellRenderer.as |   4 +-
 .../supportClasses/ItemRendererBase.as          | 872 -------------------
 .../supportClasses/ListMultiPartColumnLayout.as |   4 +-
 .../supportClasses/MobileGridRowRenderer.as     |  16 +-
 .../src/spark/utils/UIComponentUtils.as         | 135 ---
 6 files changed, 17 insertions(+), 1051 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b2fb601f/frameworks/projects/experimental_mobile/defaults.css
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/defaults.css b/frameworks/projects/experimental_mobile/defaults.css
index aaf188b..1b64a43 100644
--- a/frameworks/projects/experimental_mobile/defaults.css
+++ b/frameworks/projects/experimental_mobile/defaults.css
@@ -26,7 +26,7 @@ MobileGrid
     contentBackgroundColor: #202020;
     alternatingItemColors: #202020, #2a2a2a;
     color: white;
-     selection-color: #00a2ff; /* blue  */
+    selection-color: #00a2ff; /* blue  */
 
 }
 
@@ -60,13 +60,6 @@ supportClasses|MobileGridRowRenderer
         paddingBottom: 0;
     }
 
-    supportClasses|ItemRendererBase
-    {
-        paddingBottom: 12;
-        paddingLeft: 7;
-        paddingRight: 7;
-        paddingTop: 12;
-    }
 }
 
 @media (application-dpi: 160)
@@ -85,13 +78,6 @@ supportClasses|MobileGridRowRenderer
         paddingBottom: 0;
     }
 
-    supportClasses|ItemRendererBase
-    {
-        paddingBottom: 16;
-        paddingLeft: 10;
-        paddingRight: 10;
-        paddingTop: 16;
-    }
 }
 
 @media (application-dpi: 240)
@@ -110,13 +96,6 @@ supportClasses|MobileGridRowRenderer
         paddingBottom: 0;
     }
 
-    supportClasses|ItemRendererBase
-    {
-        paddingBottom: 24;
-        paddingLeft: 14;
-        paddingRight: 14;
-        paddingTop: 24;
-    }
 }
 
 @media (application-dpi: 320)
@@ -135,13 +114,6 @@ supportClasses|MobileGridRowRenderer
         paddingBottom: 0;
     }
 
-    supportClasses|ItemRendererBase
-    {
-        paddingBottom: 32;
-        paddingLeft: 20;
-        paddingRight: 20;
-        paddingTop: 32;
-    }
 }
 
 @media (application-dpi: 480)
@@ -160,13 +132,6 @@ supportClasses|MobileGridRowRenderer
         paddingBottom: 0;
     }
 
-    supportClasses|ItemRendererBase
-    {
-        paddingBottom: 48;
-        paddingLeft: 28;
-        paddingRight: 28;
-        paddingTop: 48;
-    }
 }
 
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b2fb601f/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as
index 8a74e88..e547df1 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/MobileGridTextCellRenderer.as
@@ -25,7 +25,7 @@ import mx.styles.IStyleClient;
 import mx.styles.StyleManager;
 
 import spark.components.supportClasses.StyleableTextField;
-import spark.utils.UIComponentUtils;
+import spark.utils.LabelUtil;
 
 use namespace mx_internal;
 
@@ -91,7 +91,7 @@ public class MobileGridTextCellRenderer extends StyleableTextField implements IM
     public function set data(value:Object):void
     {
         _data = value;
-        text = UIComponentUtils.itemToLabel(value, _labelField, _labelFunction);
+        text = LabelUtil.itemToLabel(value, _labelField, _labelFunction);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b2fb601f/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as
deleted file mode 100644
index a91d389..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as
+++ /dev/null
@@ -1,872 +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.
-//
-////////////////////////////////////////////////////////////////////////////////
-
-/**  @private
- *  monkey-patched  from LabelItemRenderer, pruned from label/labelDisplay  and change some variable accessibility
- *  Provides default behavior for  ListMultiPartItemRenderer
- *
- *   @langversion 3.0
- *  @playerversion AIR 3.8
- *  @productversion Flex 4.11
- *
- *  */
-//TODO refactoring : should  become superclass of LabelItemRenderer
-
-package spark.components.supportClasses
-{
-import flash.display.GradientType;
-import flash.events.Event;
-import flash.geom.Matrix;
-
-import mx.core.DPIClassification;
-import mx.core.FlexGlobals;
-import mx.core.IDataRenderer;
-import mx.core.IFlexDisplayObject;
-import mx.core.ILayoutElement;
-import mx.core.UIComponent;
-import mx.core.mx_internal;
-import mx.events.FlexEvent;
-
-import spark.components.DataGroup;
-import spark.components.IItemRenderer;
-
-use namespace mx_internal;
-
-//--------------------------------------
-//  Events
-//--------------------------------------
-
-/**
- *  Dispatched when the <code>data</code> property changes.
- *
- *  <p>When you use a component as an item renderer,
- *  the <code>data</code> property contains the data to display.
- *  You can listen for this event and update the component
- *  when the <code>data</code> property changes.</p>
- *
- *  @eventType mx.events.FlexEvent.DATA_CHANGE
- *
- */
-[Event(name="dataChange", type="mx.events.FlexEvent")]
-
-//--------------------------------------
-//  Styles
-//--------------------------------------
-
-[Style(name="paddingLeft", type="Number", format="Length", inherit="no")]
-
-/**
- *  @copy spark.components.supportClasses.GroupBase#style:alternatingItemColors
- *
- */
-[Style(name="alternatingItemColors", type="Array", arrayType="uint", format="Color", inherit="yes", theme="spark, mobile")]
-
-/**
- *  @copy spark.components.supportClasses.GroupBase#style:chromeColor
- *
- *  @default 0xCCCCCC
- *
- */
-[Style(name="chromeColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]
-
-/**
- *  @copy spark.components.supportClasses.GroupBase#style:downColor
- *
- */
-[Style(name="downColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]
-
-/**
- *  @copy spark.components.supportClasses.GroupBase#style:focusColor
- *
- */
-[Style(name="focusColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]
-
-/**
- *  Number of pixels between the bottom border and the text component
- *  of the item renderer.
- *
- *  @default 5
- *
- */
-[Style(name="paddingBottom", type="Number", format="Length", inherit="no")]
-
-/**
- *  Number of pixels between the top border and the text component
- *  of the item renderer.
- *
- *  @default 5
- *
- */
-[Style(name="paddingTop", type="Number", format="Length", inherit="no")]
-
-/**
- *  @copy spark.components.supportClasses.GroupBase#style:rollOverColor
- *
- */
-[Style(name="rollOverColor", type="uint", format="Color", inherit="yes")]
-
-/**
- *  @copy spark.components.List#style:selectionColor
- *
- */
-[Style(name="selectionColor", type="uint", format="Color", inherit="yes")]
-
-/**
- *  @copy spark.components.supportClasses.GroupBase#style:symbolColor
- *
- *  @langversion 3.0
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
- */
-[Style(name="symbolColor", type="uint", format="Color", inherit="yes", theme="spark,mobile")]
-
-/**
- *  The vertical alignment of the content when it does not have
- *  a one-to-one aspect ratio.
- *  Possible values are <code>"top"</code>, <code>"center"</code>,
- *  and <code>"bottom"</code>.
- *
- *  @default "center"
- *
- *  @langversion 3.0
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
- */
-[Style(name="verticalAlign", type="String", enumeration="bottom,middle,top", inherit="no")]
-
-//--------------------------------------
-//  Excluded APIs
-//--------------------------------------
-
-[Exclude(name="focusBlendMode", kind="style")]
-[Exclude(name="focusThickness", kind="style")]
-
-public class ItemRendererBase extends UIComponent implements IDataRenderer, IItemRenderer
-{
-
-    //--------------------------------------------------------------------------
-    //
-    //  Constructor
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  Constructor.
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    public function ItemRendererBase()
-    {
-        super();
-
-        switch (applicationDPI)
-        {
-            case DPIClassification.DPI_480:
-            {
-                minHeight = 132;
-                break;
-            }
-            case DPIClassification.DPI_320:
-            {
-                minHeight = 88;
-                break;
-            }
-            case DPIClassification.DPI_240:
-            {
-                minHeight = 66;
-                break;
-            }
-            default:
-            {
-                // default PPI160
-                minHeight = 44;
-                break;
-            }
-        }
-
-        interactionStateDetector = new InteractionStateDetector(this);
-        interactionStateDetector.addEventListener(Event.CHANGE, interactionStateDetector_changeHandler);
-
-        cacheAsBitmap = true;
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Private Properties
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     *  Helper class to help determine when we are in the hovered or down states
-     */
-    protected var interactionStateDetector:InteractionStateDetector;
-
-    /**
-     *  @private
-     *  Whether or not we're the last element in the list
-     */
-    mx_internal var isLastItem:Boolean = false;
-
-    //--------------------------------------------------------------------------
-    //
-    //  Public Properties
-    //
-    //--------------------------------------------------------------------------
-
-    //----------------------------------
-    //  data
-    //----------------------------------
-
-    /**
-     *  @private
-     */
-    private var _data:Object;
-
-    [Bindable("dataChange")]
-
-    /**
-     *  The implementation of the <code>data</code> property
-     *  as defined by the IDataRenderer interface.
-     *  When set, it stores the value and invalidates the component
-     *  to trigger a relayout of the component.
-     *
-     *  @see mx.core.IDataRenderer
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    public function get data():Object
-    {
-        return _data;
-    }
-
-    /**
-     *  @private
-     */
-    public function set data(value:Object):void
-    {
-        _data = value;
-
-        if (hasEventListener(FlexEvent.DATA_CHANGE))
-            dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
-
-        if (_data) onDataChanged();
-    }
-
-    protected function onDataChanged():void
-    {
-        // set data related properties
-    }
-
-    //----------------------------------
-    //  down
-    //----------------------------------
-    /**
-     *  @private
-     *  storage for the down property
-     */
-    private var _down:Boolean = false;
-
-    /**
-     *  Set to <code>true</code> when the user is pressing down on an item renderer.
-     *
-     *  @default false
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    protected function get down():Boolean
-    {
-        return _down;
-    }
-
-    /**
-     *  @private
-     */
-    protected function set down(value:Boolean):void
-    {
-        if (value == _down)
-            return;
-
-        _down = value;
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  hovered
-    //----------------------------------
-    /**
-     *  @private
-     *  storage for the hovered property
-     */
-    private var _hovered:Boolean = false;
-
-    /**
-     *  Set to <code>true</code> when the user is hovered over the item renderer.
-     *
-     *  @default false
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    protected function get hovered():Boolean
-    {
-        return _hovered;
-    }
-
-    /**
-     *  @private
-     */
-    protected function set hovered(value:Boolean):void
-    {
-        if (value == _hovered)
-            return;
-
-        _hovered = value;
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  itemIndex
-    //----------------------------------
-
-    /**
-     *  @private
-     *  storage for the itemIndex property
-     */
-    private var _itemIndex:int;
-
-    /**
-     *  @inheritDoc
-     *
-     *  @default 0
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    public function get itemIndex():int
-    {
-        return _itemIndex;
-    }
-
-    /**
-     *  @private
-     */
-    public function set itemIndex(value:int):void
-    {
-        var wasLastItem:Boolean = isLastItem;
-        var dataGroup:DataGroup = parent as DataGroup;
-        isLastItem = (dataGroup && (value == dataGroup.numElements - 1));
-
-        // if whether or not we are the last item in the last has changed then
-        // invalidate our display. note:  even if our new index has not changed,
-        // whether or not we're the last item may have so we perform this check
-        // before the value == _itemIndex check below
-        if (wasLastItem != isLastItem)
-            invalidateDisplayList();
-
-        if (value == _itemIndex)
-            return;
-
-        _itemIndex = value;
-
-        // only invalidateDisplayList() if this causes use to redraw which
-        // is only if alternatingItemColors are defined (and technically also
-        // only if we are not selected or down, etc..., but we'll ignore those
-        // as this will shortcut 95% of the time anyways)
-        if (getStyle("alternatingItemColors") !== undefined)
-            invalidateDisplayList();
-    }
-
-    public function get label():String
-    {
-        return "";
-    }
-
-    public function set label(value:String):void
-    {
-    }
-
-    private var _showsCaret:Boolean = false;
-
-    /**
-     *  @inheritDoc
-     *
-     *  @default false
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    public function get showsCaret():Boolean
-    {
-        return _showsCaret;
-    }
-
-    /**
-     *  @private
-     */
-    public function set showsCaret(value:Boolean):void
-    {
-        if (value == _showsCaret)
-            return;
-
-        _showsCaret = value;
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  selected
-    //----------------------------------
-
-    /**
-     *  @private
-     *  storage for the selected property
-     */
-    private var _selected:Boolean = false;
-
-    /**
-     *  @inheritDoc
-     *
-     *  @default false
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    public function get selected():Boolean
-    {
-        return _selected;
-    }
-
-    /**
-     *  @private
-     */
-    public function set selected(value:Boolean):void
-    {
-        if (value == _selected)
-            return;
-
-        _selected = value;
-        invalidateDisplayList();
-    }
-
-    //----------------------------------
-    //  dragging
-    //----------------------------------
-
-    /**
-     *  @private
-     *  Storage for the dragging property.
-     */
-    private var _dragging:Boolean = false;
-
-    /**
-     *  @inheritDoc
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    public function get dragging():Boolean
-    {
-        return _dragging;
-    }
-
-    /**
-     *  @private
-     */
-    public function set dragging(value:Boolean):void
-    {
-        _dragging = value;
-    }
-
-
-    //----------------------------------
-    //  authorDensity
-    //----------------------------------
-    /**
-     *  Returns the DPI of the application.
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    public function get applicationDPI():Number
-    {
-        return FlexGlobals.topLevelApplication.applicationDPI;
-    }
-
-
-    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-        // clear the graphics before calling super.updateDisplayList()
-        graphics.clear();
-
-        super.updateDisplayList(unscaledWidth, unscaledHeight);
-
-        drawBackground(unscaledWidth, unscaledHeight);
-
-        layoutContents(unscaledWidth, unscaledHeight);
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Methods
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  Renders a background for the item renderer.
-     *
-     *  <p>This method, along with <code>layoutContents()</code>, is called
-     *  by the <code>updateDisplayList()</code> method.</p>
-     *
-     *  <p>This method draws the background and the outline for this item renderer.
-     *  It knows how to appropriately handle the selected, down, or caretted states.
-     *  However, when <code>alternatingItemColors</code> is set to <code>undefined</code>,
-     *  the default background is transparent.
-     *  Override this method to change the appearance of the background of
-     *  the item renderer.</p>
-     *
-     *  @param unscaledWidth Specifies the width of the component, in pixels,
-     *  in the component's coordinates, regardless of the value of the
-     *  <code>scaleX</code> property of the component.
-     *
-     *  @param unscaledHeight Specifies the height of the component, in pixels,
-     *  in the component's coordinates, regardless of the value of the
-     *  <code>scaleY</code> property of the component.
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-        // figure out backgroundColor
-        var backgroundColor:*;
-        var downColor:* = getStyle("downColor");
-        var drawBackground:Boolean = true;
-        var opaqueBackgroundColor:* = undefined;
-
-        if (down && downColor !== undefined)
-        {
-            backgroundColor = downColor;
-        }
-        else if (selected)
-        {
-            backgroundColor = getStyle("selectionColor");
-        }
-        else if (hovered)
-        {
-            backgroundColor = getStyle("rollOverColor");
-        }
-        else if (showsCaret)
-        {
-            backgroundColor = getStyle("selectionColor");
-        }
-        else
-        {
-            var alternatingColors:Array;
-            var alternatingColorsStyle:Object = getStyle("alternatingItemColors");
-
-            if (alternatingColorsStyle)
-                alternatingColors = (alternatingColorsStyle is Array) ? (alternatingColorsStyle as Array) : [alternatingColorsStyle];
-
-            if (alternatingColors && alternatingColors.length > 0)
-            {
-                // translate these colors into uints
-                styleManager.getColorNames(alternatingColors);
-
-                backgroundColor = alternatingColors[itemIndex % alternatingColors.length];
-            }
-            else
-            {
-                // don't draw background if it is the contentBackgroundColor. The
-                // list skin handles the background drawing for us.
-                drawBackground = false;
-            }
-
-        }
-
-        // draw backgroundColor
-        // the reason why we draw it in the case of drawBackground == 0 is for
-        // mouse hit testing purposes
-        graphics.beginFill(backgroundColor, drawBackground ? 1 : 0);
-        graphics.lineStyle();
-        graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
-        graphics.endFill();
-
-        // Selected and down states have a gradient overlay as well
-        // as different separators colors/alphas
-        if (selected || down)
-        {
-            var colors:Array = [0x000000, 0x000000 ];
-            var alphas:Array = [.2, .1];
-            var ratios:Array = [0, 255];
-            var matrix:Matrix = new Matrix();
-
-            // gradient overlay
-            matrix.createGradientBox(unscaledWidth, unscaledHeight, Math.PI / 2, 0, 0);
-            graphics.beginGradientFill(GradientType.LINEAR, colors, alphas, ratios, matrix);
-            graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
-            graphics.endFill();
-        }
-        else if (drawBackground)
-        {
-            // If our background is a solid color, use it as the opaqueBackground property
-            // for this renderer. This makes scrolling considerably faster.
-            opaqueBackgroundColor = backgroundColor;
-        }
-
-        // Draw the separator for the item renderer
-        drawBorder(unscaledWidth, unscaledHeight, alternatingColorsStyle != null);
-
-        opaqueBackground = opaqueBackgroundColor;
-    }
-
-    /**
-     *  Renders the border for the item renderer.
-     *
-     *  <p>This method is called by <code>drawBackground</code> after the
-     *  background has been rendered.</p>
-     *
-     *  <p>Override this method to change the appearance of the separator or
-     *  border of the item renderer.</p>
-     *
-     *  @param unscaledWidth Specifies the width of the component, in pixels,
-     *  in the component's coordinates, regardless of the value of the
-     *  <code>scaleX</code> property of the component.
-     *
-     *  @param unscaledHeight Specifies the height of the component, in pixels,
-     *  in the component's coordinates, regardless of the value of the
-     *  <code>scaleY</code> property of the component.
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 3.0
-     *  @productversion Flex 4.6
-     */
-    protected function drawBorder(unscaledWidth:Number, unscaledHeight:Number, hasAlternatingColors:Boolean):void
-    {
-        var topSeparatorColor:uint;
-        var topSeparatorAlpha:Number;
-        var bottomSeparatorColor:uint;
-        var bottomSeparatorAlpha:Number;
-
-        var borderWidth:Number = 1;
-        var drawBottomBorder:Boolean = !hasAlternatingColors; // if alternating colors, don't draw shadow
-
-        // separators are a highlight on the top and shadow on the bottom
-        topSeparatorColor = 0xFFFFFF;
-        topSeparatorAlpha = .3;
-        bottomSeparatorColor = 0x000000;
-        bottomSeparatorAlpha = .3;
-
-
-        // draw separators
-        // don't draw top separator for down and selected states
-        if (!(selected || down))
-        {
-            graphics.beginFill(topSeparatorColor, topSeparatorAlpha);
-            graphics.drawRect(0, 0, unscaledWidth, borderWidth);
-            graphics.endFill();
-        }
-
-        if (drawBottomBorder)
-            graphics.beginFill(bottomSeparatorColor, bottomSeparatorAlpha);
-        graphics.drawRect(0, unscaledHeight - (isLastItem ? 0 : borderWidth), unscaledWidth, borderWidth);
-        graphics.endFill();
-
-
-        // add extra separators to the first and last items so that
-        // the list looks correct during the scrolling bounce/pull effect
-        // top
-        if (itemIndex == 0 && drawBottomBorder)
-        {
-            graphics.beginFill(bottomSeparatorColor, bottomSeparatorAlpha);
-            graphics.drawRect(0, -borderWidth, unscaledWidth, borderWidth);
-            graphics.endFill();
-        }
-
-        // bottom
-        if (isLastItem)
-        {
-            // we want to offset the bottom by 1 so that we don't get
-            // a double line at the bottom of the list if there's a
-            // border
-            graphics.beginFill(topSeparatorColor, topSeparatorAlpha);
-            graphics.drawRect(0, unscaledHeight + borderWidth, unscaledWidth, borderWidth);
-            graphics.endFill();
-        }
-    }
-
-    /**
-     *  Positions the children for this item renderer.
-     *
-     *  <p>This method, along with <code>drawBackground()</code>, is called
-     *  by the <code>updateDisplayList()</code> method.</p>
-     *
-     *  <p>This method positions the <code>labelDisplay</code> component.
-     *  Subclasses should override this to position their children.</p>
-     *
-     *  @param unscaledWidth Specifies the width of the component, in pixels,
-     *  in the component's coordinates, regardless of the value of the
-     *  <code>scaleX</code> property of the component.
-     *
-     *  @param unscaledHeight Specifies the height of the component, in pixels,
-     *  in the component's coordinates, regardless of the value of the
-     *  <code>scaleY</code> property of the component.
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-
-    }
-
-    protected function setElementPosition(element:Object, x:Number, y:Number):void
-    {
-        if (element is ILayoutElement)
-        {
-            ILayoutElement(element).setLayoutBoundsPosition(x, y, false);
-        }
-        else if (element is IFlexDisplayObject)
-        {
-            IFlexDisplayObject(element).move(x, y);
-        }
-        else
-        {
-            element.x = x;
-            element.y = y;
-        }
-    }
-
-    /**
-     *  @copy spark.skins.mobile.supportClasses.MobileSkin#setElementSize()
-     *
-     *  @see #setElementPosition
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    protected function setElementSize(element:Object, width:Number, height:Number):void
-    {
-        if (element is ILayoutElement)
-        {
-            ILayoutElement(element).setLayoutBoundsSize(width, height, false);
-        }
-        else if (element is IFlexDisplayObject)
-        {
-            IFlexDisplayObject(element).setActualSize(width, height);
-        }
-        else
-        {
-            element.width = width;
-            element.height = height;
-        }
-    }
-
-    /**
-     *  @copy spark.skins.mobile.supportClasses.MobileSkin#getElementPreferredWidth()
-     *
-     *  @see #setElementPosition
-     *  @see #setElementSize
-     *  @see #getElementPreferredHeight
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    protected function getElementPreferredWidth(element:Object):Number
-    {
-        var result:Number;
-
-        if (element is ILayoutElement)
-        {
-            result = ILayoutElement(element).getPreferredBoundsWidth();
-        }
-        else if (element is IFlexDisplayObject)
-        {
-            result = IFlexDisplayObject(element).measuredWidth;
-        }
-        else
-        {
-            result = element.width;
-        }
-
-        return Math.round(result);
-    }
-
-    /**
-     *  @copy spark.skins.mobile.supportClasses.MobileSkin#getElementPreferredHeight()
-     *
-     *  @see #setElementPosition
-     *  @see #setElementSize
-     *  @see #getElementPreferredWidth
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 2.5
-     *  @productversion Flex 4.5
-     */
-    protected function getElementPreferredHeight(element:Object):Number
-    {
-        var result:Number;
-
-        if (element is ILayoutElement)
-        {
-            result = ILayoutElement(element).getPreferredBoundsHeight();
-        }
-        else if (element is IFlexDisplayObject)
-        {
-            result = IFlexDisplayObject(element).measuredHeight;
-        }
-        else
-        {
-            result = element.height;
-        }
-
-        return Math.ceil(result);
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  Event Handlers
-    //
-    //--------------------------------------------------------------------------
-
-    /**
-     *  @private
-     */
-    private function interactionStateDetector_changeHandler(event:Event):void
-    {
-        down = (interactionStateDetector.state == InteractionState.DOWN);
-        hovered = (interactionStateDetector.state == InteractionState.OVER);
-    }
-}
-}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b2fb601f/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
index 1da5268..96021f1 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
@@ -24,7 +24,6 @@ import mx.core.mx_internal;
 
 import spark.components.itemRenderers.IMobileGridCellRenderer;
 import spark.core.IGraphicElement;
-import spark.utils.UIComponentUtils;
 
 use namespace  mx_internal;
 
@@ -105,12 +104,11 @@ public class ListMultiPartColumnLayout extends Object
             }
             partHeight = dpr.canSetContentHeight ? cellHeight : dpr.getPreferredBoundsHeight();
             setElementSize(dpr, partWidth, partHeight);
-            setElementPosition(dpr, curX, curY + UIComponentUtils.offsetForCenter(partHeight, cellHeight));
+            setElementPosition(dpr, curX, curY + ( cellHeight - partHeight) / 2 );
             curX += colWidth;
         }
     }
 
-
     /* layout helper  methods */
 
     protected function setElementPosition(element:Object, x:Number, y:Number):void

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b2fb601f/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
index 61aea73..34dca29 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
@@ -22,6 +22,8 @@ import flash.display.DisplayObject;
 
 import mx.core.mx_internal;
 
+import spark.components.LabelItemRenderer;
+
 import spark.components.itemRenderers.IMobileGridCellRenderer;
 import spark.core.DisplayObjectSharingMode;
 import spark.core.IGraphicElement;
@@ -43,7 +45,7 @@ use namespace mx_internal;
  *  @productversion Flex 4.11
  *
  */
-public class MobileGridRowRenderer extends ItemRendererBase implements IGraphicElementContainer, ISharedDisplayObject
+public class MobileGridRowRenderer extends LabelItemRenderer implements IGraphicElementContainer, ISharedDisplayObject
 {
     private var _columns:Vector.<MobileGridColumn>;
     private var _partRenderers:Vector.<IMobileGridCellRenderer>;
@@ -86,9 +88,15 @@ public class MobileGridRowRenderer extends ItemRendererBase implements IGraphicE
         return _graphicElementPartRenderers;
     }
 
+
+    override public function get baselinePosition():Number
+    {
+        return NaN;
+    }
+
     override protected function createChildren():void
     {
-        super.createChildren();
+    //    super.createChildren();
         var desc:MobileGridColumn;
         var pr:IMobileGridCellRenderer;
         var ge:IGraphicElement;
@@ -138,8 +146,10 @@ public class MobileGridRowRenderer extends ItemRendererBase implements IGraphicE
         _partRenderersLayout.layoutContents(unscaledWidth, unscaledHeight);
     }
 
-    override protected function onDataChanged():void
+
+    override public function set data(value:Object):void
     {
+        super.data = value;
         var dpr:IMobileGridCellRenderer;
         for (var i:int = 0; i < _partRenderers.length; i++)
         {

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b2fb601f/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as b/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
deleted file mode 100644
index 737fa40..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
+++ /dev/null
@@ -1,135 +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 spark.utils
-{
-import mx.core.IFlexDisplayObject;
-import mx.core.ILayoutElement;
-
-/**  @private
- * Utility class for MobileGrid
- *  @langversion 3.0
- *  @playerversion AIR 3.8
- *  @productversion Flex 4.11
- */
-public class UIComponentUtils
-{
-
-    public static function itemToLabel(item:Object, labelField:String, labelFunction:Function, nullLabel:String = '-'):String
-    {
-        if (labelFunction != null)
-        {
-            return labelFunction(item);
-        }
-        else if (item == null)
-        {
-            return nullLabel;
-        }
-        else
-        {
-            return   item[labelField];
-        }
-    }
-
-
-    public static function setElementSize(element:Object, width:Number, height:Number):void
-    {
-        if (element is ILayoutElement)
-        {
-            ILayoutElement(element).setLayoutBoundsSize(width, height, false);
-        }
-        else if (element is IFlexDisplayObject)
-        {
-            IFlexDisplayObject(element).setActualSize(width, height);
-        }
-        else
-        {
-            element.width = width;
-            element.height = height;
-        }
-    }
-
-    public static function setElementPosition(element:Object, x:Number, y:Number):void
-    {
-        if (element is ILayoutElement)
-        {
-            ILayoutElement(element).setLayoutBoundsPosition(x, y, false);
-        }
-        else if (element is IFlexDisplayObject)
-        {
-            IFlexDisplayObject(element).move(x, y);
-        }
-        else
-        {
-            element.x = x;
-            element.y = y;
-        }
-    }
-
-    public static function getElementPreferredWidth(element:Object):Number
-    {
-        var result:Number;
-
-        if (element is ILayoutElement)
-        {
-            result = ILayoutElement(element).getPreferredBoundsWidth();
-        }
-        else if (element is IFlexDisplayObject)
-        {
-            result = IFlexDisplayObject(element).measuredWidth;
-        }
-        else
-        {
-            result = element.width;
-        }
-        return Math.round(result);
-    }
-
-    public static function getElementPreferredHeight(element:Object):Number
-    {
-        var result:Number;
-
-        if (element is ILayoutElement)
-        {
-            result = ILayoutElement(element).getPreferredBoundsHeight();
-        }
-        else if (element is IFlexDisplayObject)
-        {
-            result = IFlexDisplayObject(element).measuredHeight;
-        }
-        else
-        {
-            result = element.height;
-        }
-        return Math.ceil(result);
-    }
-
-    public static function offsetForCenter(inLength:Number, outLength:Number):Number
-    {
-        return ( outLength - inLength) / 2;
-    }
-
-    public static function setElementPositionTopRight(component:Object, container:Object, paddingTop:Number = 0, paddingRight:Number = 0):void
-    {
-        var right:Number = getElementPreferredWidth(container) - getElementPreferredWidth(component) - paddingRight;
-        setElementPosition(component, paddingTop, right);
-    }
-
-}
-}


[03/15] git commit: [flex-sdk] [refs/heads/develop] - Testing CRLF preserve on commit

Posted by ma...@apache.org.
Testing CRLF preserve on commit


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/aef85b3a
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/aef85b3a
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/aef85b3a

Branch: refs/heads/develop
Commit: aef85b3a5300b931b58b83b69fc74e93a09aa1d4
Parents: 5fb52ac
Author: mamsellem <ma...@systar.com>
Authored: Mon Sep 30 00:04:25 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Mon Sep 30 00:04:25 2013 +0200

----------------------------------------------------------------------
 SVN-TEST.txt | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/aef85b3a/SVN-TEST.txt
----------------------------------------------------------------------
diff --git a/SVN-TEST.txt b/SVN-TEST.txt
index e03664b..7a5e429 100644
--- a/SVN-TEST.txt
+++ b/SVN-TEST.txt
@@ -11,20 +11,21 @@ rduartes wrote this here:
 (you have to listen to this being recited by Douglas Campbell in Loreena McKennit's Lullaby song)
 
 Oh for a voice like Thunder, and a tongue to drown the voice of war,
-When the soul is driven to madness, 
+When the soul is driven to madness,
 WHO CAN STAND ?
-When the souls of the oppressed fight in the troubled air that rages, 
+When the souls of the oppressed fight in the troubled air that rages,
 WHO CAN STAND ?
-When the whirlwind of fury comes from the throne of GOD, 
+When the whirlwind of fury comes from the throne of GOD,
 WHO CAN STAND ?
-When the frowns of his countenance drive the nations together, 
+Testing CR-LF on commit / only this line was changed.
+When the frowns of his countenance drive the nations together,
 WHO CAN STAND?
 When sin claps his broad wings over the battle, and sails rejoicing in the flood of death,
 When the souls are torn to everlasting fire, and fiends of Hell rejoice upon the slain,
 Oh who can stand?
 Oh who has caused this?
 Oh who can answer at the throne of God?
-The Kings and Nobles of the land have done it, 
+The Kings and Nobles of the land have done it,
 Hear it not Heaven,
 Thy Ministers have done it !
 


[02/15] git commit: [flex-sdk] [refs/heads/develop] - commit test

Posted by ma...@apache.org.
commit test


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/5fb52acd
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/5fb52acd
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/5fb52acd

Branch: refs/heads/develop
Commit: 5fb52acd422459486cdc98b7f0b8862f76a7a1e0
Parents: 35c802c
Author: mamsellem <ma...@systar.com>
Authored: Sun Sep 29 16:40:54 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Sun Sep 29 16:40:54 2013 +0200

----------------------------------------------------------------------
 SVN-TEST.txt | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/5fb52acd/SVN-TEST.txt
----------------------------------------------------------------------
diff --git a/SVN-TEST.txt b/SVN-TEST.txt
index 78473ff..e03664b 100644
--- a/SVN-TEST.txt
+++ b/SVN-TEST.txt
@@ -68,5 +68,7 @@ Checking to see if I'm able to push this back to origin.
 
 Me too.  Woot.
 
+mamsellem git commit first try (2013/09/29)
+
 
 


[07/15] git commit: [flex-sdk] [refs/heads/develop] - https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile - Manages column with percent widths - Simplified class structure, removing intermediary classes - Completed all ASDOC - Optimized la

Posted by ma...@apache.org.
https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile
- Manages column with percent widths
- Simplified class structure, removing intermediary classes
- Completed all ASDOC
- Optimized layout calculations


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/44826607
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/44826607
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/44826607

Branch: refs/heads/develop
Commit: 448266071533e134113d21c6e5296543753c150b
Parents: fe39973
Author: mamsellem <ma...@systar.com>
Authored: Wed Oct 2 02:47:00 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Wed Oct 2 02:47:00 2013 +0200

----------------------------------------------------------------------
 .../src/ExperimentalMobileClasses.as            |   2 +-
 .../src/spark/components/MobileGrid.as          |  29 +-
 .../itemRenderers/IItemPartRendererBase.as      |  10 +-
 .../itemRenderers/IItemTextPartRenderer.as      |  10 +-
 .../itemRenderers/ItemBitmapPartRenderer.as     |  15 +-
 .../itemRenderers/ItemTextPartRenderer.as       |   9 +-
 .../supportClasses/ItemRendererBase.as          |  34 +--
 .../supportClasses/ListMultiPartColumnLayout.as | 135 ++++++++--
 .../ListMultiPartItemRendererBase.as            | 267 -------------------
 .../supportClasses/ListMultiPartLayoutBase.as   | 148 ----------
 .../supportClasses/MobileGridColumn.as          | 249 +++++++++++++++--
 .../supportClasses/MobileGridHeader.as          |  39 ++-
 .../supportClasses/MobileGridRowRenderer.as     | 234 +++++++++++++++-
 .../PartRendererDescriptorBase.as               | 189 -------------
 .../src/spark/events/MobileGridHeaderEvent.as   |   2 +-
 .../src/spark/layouts/MobileGridLayout.as       |  95 +++++++
 .../src/spark/utils/DensityUtil2.as             |  16 +-
 .../src/spark/utils/MultiDPIBitmapSourceExt.as  |  12 +-
 .../src/spark/utils/UIComponentUtils.as         |   8 +-
 19 files changed, 771 insertions(+), 732 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as b/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
index b695712..8cb1081 100644
--- a/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
+++ b/frameworks/projects/experimental_mobile/src/ExperimentalMobileClasses.as
@@ -25,7 +25,7 @@ import spark.skins.MobileGridSkin;
 
 /*
  classes that won't be detected through dependencies
- * and classes that needs to be includes in ASDOC
+ * and root classes that needs to be includes in ASDOC
  * */
 
 internal class ExperimentalMobileClasses

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
index 4161580..39977d7 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/MobileGrid.as
@@ -30,8 +30,8 @@ import spark.collections.Sort;
 import spark.components.supportClasses.MobileGridColumn;
 import spark.components.supportClasses.MobileGridHeader;
 import spark.components.supportClasses.MobileGridRowRenderer;
-import spark.components.supportClasses.PartRendererDescriptorBase;
 import spark.events.MobileGridHeaderEvent;
+import spark.layouts.MobileGridLayout;
 import spark.layouts.VerticalLayout;
 import spark.layouts.supportClasses.LayoutBase;
 
@@ -41,18 +41,10 @@ use namespace  mx_internal;
  *  Dispatched when the user releases the mouse button on a column header
  *  to request the control to sort  the grid contents based on the contents of the column.
  *  Only dispatched if the column is sortable and the data provider supports
- *  sorting. The DataGrid control has a default handler for this event that implements
- *  a single-column sort.
- * <b>Note</b>: The sort arrows are defined by the default event handler for
- * the headerRelease event. If you call the <code>preventDefault()</code> method
- * in your event handler, the arrows are not drawn.
- * </p>
+ *  sorting.
  *
- *  @eventType mx.events.DataGridEvent.HEADER_RELEASE
+ *  @eventType spark.events.MobileGridHeaderEvent
  *
- *  @langversion 3.0
- *  @playerversion AIR 3.8
- *  @productversion Flex 4.11
  */
 [Event(name="sortChange", type="spark.events.MobileGridHeaderEvent")]
 
@@ -118,10 +110,6 @@ public class MobileGrid extends List
      *
      *  @see   spark.components.supportClasses.MobileGridColumn
      *
-     *  @langversion 3.0
-     *  @playerversion Flash 9
-     *  @playerversion AIR 1.1
-     *  @productversion Flex 3
      */
     [Inspectable(arrayType="spark.components.supportClasses.MobileGridColumn")]
     public function set columns(value:Array):void
@@ -156,10 +144,7 @@ public class MobileGrid extends List
      *  @default true
      *
      *  @see spark.components.supportClasses.MobileGridColumn#sortable
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 3.8
-     *  @productversion Flex 4.11
+
      */
     public function get sortableColumns():Boolean
     {
@@ -190,18 +175,18 @@ public class MobileGrid extends List
     /* default layout for row item renderers */
     protected function getDefaultLayout():LayoutBase
     {
-        var l:VerticalLayout = new VerticalLayout();
+        var l:VerticalLayout = new MobileGridLayout(this);
         l.horizontalAlign = "contentJustify";
         l.gap = 0;
         return l;
     }
 
-    protected function initDefaultItemRenderer(pcolumnDescriptors:Array):void
+    protected function initDefaultItemRenderer(pcolumns:Array):void
     {
         var cf:ClassFactory;
         cf = new ClassFactory(MobileGridRowRenderer);
         cf.properties = {
-            partRendererDescriptors: Vector.<PartRendererDescriptorBase>(pcolumnDescriptors)
+            columns: Vector.<MobileGridColumn>(pcolumns)
         };
         this.itemRenderer = cf;
     }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
index ab802f3..37ca652 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemPartRendererBase.as
@@ -24,6 +24,12 @@ import mx.styles.IStyleClient;
 
 /**
  * This is the base interface that all mobile cell or other mobile item part renderers must implement.
+ * Contrary to desktop DataGrid control, there is no default base renderer,
+ * because mobile renderers must be lightweight, and derive directly for the existing component, (ie. s:Button or s:CheckBox ).
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
  */
 public interface IItemPartRendererBase extends IDataRenderer
 {
@@ -34,9 +40,9 @@ public interface IItemPartRendererBase extends IDataRenderer
      */
     function set styleProvider(value:IStyleClient):void ;
 
-    function get canSetWidth():Boolean;
+    function get canSetContentWidth():Boolean;
 
-    function get canSetHeight():Boolean;
+    function get canSetContentHeight():Boolean;
 
     /**
      * @private

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
index edcc0f9..90ca694 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/IItemTextPartRenderer.as
@@ -19,13 +19,21 @@
 package spark.components.itemRenderers
 {
 
+/**  Extended interface for renderer that include text
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ */
+
 public interface IItemTextPartRenderer extends IItemPartRendererBase
 {
-
+    /* implement this property so that the renderer can receive the dataField from the renderer's MobileGridColumn*/
     function set labelField(value:String):void;
 
+    /* implement this property so that the renderer can receive the labelFunction from the renderers' MobileGridColumn*/
     function set labelFunction(value:Function):void;
 
+    /* implement this property so that the renderer can receive the textAlign property from the renderers' MobileGridColumn*/
     function set textAlign(textAlign:String):void;
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
index c95195b..29db838 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemBitmapPartRenderer.as
@@ -28,7 +28,12 @@ import spark.primitives.BitmapImage;
 use namespace mx_internal;
 
 /** Default lightweight  class for rendering embedded Bitmaps  or Multi-DPI Bitmaps in a MobileGrid cell .
- * <p> You define the icon to be used in each cell by setting either iconField or iconFunction properties.  </p>
+ *You define the icon to be used in each cell by setting either iconField or iconFunction properties.
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ *
  *  */
 public class ItemBitmapPartRenderer extends BitmapImage implements IItemPartRendererBase
 {
@@ -45,12 +50,12 @@ public class ItemBitmapPartRenderer extends BitmapImage implements IItemPartRend
 
     /**
      *  The name of the field or property in the DataGrid's dataProvider item that defines the icon to display for this renderer's column.
-     *  <p> The fields value must be either an embedded bitmap's class, or or MultiBitmapSourceExt object.   </p>
+     *  <p> The field value must be either an embedded bitmap's class, or or MultiBitmapSource object.   </p>
      *   <p> If not set, then iconFunction will be used.  </p>
      *  @default null
      *
      *  @see #iconFunction
-     *  @see  spark.utils.MultiDPIBitmapSourceExt
+     *  @see  spark.utils.MultiDPIBitmapSource
      *
      */
     public function get iconField():String
@@ -115,12 +120,12 @@ public class ItemBitmapPartRenderer extends BitmapImage implements IItemPartRend
 
     /* to avoid any scaling artifacts, we do not allow bitmap to be stretcghed */
 
-    public function get canSetWidth():Boolean
+    public function get canSetContentWidth():Boolean
     {
         return false;
     }
 
-    public function get canSetHeight():Boolean
+    public function get canSetContentHeight():Boolean
     {
         return false;
     }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
index ca3f542..2ad7118 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/itemRenderers/ItemTextPartRenderer.as
@@ -31,6 +31,11 @@ use namespace mx_internal;
 
 /** Default lightweight  class for rendering formatted text in MobileGrid cells .
  * <p> You don't have to use this render explicitly as it will be used by default for MobileGrid text cells. </p>
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ *
  *  */
 public class ItemTextPartRenderer extends StyleableTextField implements IItemTextPartRenderer
 {
@@ -92,12 +97,12 @@ public class ItemTextPartRenderer extends StyleableTextField implements IItemTex
         _labelFunction = value;
     }
 
-    public function get canSetWidth():Boolean
+    public function get canSetContentWidth():Boolean
     {
         return true;
     }
 
-    public function get canSetHeight():Boolean
+    public function get canSetContentHeight():Boolean
     {
         return false;
     }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as
index cf54c6e..a91d389 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ItemRendererBase.as
@@ -20,8 +20,13 @@
 /**  @private
  *  monkey-patched  from LabelItemRenderer, pruned from label/labelDisplay  and change some variable accessibility
  *  Provides default behavior for  ListMultiPartItemRenderer
- *  Eventually should  become superclass of LabelItemRenderer
+ *
+ *   @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ *
  *  */
+//TODO refactoring : should  become superclass of LabelItemRenderer
 
 package spark.components.supportClasses
 {
@@ -57,9 +62,6 @@ use namespace mx_internal;
  *
  *  @eventType mx.events.FlexEvent.DATA_CHANGE
  *
- *  @langversion 3.0
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
  */
 [Event(name="dataChange", type="mx.events.FlexEvent")]
 
@@ -72,9 +74,6 @@ use namespace mx_internal;
 /**
  *  @copy spark.components.supportClasses.GroupBase#style:alternatingItemColors
  *
- *  @langversion 3.0
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
  */
 [Style(name="alternatingItemColors", type="Array", arrayType="uint", format="Color", inherit="yes", theme="spark, mobile")]
 
@@ -83,27 +82,18 @@ use namespace mx_internal;
  *
  *  @default 0xCCCCCC
  *
- *  @langversion 3.0
- *  @playerversion AIR 1.5
- *  @productversion Flex 4
  */
 [Style(name="chromeColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]
 
 /**
  *  @copy spark.components.supportClasses.GroupBase#style:downColor
  *
- *  @langversion 3.0
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
  */
 [Style(name="downColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]
 
 /**
  *  @copy spark.components.supportClasses.GroupBase#style:focusColor
  *
- *  @langversion 3.0
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
  */
 [Style(name="focusColor", type="uint", format="Color", inherit="yes", theme="spark, mobile")]
 
@@ -113,9 +103,6 @@ use namespace mx_internal;
  *
  *  @default 5
  *
- *  @langversion 3.0
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
  */
 [Style(name="paddingBottom", type="Number", format="Length", inherit="no")]
 
@@ -125,27 +112,18 @@ use namespace mx_internal;
  *
  *  @default 5
  *
- *  @langversion 3.0
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
  */
 [Style(name="paddingTop", type="Number", format="Length", inherit="no")]
 
 /**
  *  @copy spark.components.supportClasses.GroupBase#style:rollOverColor
  *
- *  @langversion 3.0
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
  */
 [Style(name="rollOverColor", type="uint", format="Color", inherit="yes")]
 
 /**
  *  @copy spark.components.List#style:selectionColor
  *
- *  @langversion 3.0
- *  @playerversion AIR 2.5
- *  @productversion Flex 4.5
  */
 [Style(name="selectionColor", type="uint", format="Color", inherit="yes")]
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
index 44c2c46..8cd7e27 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartColumnLayout.as
@@ -18,9 +18,12 @@
 ////////////////////////////////////////////////////////////////////////////////
 package spark.components.supportClasses
 {
+import mx.core.IFlexDisplayObject;
+import mx.core.ILayoutElement;
 import mx.core.mx_internal;
 
 import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.core.IGraphicElement;
 import spark.utils.UIComponentUtils;
 
 use namespace  mx_internal;
@@ -29,29 +32,45 @@ use namespace  mx_internal;
  *    this class is responsible for laying out grid cells in a given MobileGrid row.
  *    It will make sure that cell content is aligned according to the column widths.
  */
-public class ListMultiPartColumnLayout extends ListMultiPartLayoutBase
+public class ListMultiPartColumnLayout extends Object
 {
+    public function ListMultiPartColumnLayout(target:MobileGridRowRenderer)
+    {
+        _target = target;
+    }
 
-    public function ListMultiPartColumnLayout(target:ListMultiPartItemRendererBase)
+    private var _target:MobileGridRowRenderer;
+
+    public function get target():MobileGridRowRenderer
     {
-        super(target);
+        return _target;
     }
 
-    override public function measure():void
+    protected function get partRendererDescriptors():Vector.<MobileGridColumn>
     {
-        super.measure();
-        var totalWidth:Number = 0;
-        for each (var ld:PartRendererDescriptorBase in partRendererDescriptors)
-        {
-            totalWidth += ld.dpiScaledWidth;
-        }
-        target.measuredWidth = totalWidth;
-        target.measuredMinWidth = 50;
+        return target.columns;
+    }
+
+    protected function get graphicElementPartRenderers():Vector.<IGraphicElement>
+    {
+        return target.graphicElementPartRenderers;
+    }
+
+    protected function get partRenderers():Vector.<IItemPartRendererBase>
+    {
+        return target.partRenderers;
+    }
+
+    public function measure():void
+    {
+
     }
 
+
     /* vertical align middle
      * Layout algorithm:   give all columns the requested sizes, and the last column the remaining width  */
-    override public function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
+
+    public function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
     {
 
         if (unscaledWidth == 0 && unscaledHeight == 0)
@@ -62,9 +81,8 @@ public class ListMultiPartColumnLayout extends ListMultiPartLayoutBase
         var paddingBottom:Number = target.getStyle("paddingBottom");
         var cellHeight:Number = unscaledHeight - paddingTop - paddingBottom;
 
-        var desc:PartRendererDescriptorBase;
+        var desc:MobileGridColumn;
         var dpr:IItemPartRendererBase;
-        var remainingWidth:Number = unscaledWidth;
         var curX:Number = cellPaddingLeft;
         var curY:Number = paddingTop;
         var colWidth:Number;
@@ -75,23 +93,98 @@ public class ListMultiPartColumnLayout extends ListMultiPartLayoutBase
         {
             dpr = partRenderers[i];
             desc = partRendererDescriptors[i];
-            colWidth = desc.dpiScaledWidth;
-            if (dpr.canSetWidth)
+            colWidth = desc.actualWidth;
+            if (dpr.canSetContentWidth)
             {
                 // expand last column to fill width, unless it has explicity width
-                partWidth = Math.max(0, ( i == count && !desc.hasExplicitWidth) ? remainingWidth : colWidth - cellPaddingLeft - cellPaddingRight);
+                partWidth = Math.max(0, colWidth - cellPaddingLeft - cellPaddingRight);
             }
             else
             {
                 partWidth = dpr.getPreferredBoundsHeight();
             }
-            partHeight = dpr.canSetHeight ? cellHeight : dpr.getPreferredBoundsHeight();
-            ;
+            partHeight = dpr.canSetContentHeight ? cellHeight : dpr.getPreferredBoundsHeight();
             setElementSize(dpr, partWidth, partHeight);
             setElementPosition(dpr, curX, curY + UIComponentUtils.offsetForCenter(partHeight, cellHeight));
             curX += colWidth;
-            remainingWidth -= colWidth;
         }
     }
+
+
+    /* layout helper  methods */
+
+    protected function setElementPosition(element:Object, x:Number, y:Number):void
+    {
+        if (element is ILayoutElement)
+        {
+            ILayoutElement(element).setLayoutBoundsPosition(x, y, false);
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            IFlexDisplayObject(element).move(x, y);
+        }
+        else
+        {
+            element.x = x;
+            element.y = y;
+        }
+    }
+
+    protected function setElementSize(element:Object, width:Number, height:Number):void
+    {
+        if (element is ILayoutElement)
+        {
+            ILayoutElement(element).setLayoutBoundsSize(width, height, false);
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            IFlexDisplayObject(element).setActualSize(width, height);
+        }
+        else
+        {
+            element.width = width;
+            element.height = height;
+        }
+    }
+
+    protected function getElementPreferredWidth(element:Object):Number
+    {
+        var result:Number;
+
+        if (element is ILayoutElement)
+        {
+            result = ILayoutElement(element).getPreferredBoundsWidth();
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            result = IFlexDisplayObject(element).measuredWidth;
+        }
+        else
+        {
+            result = element.width;
+        }
+
+        return Math.round(result);
+    }
+
+    protected function getElementPreferredHeight(element:Object):Number
+    {
+        var result:Number;
+
+        if (element is ILayoutElement)
+        {
+            result = ILayoutElement(element).getPreferredBoundsHeight();
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            result = IFlexDisplayObject(element).measuredHeight;
+        }
+        else
+        {
+            result = element.height;
+        }
+
+        return Math.ceil(result);
+    }
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
deleted file mode 100644
index 8f07d5c..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartItemRendererBase.as
+++ /dev/null
@@ -1,267 +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 spark.components.supportClasses
-{
-import flash.display.DisplayObject;
-
-import spark.components.itemRenderers.IItemPartRendererBase;
-import spark.core.DisplayObjectSharingMode;
-import spark.core.IGraphicElement;
-import spark.core.IGraphicElementContainer;
-import spark.core.ISharedDisplayObject;
-
-/**  @private
- *  This is the base class for multi-part renderers that manages a vector of part renderers.
- *  This class is responsible for creating and storing  the actual renderers from their descriptors
- *  the layout of the part renderers is delegated to a subclass of ListMultiPartLayoutBase;
- */
-public class ListMultiPartItemRendererBase extends ItemRendererBase implements IGraphicElementContainer, ISharedDisplayObject
-{
-    private var _partRendererDescriptors:Vector.<PartRendererDescriptorBase>;
-    private var _partRenderers:Vector.<IItemPartRendererBase>;
-    private var _graphicElementPartRenderers:Vector.<IGraphicElement>;
-    private var _partRenderersLayout:ListMultiPartLayoutBase;
-
-    /**
-     * Management of graphicElement part renderers  lifeCycle
-     */
-    private var _redrawRequested:Boolean = false;
-    private var graphicElementsNeedValidateProperties:Boolean = false;
-    private var graphicElementsNeedValidateSize:Boolean = false;
-
-    public function ListMultiPartItemRendererBase()
-    {
-    }
-
-    /** @private
-     * set in List itemRenderer Factory properties */
-    public function set partRendererDescriptors(value:Vector.<PartRendererDescriptorBase>):void
-    {
-        _partRendererDescriptors = value;
-        _partRenderers = new Vector.<IItemPartRendererBase>(_partRendererDescriptors.length, true);
-        _graphicElementPartRenderers = new Vector.<IGraphicElement>();
-    }
-
-    public function get partRendererDescriptors():Vector.<PartRendererDescriptorBase>
-    {
-        return _partRendererDescriptors;
-    }
-
-    public function get partRenderersLayout():ListMultiPartLayoutBase
-    {
-        return _partRenderersLayout;
-    }
-
-    public function set partRenderersLayout(value:ListMultiPartLayoutBase):void
-    {
-        _partRenderersLayout = value;
-    }
-
-    public function get partRenderers():Vector.<IItemPartRendererBase>
-    {
-        return _partRenderers;
-    }
-
-    public function get graphicElementPartRenderers():Vector.<IGraphicElement>
-    {
-        return _graphicElementPartRenderers;
-    }
-
-    override protected function createChildren():void
-    {
-        super.createChildren();
-        var desc:PartRendererDescriptorBase;
-        var pr:IItemPartRendererBase;
-        var ge:IGraphicElement;
-        for (var i:int = 0; i < _partRendererDescriptors.length; i++)
-        {
-            desc = _partRendererDescriptors[i];
-            pr = desc.createPartRenderer();
-            if (pr != null)
-            {
-                pr.styleProvider = this;
-
-                if (pr is IGraphicElement)
-                {
-                    ge = IGraphicElement(pr);
-                    ge.parentChanged(this);
-                    if (ge.setSharedDisplayObject(this))
-                    {
-                        ge.displayObjectSharingMode = DisplayObjectSharingMode.USES_SHARED_OBJECT;
-                    }
-                    _graphicElementPartRenderers.push(ge);
-                }
-                else if (pr is DisplayObject)
-                {
-                    addChild(DisplayObject(pr));
-                }
-                _partRenderers[i] = pr;
-            }
-            else
-            {
-                //TODO move to resource bundle
-                throw  new Error("MobileGridColumn item renderer must implement spark.components.itemRenderers.IItemPartRendererBase");
-            }
-        }
-    }
-
-    override protected function measure():void
-    {
-        super.measure();
-        _partRenderersLayout.measure();
-    }
-
-    /** delegate children layout to its partRendererLayout
-     subclasses can override this method to layout chrome content
-     */
-    override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-        _partRenderersLayout.layoutContents(unscaledWidth, unscaledHeight);
-    }
-
-    override protected function onDataChanged():void
-    {
-        var dpr:IItemPartRendererBase;
-        for (var i:int = 0; i < _partRenderers.length; i++)
-        {
-            dpr = _partRenderers[i];
-            dpr.data = data;
-        }
-        invalidateSize();
-    }
-
-    /*  graphic element sub renderers lifecycle management */
-
-    override protected function commitProperties():void
-    {
-        if (graphicElementsNeedValidateProperties)
-        {
-            graphicElementsNeedValidateProperties = false;
-            for (var i:int = 0; i < _graphicElementPartRenderers.length; i++)
-            {
-                _graphicElementPartRenderers[i].validateProperties();
-            }
-        }
-        super.commitProperties();
-    }
-
-
-    override public function validateSize(recursive:Boolean = false):void
-    {
-        if (graphicElementsNeedValidateSize)
-        {
-            graphicElementsNeedValidateSize = false;
-            for (var i:int = 0; i < _graphicElementPartRenderers.length; i++)
-            {
-                _graphicElementPartRenderers[i].validateSize();
-            }
-        }
-        super.validateSize(recursive);
-    }
-
-
-    /* copied from Group*/
-    override public function validateDisplayList():void
-    {
-        super.validateDisplayList();
-        if (_redrawRequested)
-        {
-            for (var i:int = 0; i < _graphicElementPartRenderers.length; i++)
-            {
-                _graphicElementPartRenderers[i].validateDisplayList();
-            }
-        }
-    }
-
-    /* interfaces implementation, copied from spark.components.IconItemRender  */
-
-    /**
-     *  @inheritDoc
-     *
-     *  <p>We implement this as part of ISharedDisplayObject so the iconDisplay
-     *  can share our display object.</p>
-     *
-     *  @langversion 3.0
-     *  @playerversion AIR 1.5
-     *  @productversion Flex 4
-     */
-    public function get redrawRequested():Boolean
-    {
-        return _redrawRequested;
-    }
-
-    /**
-     *  @private
-     */
-    public function set redrawRequested(value:Boolean):void
-    {
-        _redrawRequested = value;
-    }
-
-    //--------------------------------------------------------------------------
-    //
-    //  IGraphicElementContainer
-    //
-    // -------------------------------------------------------------------------
-
-    /**
-     * @private
-     *
-     *  Notify the host component that an element changed and needs to validate properties.
-     */
-    public function invalidateGraphicElementSharing(element:IGraphicElement):void
-    {
-        //do nothing because all has been done in createChildren and won't change
-    }
-
-    /**
-     * @private
-     *
-     *  Notify the host component that an element changed and needs to validate properties.
-     */
-    public function invalidateGraphicElementProperties(element:IGraphicElement):void
-    {
-        graphicElementsNeedValidateProperties = true;
-        invalidateProperties();
-    }
-
-    /**
-     * @private
-     */
-    public function invalidateGraphicElementSize(element:IGraphicElement):void
-    {
-        graphicElementsNeedValidateSize = true;
-        invalidateSize();
-    }
-
-    /**
-     * @private
-     *
-     */
-    public function invalidateGraphicElementDisplayList(element:IGraphicElement):void
-    {
-        if (element.displayObject is ISharedDisplayObject)
-            ISharedDisplayObject(element.displayObject).redrawRequested = true;
-        invalidateDisplayList();
-    }
-
-
-}
-
-}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
deleted file mode 100644
index 21593b1..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/ListMultiPartLayoutBase.as
+++ /dev/null
@@ -1,148 +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 spark.components.supportClasses
-{
-import mx.core.IFlexDisplayObject;
-import mx.core.ILayoutElement;
-
-import spark.components.itemRenderers.IItemPartRendererBase;
-import spark.core.IGraphicElement;
-
-/** @private
- *   Abstract base class for laying out part renderers in a multi-part renderer.
- *   Subclasses must override measure() and layoutContents() methods
- */
-public class ListMultiPartLayoutBase extends Object
-{
-    private var _target:ListMultiPartItemRendererBase;
-
-    public function ListMultiPartLayoutBase(target:ListMultiPartItemRendererBase)
-    {
-        _target = target;
-    }
-
-    public function get target():ListMultiPartItemRendererBase
-    {
-        return _target;
-    }
-
-    protected function get partRendererDescriptors():Vector.<PartRendererDescriptorBase>
-    {
-        return target.partRendererDescriptors;
-    }
-
-    protected function get graphicElementPartRenderers():Vector.<IGraphicElement>
-    {
-        return target.graphicElementPartRenderers;
-    }
-
-
-    protected function get partRenderers():Vector.<IItemPartRendererBase>
-    {
-        return target.partRenderers;
-    }
-
-    public function measure():void
-    {
-
-    }
-
-    /* vertical align middle
-     * give all columns the requested sizes, and the last column the remaining width  */
-    public function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
-    {
-
-    }
-
-    protected function setElementPosition(element:Object, x:Number, y:Number):void
-    {
-        if (element is ILayoutElement)
-        {
-            ILayoutElement(element).setLayoutBoundsPosition(x, y, false);
-        }
-        else if (element is IFlexDisplayObject)
-        {
-            IFlexDisplayObject(element).move(x, y);
-        }
-        else
-        {
-            element.x = x;
-            element.y = y;
-        }
-    }
-
-    protected function setElementSize(element:Object, width:Number, height:Number):void
-    {
-        if (element is ILayoutElement)
-        {
-            ILayoutElement(element).setLayoutBoundsSize(width, height, false);
-        }
-        else if (element is IFlexDisplayObject)
-        {
-            IFlexDisplayObject(element).setActualSize(width, height);
-        }
-        else
-        {
-            element.width = width;
-            element.height = height;
-        }
-    }
-
-    protected function getElementPreferredWidth(element:Object):Number
-    {
-        var result:Number;
-
-        if (element is ILayoutElement)
-        {
-            result = ILayoutElement(element).getPreferredBoundsWidth();
-        }
-        else if (element is IFlexDisplayObject)
-        {
-            result = IFlexDisplayObject(element).measuredWidth;
-        }
-        else
-        {
-            result = element.width;
-        }
-
-        return Math.round(result);
-    }
-
-    protected function getElementPreferredHeight(element:Object):Number
-    {
-        var result:Number;
-
-        if (element is ILayoutElement)
-        {
-            result = ILayoutElement(element).getPreferredBoundsHeight();
-        }
-        else if (element is IFlexDisplayObject)
-        {
-            result = IFlexDisplayObject(element).measuredHeight;
-        }
-        else
-        {
-            result = element.height;
-        }
-
-        return Math.ceil(result);
-    }
-
-}
-}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
index 9c49428..b7508f1 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
@@ -19,11 +19,18 @@
 package spark.components.supportClasses
 {
 
+import flash.events.EventDispatcher;
 import flash.events.IEventDispatcher;
 
+import mx.core.ClassFactory;
+import mx.core.IFactory;
+import mx.core.mx_internal;
 import mx.utils.ObjectUtil;
 
 import spark.collections.SortField;
+import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.components.itemRenderers.IItemTextPartRenderer;
+import spark.components.itemRenderers.ItemTextPartRenderer;
 
 /**
  *  The MobileGridColumn class defines  a column to display in a MobileGrid control.
@@ -36,28 +43,201 @@ import spark.collections.SortField;
  *  </ul>
  *
  *  @see spark.components.MobileGrid
- *  @see spark.components.supportClasses.PartRendererDescriptorBase
  *
  *  @langversion 3.0
  *  @playerversion AIR 3.8
  *  @productversion Flex 4.11
  */
-public class MobileGridColumn extends PartRendererDescriptorBase
-{
-
-    private var _headerText:String = null;
-    private var _headerStyleName:String;
-    private var _sortDescending:Boolean;
-    private var _sortable:Boolean = true;
+public class MobileGridColumn extends EventDispatcher
 
+{
     public function MobileGridColumn(target:IEventDispatcher = null)
     {
         super(target);
+        _labelFunction = null;
+        itemRenderer = null; // will set default ;
         labelFunction = null;
-        setWidth(100); // default width;
         itemRenderer = null; // will set default ;
     }
 
+    private var _dataField:String;
+
+    /**
+     *  The name of the field or property in the data provider item associated
+     *  with the column.
+     *  Each GridColumn requires this property or
+     *  the <code>labelFunction</code> property to be set
+     *  to calculate the displayable text for the item renderer.
+     *  If the <code>dataField</code>
+     *  and <code>labelFunction</code> properties are set,
+     *  the data is displayed using the <code>labelFunction</code> and sorted
+     *  using the <code>dataField</code>.
+
+     *  <p>If the column or its grid specifies a <code>labelFunction</code>,
+     *  then the dataField is not used.</p>
+     *
+     *  @default null
+     *
+     *  @see #labelFunction
+     *
+     */
+    public function get dataField():String
+    {
+        return _dataField;
+    }
+
+    public function set dataField(value:String):void
+    {
+        _dataField = value;
+    }
+
+    /* internal vars */
+
+    private var _width:Number = NaN;
+
+
+    /** Set the desired width for this column.
+     * <p> Width value is expressed in current applicationDPI, or at 160 DPI  if applicationDPI is not set.
+     * The default value is 100.
+     *
+     *  <p>Note: You can specify a percentage value in the MXML
+     *  <code>width</code> attribute, such as <code>width="50%"</code>,
+     *  but you cannot use a percentage value in the <code>width</code>
+     *  property in ActionScript.
+     *  Use the <code>percentWidth</code> property instead.</p>
+     *
+     *  @see #percentWidth
+     *
+     * @default 100
+     */
+    public function get width():Number
+    {
+        return _width;
+    }
+
+    [PercentProxy("percentWidth")]
+    public function set width(value:Number):void
+    {
+        _width = value;
+    }
+
+    private var _percentWidth:Number = NaN;
+
+    /**
+     *  Specifies the width of this column as a percentage of the grid's width. Allowed values are 0-100. The default value is NaN.
+     *  If set, this property has precedence over the fixed width property.
+     *
+     *  <p> MobileGrid will compute the column widths as follows:
+     *  <ul>
+     *      <li> First, honor all columns with fixed widths.  Columns with no width or percentWidth receive a width of 100.</li>
+     *      <li> Then distribute the remainder of width between all the columns with percentage widths.
+     *      If the total of percentages is greater that 100%, it's will be normalized first..</li>
+     *   <ul>
+     *  </p>
+     *
+     * @default NaN
+     */
+    public function get percentWidth():Number
+    {
+        return _percentWidth;
+    }
+
+    public function set percentWidth(value:Number):void
+    {
+        _percentWidth = value;
+    }
+
+    private var _itemRenderer:IFactory;
+
+    /**
+     *  The class factory for the IItemPartRendererBase  class used to
+     *  render individual grid cells.
+     *
+     *  <p>The default item renderer is the ItemTextPartRenderer class,
+     *  which displays the data item as text, optimized for mobile.  </p>
+     *  <p>You can use also ItemBitmapPartRenderer to display embedded bitmaps, in which case you need to define the iconField or iconFunction </p>
+     *  <p>You can also  create custom item renderers by deriving any subclass of UIComponent (eg. s:Button) and implementing IItemPartRendererBase.
+     *  for performance reasons  it's preferable that your renderer be written in ActionScript
+     *
+     *  @see #dataField
+     *  @see spark.components.itemRenderers.ItemTextPartRenderer
+     *  @see spark.components.itemRenderers.ItemBitmapPartRenderer
+     *  @see spark.components.itemRenderers.IItemPartRendererBase
+     *
+     */
+    public function get itemRenderer():IFactory
+    {
+        return _itemRenderer;
+    }
+
+    public function set itemRenderer(value:IFactory):void
+    {
+        _itemRenderer = value ? value : new ClassFactory(ItemTextPartRenderer);
+    }
+
+    private var _labelFunction:Function;
+
+
+    /**
+     *  An idempotent function that converts a data provider item into a column-specific string
+     *  that's used to initialize the item renderer's <code>label</code> property.
+     *
+     *  <p>You can use a label function to combine the values of several data provider items
+     *  into a single string.
+     *  If specified, this property is used by the
+     *  <code>itemToLabel()</code> method, which computes the value of each item
+     *  renderer's <code>label</code> property in this column.</p>
+     *
+     *  <p>The function specified to the <code>labelFunction</code> property
+     *  must have the following signature:</p>
+     *
+     *  <pre>labelFunction(item:Object):String</pre>
+     *
+     *  <p>The <code>item</code> parameter is the data provider item for an entire row.
+     *  The second parameter is this column object.</p>
+     *
+     *  <p>A typical label function could concatenate the firstName and
+     *  lastName properties of the data provider item ,
+     *  or do some custom formatting on a Date value property.</p>
+     */
+    public function set labelFunction(value:Function):void
+    {
+        _labelFunction = value;
+    }
+
+    public function get labelFunction():Function
+    {
+        return _labelFunction;
+    }
+
+    private var _styleName:String;
+
+    /** The css style name to apply to the renderer
+     *  the style items in the css will depend on the renderer. For example, text renderers will accept fontSize, color, fontWeight, etc.
+     */
+    public function get styleName():String
+    {
+        return _styleName;
+    }
+
+    public function set styleName(value:String):void
+    {
+        _styleName = value;
+    }
+
+    /** Sets the alignment of text renderers.
+     * This property is ignored for non-text renderers.
+     */
+    [Inspectable(enumeration="left,right,center,justify")]
+    public function set textAlign(value:String):void
+    {
+        _textAlign = value;
+    }
+
+    private var _textAlign:String;
+
+    private var _headerText:String = null;
+
     /** Defines the text to be displayed in the column's header.
      * <p>If this property is not set, the header label will use the value  of dataField property instead.</p>
      * @see #dataField
@@ -72,6 +252,8 @@ public class MobileGridColumn extends PartRendererDescriptorBase
         _headerText = value;
     }
 
+    private var _headerStyleName:String;
+
     /** Defines the css style name to be used for displaying this column's header label.
      * <p>Use this property to display the header in a different color or font, or with a different text alignment.</p>
      */
@@ -85,6 +267,20 @@ public class MobileGridColumn extends PartRendererDescriptorBase
         _headerStyleName = value;
     }
 
+    private var _sortDescending:Boolean;
+
+    public function get sortDescending():Boolean
+    {
+        return _sortDescending;
+    }
+
+    public function set sortDescending(value:Boolean):void
+    {
+        _sortDescending = value;
+    }
+
+    private var _sortable:Boolean = true;
+
     /** Flag indicating whether a column can be sorted by clicking on its header.
      *  <p>This flag is effective only if the MobileGrid </p>
      */
@@ -98,20 +294,6 @@ public class MobileGridColumn extends PartRendererDescriptorBase
         _sortable = value;
     }
 
-    public function get sortDescending():Boolean
-    {
-        return _sortDescending;
-    }
-
-    public function set sortDescending(value:Boolean):void
-    {
-        _sortDescending = value;
-    }
-
-    //----------------------------------
-    //  sortField
-    //----------------------------------
-
     /**
      *  Returns a SortField that can be used to sort a collection by this
      *  column's <code>dataField</code>.
@@ -143,6 +325,27 @@ public class MobileGridColumn extends PartRendererDescriptorBase
         return sortField;
     }
 
+    public function createPartRenderer():IItemPartRendererBase
+    {
+        var pr:IItemPartRendererBase = _itemRenderer.newInstance() as IItemPartRendererBase;
+        if (pr)
+        {
+            pr.cssStyleName = _styleName;
+            if (pr is IItemTextPartRenderer)
+            {
+                with (IItemTextPartRenderer(pr))
+                {
+                    labelField = _dataField;
+                    labelFunction = _labelFunction;
+                    textAlign = _textAlign;
+                }
+            }
+        }
+        return pr;
+    }
+
+    mx_internal var colNum:int;
+    mx_internal var actualWidth:Number;
 
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
index f92075b..7ef2232 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
@@ -20,6 +20,7 @@ package spark.components.supportClasses
 {
 
 import mx.collections.ArrayList;
+import mx.core.IVisualElement;
 import mx.core.UIComponent;
 import mx.core.mx_internal;
 
@@ -27,7 +28,6 @@ import spark.components.ButtonBar;
 import spark.components.MobileGrid;
 import spark.events.IndexChangeEvent;
 import spark.events.MobileGridHeaderEvent;
-import spark.events.RendererExistenceEvent;
 import spark.utils.MultiDPIBitmapSource;
 
 use namespace  mx_internal;
@@ -71,8 +71,6 @@ public class MobileGridHeader extends ButtonBar
         this.buttonMode = false;
         this.requireSelection = false;
         addEventListener(IndexChangeEvent.CHANGING, changingHandler);
-        addEventListener(RendererExistenceEvent.RENDERER_ADD, rendererAddHandler);
-
         descIconCls = new MultiDPIBitmapSource();
         descIconCls.source160dpi = descIcon160Cls;
         descIconCls.source320dpi = descIcon320Cls;
@@ -125,17 +123,6 @@ public class MobileGridHeader extends ButtonBar
             dataProvider.itemUpdated(_columns[_sortIndex]);
     }
 
-    private function rendererAddHandler(event:RendererExistenceEvent):void
-    {
-        var button:UIComponent = UIComponent(event.renderer);
-        var index:int = event.index;
-        var col:MobileGridColumn = MobileGridColumn(_columns[index]);
-        // expand the last button
-        if ((index != dataProvider.length - 1) || col.hasExplicitWidth)
-            button.explicitWidth = col.dpiScaledWidth;
-        else
-            button.percentWidth = 100;
-    }
 
     private function getIconForButton(col:MobileGridColumn):Object
     {
@@ -148,5 +135,29 @@ public class MobileGridHeader extends ButtonBar
             return null;
         }
     }
+
+    /**
+     *  @private
+     *  Return the item renderer at the specified index, or null.
+     */
+    private function getItemRenderer(index:int):IVisualElement
+    {
+        if (!dataGroup || (index < 0) || (index >= dataGroup.numElements))
+            return null;
+
+        return dataGroup.getElementAt(index);
+    }
+
+    public function updateHeaderWidths():void
+    {
+        if (dataProvider.length != _columns.length)
+            return; // not ready
+        var header:UIComponent;
+        for (var i:int = 0; i < _columns.length; i++)
+        {
+            header = UIComponent(this.getItemRenderer(i));
+            header.explicitWidth = _columns[i].actualWidth;
+        }
+    }
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
index b2a8d3e..c3a1446 100644
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
@@ -18,16 +18,246 @@
 ////////////////////////////////////////////////////////////////////////////////
 package spark.components.supportClasses
 {
+import flash.display.DisplayObject;
+
+import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.core.DisplayObjectSharingMode;
+import spark.core.IGraphicElement;
+import spark.core.IGraphicElementContainer;
+import spark.core.ISharedDisplayObject;
 
 /**  @private
+ *  This is the base class for multi-part renderers that manages a vector of part renderers.
+ *  This class is responsible for creating and storing  the actual renderers from their descriptors
+ *  the layout of the part renderers is delegated to a subclass of ListMultiPartLayoutBase;
+
  *    This is the internal list itemRenderer used for rendering grid cells in a single row of a MobileGrid.
  *    It inherits all its behavior for its parent class and only sets the part renderers layout.
+ *
+ *   @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ *
  */
-public class MobileGridRowRenderer extends ListMultiPartItemRendererBase
+public class MobileGridRowRenderer extends ItemRendererBase implements IGraphicElementContainer, ISharedDisplayObject
 {
+    private var _columns:Vector.<MobileGridColumn>;
+    private var _partRenderers:Vector.<IItemPartRendererBase>;
+    private var _graphicElementPartRenderers:Vector.<IGraphicElement>;
+    private var _partRenderersLayout:ListMultiPartColumnLayout;
+
+    /**
+     * Management of graphicElement part renderers  lifeCycle
+     */
+    private var _redrawRequested:Boolean = false;
+    private var graphicElementsNeedValidateProperties:Boolean = false;
+    private var graphicElementsNeedValidateSize:Boolean = false;
+
     public function MobileGridRowRenderer()
     {
-        partRenderersLayout = new ListMultiPartColumnLayout(this);
+        _partRenderersLayout = new ListMultiPartColumnLayout(this);
+    }
+
+    /** @private
+     * set in List itemRenderer Factory properties */
+    public function set columns(value:Vector.<MobileGridColumn>):void
+    {
+        _columns = value;
+        _partRenderers = new Vector.<IItemPartRendererBase>(_columns.length, true);
+        _graphicElementPartRenderers = new Vector.<IGraphicElement>();
+    }
+
+    public function get columns():Vector.<MobileGridColumn>
+    {
+        return _columns;
+    }
+
+    public function get partRenderers():Vector.<IItemPartRendererBase>
+    {
+        return _partRenderers;
+    }
+
+    public function get graphicElementPartRenderers():Vector.<IGraphicElement>
+    {
+        return _graphicElementPartRenderers;
+    }
+
+    override protected function createChildren():void
+    {
+        super.createChildren();
+        var desc:MobileGridColumn;
+        var pr:IItemPartRendererBase;
+        var ge:IGraphicElement;
+        for (var i:int = 0; i < _columns.length; i++)
+        {
+            desc = _columns[i];
+            pr = desc.createPartRenderer();
+            if (pr != null)
+            {
+                pr.styleProvider = this;
+
+                if (pr is IGraphicElement)
+                {
+                    ge = IGraphicElement(pr);
+                    ge.parentChanged(this);
+                    if (ge.setSharedDisplayObject(this))
+                    {
+                        ge.displayObjectSharingMode = DisplayObjectSharingMode.USES_SHARED_OBJECT;
+                    }
+                    _graphicElementPartRenderers.push(ge);
+                }
+                else if (pr is DisplayObject)
+                {
+                    addChild(DisplayObject(pr));
+                }
+                _partRenderers[i] = pr;
+            }
+            else
+            {
+                //TODO move to resource bundle
+                throw  new Error("MobileGridColumn item renderer must implement spark.components.itemRenderers.IItemPartRendererBase");
+            }
+        }
+    }
+
+    override protected function measure():void
+    {
+        super.measure();
+        _partRenderersLayout.measure();
+    }
+
+    /** delegate children layout to its partRendererLayout
+     subclasses can override this method to layout chrome content
+     */
+    override protected function layoutContents(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        _partRenderersLayout.layoutContents(unscaledWidth, unscaledHeight);
+    }
+
+    override protected function onDataChanged():void
+    {
+        var dpr:IItemPartRendererBase;
+        for (var i:int = 0; i < _partRenderers.length; i++)
+        {
+            dpr = _partRenderers[i];
+            dpr.data = data;
+        }
+        invalidateSize();
+    }
+
+    /*  graphic element sub renderers lifecycle management */
+
+    override protected function commitProperties():void
+    {
+        if (graphicElementsNeedValidateProperties)
+        {
+            graphicElementsNeedValidateProperties = false;
+            for (var i:int = 0; i < _graphicElementPartRenderers.length; i++)
+            {
+                _graphicElementPartRenderers[i].validateProperties();
+            }
+        }
+        super.commitProperties();
+    }
+
+
+    override public function validateSize(recursive:Boolean = false):void
+    {
+        if (graphicElementsNeedValidateSize)
+        {
+            graphicElementsNeedValidateSize = false;
+            for (var i:int = 0; i < _graphicElementPartRenderers.length; i++)
+            {
+                _graphicElementPartRenderers[i].validateSize();
+            }
+        }
+        super.validateSize(recursive);
+    }
+
+
+    /* copied from Group*/
+    override public function validateDisplayList():void
+    {
+        super.validateDisplayList();
+        if (_redrawRequested)
+        {
+            for (var i:int = 0; i < _graphicElementPartRenderers.length; i++)
+            {
+                _graphicElementPartRenderers[i].validateDisplayList();
+            }
+        }
+    }
+
+    /* interfaces implementation, copied from spark.components.IconItemRender  */
+
+    /**
+     *  @inheritDoc
+     *
+     *  <p>We implement this as part of ISharedDisplayObject so the iconDisplay
+     *  can share our display object.</p>
+     *
+     *  @langversion 3.0
+     *  @playerversion AIR 1.5
+     *  @productversion Flex 4
+     */
+    public function get redrawRequested():Boolean
+    {
+        return _redrawRequested;
+    }
+
+    /**
+     *  @private
+     */
+    public function set redrawRequested(value:Boolean):void
+    {
+        _redrawRequested = value;
+    }
+
+    //--------------------------------------------------------------------------
+    //
+    //  IGraphicElementContainer
+    //
+    // -------------------------------------------------------------------------
+
+    /**
+     * @private
+     *
+     *  Notify the host component that an element changed and needs to validate properties.
+     */
+    public function invalidateGraphicElementSharing(element:IGraphicElement):void
+    {
+        //do nothing because all has been done in createChildren and won't change
+    }
+
+    /**
+     * @private
+     *
+     *  Notify the host component that an element changed and needs to validate properties.
+     */
+    public function invalidateGraphicElementProperties(element:IGraphicElement):void
+    {
+        graphicElementsNeedValidateProperties = true;
+        invalidateProperties();
+    }
+
+    /**
+     * @private
+     */
+    public function invalidateGraphicElementSize(element:IGraphicElement):void
+    {
+        graphicElementsNeedValidateSize = true;
+        invalidateSize();
+    }
+
+    /**
+     * @private
+     *
+     */
+    public function invalidateGraphicElementDisplayList(element:IGraphicElement):void
+    {
+        if (element.displayObject is ISharedDisplayObject)
+            ISharedDisplayObject(element.displayObject).redrawRequested = true;
+        invalidateDisplayList();
     }
 
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
deleted file mode 100644
index 23ce03e..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
+++ /dev/null
@@ -1,189 +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 spark.components.supportClasses
-{
-import flash.events.EventDispatcher;
-import flash.events.IEventDispatcher;
-
-import mx.core.ClassFactory;
-import mx.core.DPIClassification;
-import mx.core.IFactory;
-import mx.core.mx_internal;
-
-import spark.components.itemRenderers.IItemPartRendererBase;
-import spark.components.itemRenderers.IItemTextPartRenderer;
-import spark.components.itemRenderers.ItemTextPartRenderer;
-import spark.utils.DensityUtil2;
-
-/**  This is the base class for GridColumn
- *
- */
-public class PartRendererDescriptorBase extends EventDispatcher
-{
-
-    private var _colNum:int;
-    private var _dataField:String;
-    private var _width:Number;
-    private var _hasExplicitWidth:Boolean;
-    private var _dpiScaledWidth:Number;
-    private var _itemRenderer:IFactory;
-    private var _labelFunction:Function;
-    private var _styleName:String;
-    private var _textAlign:String;
-
-
-    public function PartRendererDescriptorBase(target:IEventDispatcher = null)
-    {
-        super(target);
-        _labelFunction = null;
-        setWidth(100); // default width;
-        itemRenderer = null; // will set default ;
-    }
-
-    /* IDataGridColumn impl*/
-
-    public function set dataField(value:String):void
-    {
-        _dataField = value;
-    }
-
-    public function get dataField():String
-    {
-        return _dataField;
-    }
-
-    public function get labelFunction():Function
-    {
-        return _labelFunction;
-    }
-
-    /**
-     *  An idempotent function that converts a data provider item into a column-specific string
-     *  that's used to initialize the item renderer's <code>label</code> property.
-     *
-     *  <p>You can use a label function to combine the values of several data provider items
-     *  into a single string.
-     *  If specified, this property is used by the
-     *  <code>itemToLabel()</code> method, which computes the value of each item
-     *  renderer's <code>label</code> property in this column.</p>
-     *
-     *  <p>The function specified to the <code>labelFunction</code> property
-     *  must have the following signature:</p>
-     *
-     *  <pre>labelFunction(item:Object):String</pre>
-     *
-     *  <p>The <code>item</code> parameter is the data provider item for an entire row.
-     *  The second parameter is this column object.</p>
-     *
-     *  <p>A typical label function could concatenate the firstName and
-     *  lastName properties of the data provider item ,
-     *  or do some custom formatting on a Date value property.</p>
-     */
-    public function set labelFunction(value:Function):void
-    {
-        _labelFunction = value;
-    }
-
-    public function set styleName(value:String):void
-    {
-        _styleName = value;
-    }
-
-    /** Set the desired width for this column.
-     * <p> Width value is expressed in current applicationDPI, or at 160 DPI  if applicationDPI is not set.</p>
-     * Default value is 100.
-     * Note that the last column will always expand
-     *
-     * @param value = desired width of the column at 160 DPI
-     */
-    public function set width(value:Number):void
-    {
-        setWidth(value);
-        _hasExplicitWidth = true;
-    }
-
-    protected function setWidth(value:Number):void
-    {
-        _width = value;
-        _dpiScaledWidth = DensityUtil2.dpiScale(value, DPIClassification.DPI_160);
-    }
-
-
-    public function get itemRenderer():IFactory
-    {
-        return _itemRenderer;
-    }
-
-    public function set itemRenderer(value:IFactory):void
-    {
-        _itemRenderer = value ? value : new ClassFactory(ItemTextPartRenderer);
-    }
-
-    public function get styleName():String
-    {
-        return _styleName;
-    }
-
-    [Inspectable(enumeration="left,right,center,justify")]
-    public function set textAlign(value:String):void
-    {
-        _textAlign = value;
-    }
-
-    public function createPartRenderer():IItemPartRendererBase
-    {
-        var pr:IItemPartRendererBase = _itemRenderer.newInstance() as IItemPartRendererBase;
-        if (pr)
-        {
-            pr.cssStyleName = _styleName;
-            if (pr is IItemTextPartRenderer)
-            {
-                with (IItemTextPartRenderer(pr))
-                {
-                    labelField = _dataField;
-                    labelFunction = _labelFunction;
-                    textAlign = _textAlign;
-                }
-            }
-        }
-        return pr;
-    }
-
-    mx_internal function get hasExplicitWidth():Boolean
-    {
-        return _hasExplicitWidth;
-    }
-
-    mx_internal function get dpiScaledWidth():Number
-    {
-        return  _dpiScaledWidth;
-    }
-
-    mx_internal function get colNum():int
-    {
-        return _colNum;
-    }
-
-    mx_internal function set colNum(value:int):void
-    {
-        _colNum = value;
-    }
-
-}
-}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as b/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
index 31e1462..c660941 100644
--- a/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
+++ b/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
@@ -31,7 +31,7 @@ import flash.events.Event;
  *  @productversion Flex 4.11
  */
 
-//   Note: we didn't use neither mx:DataGridEven because it's in not available for mobile not GridSortEvent because it handles multiple sorting
+//   Note: we didn't use neither mx:DataGridEvent because it's in not available for mobile not GridSortEvent because it handles multiple sorting
 public class MobileGridHeaderEvent extends Event
 {
 

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/layouts/MobileGridLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/layouts/MobileGridLayout.as b/frameworks/projects/experimental_mobile/src/spark/layouts/MobileGridLayout.as
new file mode 100644
index 0000000..8149dfe
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/layouts/MobileGridLayout.as
@@ -0,0 +1,95 @@
+package spark.layouts
+{
+import mx.core.mx_internal;
+
+import spark.components.MobileGrid;
+import spark.components.supportClasses.MobileGridColumn;
+import spark.utils.DensityUtil2;
+
+use namespace  mx_internal;
+
+/**
+ * Internal class used for laying out rows, columns and headers of a MobileGrid component.
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ */
+public class MobileGridLayout extends VerticalLayout
+{
+    public function MobileGridLayout(grid:MobileGrid)
+    {
+        super();
+        _grid = grid;
+    }
+
+    private var prevUnscaledWidth:Number;
+    private var _grid:MobileGrid;
+
+    override public function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+        if (prevUnscaledWidth != unscaledWidth)
+        {
+            prevUnscaledWidth = unscaledWidth;
+            updateColumnWidths(unscaledWidth);
+        }
+    }
+
+    /**   compute colum actual widths from colum width and percentWidth
+     *     simple algorithm is following:
+     *     first set all columns that have fixed width
+     *     set distribute the remainder between the percentages, normalized to 100%
+     *
+     * @param unscaledWidth
+     */
+    protected function updateColumnWidths(unscaledWidth:Number):void
+    {
+        if (unscaledWidth == 0)
+            return;   // not ready
+
+        var colWidth:Number;
+        var colActualWidth:Number;
+
+        var totalFixedWidths:Number = 0;
+        var totalPercentages:Number = 0;
+        var cols:Array = _grid.columns;
+        var col:MobileGridColumn;
+
+        for (var i:int = 0; i < cols.length; i++)
+        {
+            col = cols[i];
+            if (!isNaN(col.percentWidth))
+            {
+                totalPercentages += col.percentWidth;
+            }
+            else
+            {
+                colWidth = isNaN(col.width) ? 100 : col.width;
+                colActualWidth = DensityUtil2.dpiScale(colWidth);
+                col.actualWidth = colActualWidth; // can immediately set actual width
+                totalFixedWidths += colActualWidth;
+            }
+        }
+
+        // distribute remainder to percent widths
+        var remainingWidth:Number = Math.max(0, unscaledWidth - totalFixedWidths);
+        var normalPercentWidth:Number;
+        for (var j:int = 0; j < cols.length; j++)
+        {
+            col = cols[j];
+            if (!isNaN(col.percentWidth))
+            {
+                normalPercentWidth = col.percentWidth / totalPercentages;
+                /* 0 .. 1*/
+                col.actualWidth = remainingWidth * normalPercentWidth;
+            }
+        }
+
+        // update also datagrid header ;
+        _grid.headerGroup.updateHeaderWidths();
+
+    }
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as b/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
index 7f447ad..247c234 100644
--- a/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
@@ -19,11 +19,25 @@
 package spark.utils
 {
 
+import mx.core.DPIClassification;
 import mx.core.FlexGlobals;
 import mx.managers.SystemManager;
 
 import spark.components.Application;
 
+//TODO merge with spark.utils.DensityUtil
+
+/**
+ * @private
+ * Utility class for density computations
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+
+ */
+
+
 public class DensityUtil2
 {
 
@@ -37,7 +51,7 @@ public class DensityUtil2
      * @param sourceDPI
      * @return  scaled value
      */
-    public static function dpiScale(value:Number, sourceDPI:Number):Number
+    public static function dpiScale(value:Number, sourceDPI:Number = DPIClassification.DPI_160):Number
     {
         var appDPI:Number = getSetApplicationDPI();
         if (isNaN(appDPI))

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as b/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
index ce17ffe..0a01f34 100644
--- a/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
@@ -21,6 +21,12 @@ package spark.utils
 import mx.core.FlexGlobals;
 import mx.utils.DensityUtil;
 
+//TODO mamsellem move this code to parent class, updates any callers, and remove this class
+
+/**  @private
+ * Adds default behavior to its parent class MultiDPIBitmapSource.
+ *
+ */
 public class MultiDPIBitmapSourceExt extends MultiDPIBitmapSource
 {
 
@@ -38,9 +44,8 @@ public class MultiDPIBitmapSourceExt extends MultiDPIBitmapSource
      *  @return One of the sourceXXXdpi properties based on the desired DPI.
      *
      *  @langversion 3.0
-     *  @playerversion Flash 10.2
-     *  @playerversion AIR 2.6
-     *  @productversion Flex 4.5
+     *  @playerversion AIR 3.8
+     *  @productversion Flex 4.11
      */
 
     override public function getSource(desiredDPI:Number):Object
@@ -59,7 +64,6 @@ public class MultiDPIBitmapSourceExt extends MultiDPIBitmapSource
             return super.getSource(desiredDPI);
     }
 
-    //TODO mamsellem move this code to parent class, updates any callers, and remove this class
 
 }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/44826607/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as b/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
index 93f6f8e..737fa40 100644
--- a/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
@@ -16,15 +16,21 @@
 //  limitations under the License.
 //
 ////////////////////////////////////////////////////////////////////////////////
+
 package spark.utils
 {
 import mx.core.IFlexDisplayObject;
 import mx.core.ILayoutElement;
 
+/**  @private
+ * Utility class for MobileGrid
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ */
 public class UIComponentUtils
 {
 
-
     public static function itemToLabel(item:Object, labelField:String, labelFunction:Function, nullLabel:String = '-'):String
     {
         if (labelFunction != null)


[12/15] git commit: [flex-sdk] [refs/heads/develop] - https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile - clean up code to prepare integration with SDK (continued) renamed class DensityUtil2 to MobileGridUtil

Posted by ma...@apache.org.
https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile
- clean up code to prepare integration with SDK (continued)
renamed class DensityUtil2 to MobileGridUtil


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/4c4d2dc8
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/4c4d2dc8
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/4c4d2dc8

Branch: refs/heads/develop
Commit: 4c4d2dc8021d0b6db4ff55ea592886cb6b0bc913
Parents: 908829a
Author: mamsellem <ma...@systar.com>
Authored: Fri Oct 4 01:37:57 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Fri Oct 4 01:37:57 2013 +0200

----------------------------------------------------------------------
 .../src/spark/utils/DensityUtil2.as             | 80 --------------------
 1 file changed, 80 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/4c4d2dc8/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as b/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
deleted file mode 100644
index 247c234..0000000
--- a/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
+++ /dev/null
@@ -1,80 +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 spark.utils
-{
-
-import mx.core.DPIClassification;
-import mx.core.FlexGlobals;
-import mx.managers.SystemManager;
-
-import spark.components.Application;
-
-//TODO merge with spark.utils.DensityUtil
-
-/**
- * @private
- * Utility class for density computations
- *
- *  @langversion 3.0
- *  @playerversion AIR 3.8
- *  @productversion Flex 4.11
-
- */
-
-
-public class DensityUtil2
-{
-
-    private static var _setApplicationDPI:Number = 0;
-
-    /**  returns the actual  value for  a value authored for  <code>sourceDPI</code>, taking into account any dpi scaling.
-     *  <ul>
-     *      <li> If Application.applicationDPI has been set, which means dpi scaling factor is already applied, return the original value.</li>
-     *     <li> If Application.applicationDPI has not been set, then return scaled value runTimeDPI / sourceDPI   </li>
-     *  </li>
-     * @param sourceDPI
-     * @return  scaled value
-     */
-    public static function dpiScale(value:Number, sourceDPI:Number = DPIClassification.DPI_160):Number
-    {
-        var appDPI:Number = getSetApplicationDPI();
-        if (isNaN(appDPI))
-        {
-            var runDPI:Number = FlexGlobals.topLevelApplication.runtimeDPI;
-            return value * runDPI / sourceDPI;
-        }
-        else
-            return value; //  already scaled
-    }
-
-    /**
-     *  returns the applicationDPI that was explicitly set in top level application , or NaN if none */
-    private static function getSetApplicationDPI():Number
-    {
-        if (_setApplicationDPI == 0)
-        {
-            var application:Application = FlexGlobals.topLevelApplication as Application;
-            var sm:SystemManager = application ? application.systemManager as SystemManager : null;
-            _setApplicationDPI = sm ? sm.info()["applicationDPI"] : NaN;
-        }
-        return _setApplicationDPI;
-    }
-
-}
-}


[04/15] https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile - formatted sources code - added ASDOC (almost all) - bug: Bitmap renderer does not support MultiDPI when appDPI is set

Posted by ma...@apache.org.
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
new file mode 100644
index 0000000..a404bb2
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridColumn.as
@@ -0,0 +1,148 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.supportClasses
+{
+
+import flash.events.IEventDispatcher;
+
+import mx.utils.ObjectUtil;
+
+import spark.collections.SortField;
+
+/**
+ *  The MobileGridColumn class defines  a column to display in a MobileGrid control.
+ * <p> The MobileGridColumn class specifies the characteristics of the column to display,
+ * such as the field of the data provider item whose value is to be displayed in the column.
+ * MobileGridColumn takes most of its properties  from its parent class and adds the following Grid-specific options:</p>
+ * <ul>
+ *     <li>headerText and headerStyleName: optional label and style to display in the header for this column </li>
+ *     <li>sortable, sortDescending and sortField: sorting options for this column </li>
+ *  </ul>
+ *
+ *  @see spark.components.MobileGrid
+ *  @see spark.components.supportClasses.PartRendererDescriptorBase
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ */
+public class MobileGridColumn extends PartRendererDescriptorBase
+{
+
+    private var _headerText:String = null;
+    private var _headerStyleName:String;
+    private var _sortDescending:Boolean;
+    private var _sortable: Boolean = true;
+
+    public function MobileGridColumn(target:IEventDispatcher = null)
+    {
+        super(target);
+        labelFunction = null;
+        width = 100; // default width;
+        itemRenderer = null; // will set default ;
+    }
+
+    /** Defines the text to be displayed in the column's header.
+     * <p>If this property is not set, the header label will use the value  of dataField property instead.</p>
+     * @see #dataField
+     */
+    public function get headerText():String
+    {
+        return _headerText != null ? _headerText : dataField ;
+    }
+
+    public function set headerText(value:String):void
+    {
+        _headerText = value;
+    }
+
+    /** Defines the css style name to be used for displaying this column's header label.
+     * <p>Use this property to display the header in a different color or font, or with a different text alignment.</p>
+     */
+    public function get headerStyleName():String
+    {
+        return _headerStyleName;
+    }
+
+    public function set headerStyleName(value:String):void
+    {
+        _headerStyleName = value;
+    }
+
+    /** Flag indicating whether a column can be sorted by clicking on its header.
+     *  <p>This flag is effective only if the MobileGrid </p>
+     */
+    public function get sortable():Boolean
+    {
+        return _sortable;
+    }
+
+    public function set sortable(value:Boolean):void
+    {
+        _sortable = value;
+    }
+
+    public function get sortDescending():Boolean
+    {
+        return _sortDescending;
+    }
+
+    public function set sortDescending(value:Boolean):void
+    {
+        _sortDescending = value;
+    }
+
+    //----------------------------------
+    //  sortField
+    //----------------------------------
+
+    /**
+     *  Returns a SortField that can be used to sort a collection by this
+     *  column's <code>dataField</code>.
+     *
+     *
+     *  <p>If the <code>dataField</code> properties are not defined, but the
+     *  <code>labelFunction</code> property is defined, then it assigns the
+     *  <code>compareFunction</code> to a closure that does a basic string compare
+     *  on the <code>labelFunction</code> applied to the data objects.</p>
+
+     */
+    public function get sortField():SortField
+    {
+        const column:MobileGridColumn = this;
+
+        var sortField:SortField = new SortField(dataField);
+
+        var cF:Function = null;
+        if (dataField == null && labelFunction != null)
+        {
+            // use basic string compare on the labelFunction results
+            cF = function (a:Object, b:Object):int
+            {
+                return ObjectUtil.stringCompare(labelFunction(a), labelFunction(b));
+            };
+            sortField.compareFunction = cF;
+        }
+        sortField.descending = column.sortDescending;
+        return sortField;
+    }
+
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
new file mode 100644
index 0000000..1cdfbf6
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridHeader.as
@@ -0,0 +1,151 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.supportClasses
+{
+
+import mx.collections.ArrayList;
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+
+import spark.components.ButtonBar;
+import spark.components.MobileGrid;
+import spark.events.IndexChangeEvent;
+import spark.events.MobileGridHeaderEvent;
+import spark.events.RendererExistenceEvent;
+import spark.utils.MultiDPIBitmapSource;
+
+use namespace  mx_internal;
+
+[Event(name="sortChange", type="spark.events.MobileGridHeaderEvent")]
+
+/**  @private
+ *    internal class used by MobileGrid to manage and display  the grid's column headers.
+ *    It inherits from ButtonBar so that headers can display text and be clicked and forwards header clicks to the MobileGrid for managing sorting.
+ *    the default skin for this class is : spark.skins.MobileGridHeaderButtonBarSkin
+ *
+ *    @see spark.skins.MobileGridHeaderButtonBarSkin
+ */
+public class MobileGridHeader extends ButtonBar
+{
+
+    [Embed(source="../../../../assets/images/mobile320/dg_header_asc.png")]
+    private const ascIcon320Cls:Class;
+
+    [Embed(source="../../../../assets/images/mobile320/dg_header_desc.png")]
+    private const descIcon320Cls:Class;
+
+    [Embed(source="../../../../assets/images/mobile160/dg_header_asc.png")]
+    private const ascIcon160Cls:Class;
+
+    [Embed(source="../../../../assets/images/mobile160/dg_header_desc.png")]
+    private const descIcon160Cls:Class;
+
+    protected var descIconCls:MultiDPIBitmapSource;
+    protected var ascIconCls:MultiDPIBitmapSource;
+
+    private var _dataGrid:MobileGrid;
+    private var _columns: Array;
+    private var _sortIndex:int = -1;
+
+      public function MobileGridHeader()
+    {
+        this.labelField = "headerText";
+        this.iconFunction = getIconForButton;
+        this.setStyle("iconPlacement", "right");
+        this.buttonMode = false;
+        this.requireSelection = false;
+        addEventListener(IndexChangeEvent.CHANGING, changingHandler);
+        addEventListener(RendererExistenceEvent.RENDERER_ADD, rendererAddHandler);
+
+        descIconCls = new MultiDPIBitmapSource();
+        descIconCls.source160dpi = descIcon160Cls;
+        descIconCls.source320dpi = descIcon320Cls;
+        ascIconCls = new MultiDPIBitmapSource();
+        ascIconCls.source160dpi = ascIcon160Cls;
+        ascIconCls.source320dpi = ascIcon320Cls;
+    }
+
+    public function set columns(value:Array):void
+    {
+        _columns = value;
+        if (_columns)
+        {
+            dataProvider = new ArrayList(_columns);
+        }
+        else
+        {
+            dataProvider = null;
+        }
+    }
+
+    public function set dataGrid(value:MobileGrid):void
+    {
+        _dataGrid = value;
+    }
+
+    private function changingHandler(event:IndexChangeEvent):void
+    {
+        event.preventDefault();      // to clear selection
+        var i:int = event.newIndex;
+        var c: MobileGridColumn = _columns[i];
+        if (_dataGrid.sortableColumns && c.sortable)   {
+            var headerEvent:MobileGridHeaderEvent = new MobileGridHeaderEvent(MobileGridHeaderEvent.SORT_CHANGE, c.colNum, false, true);
+            // HEADER_RELEASE event is cancelable
+            dispatchEvent(headerEvent);
+        }
+    }
+
+    /* will be sent back by MobileGrid when sort is confirmed */
+    mx_internal function setSort(newSortIndex:int, desc:Boolean):void
+    {
+        var prevSortIndex:int = _sortIndex;
+        _sortIndex = newSortIndex;
+
+        // update old and new
+        if (prevSortIndex != -1)
+            dataProvider.itemUpdated(_columns[prevSortIndex]);
+        if (_sortIndex != -1)
+            dataProvider.itemUpdated(_columns[_sortIndex]);
+    }
+
+    private function rendererAddHandler(event:RendererExistenceEvent):void
+    {
+        var button:UIComponent = UIComponent(event.renderer);
+        var index:int = event.index;
+        var col:MobileGridColumn = MobileGridColumn(_columns[index]);
+        // don't size the last button
+        if (index != dataProvider.length - 1)
+            button.explicitWidth = col.scaledWidth;
+        else
+            button.percentWidth = 100;
+    }
+
+    private function getIconForButton(col:MobileGridColumn):Object
+    {
+        if (col.colNum === _sortIndex)
+        {
+            return  col.sortDescending ? descIconCls : ascIconCls;
+        }
+        else
+        {
+            return null;
+        }
+    }
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
new file mode 100644
index 0000000..0461d22
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/MobileGridRowRenderer.as
@@ -0,0 +1,34 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.supportClasses
+{
+
+/**  @private
+ *    This is the internal list itemRenderer used for rendering grid cells in a single row of a MobileGrid.
+ *    It inherits all its behavior for its parent class and only sets the part renderers layout.
+ */
+public class MobileGridRowRenderer extends ListMultiPartItemRendererBase
+{
+    public function MobileGridRowRenderer()
+    {
+        partRenderersLayout = new ListMultiPartTabbedLayout(this);
+    }
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
new file mode 100644
index 0000000..57a3cbb
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/components/supportClasses/PartRendererDescriptorBase.as
@@ -0,0 +1,184 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.components.supportClasses
+{
+import flash.events.EventDispatcher;
+import flash.events.IEventDispatcher;
+
+import mx.core.ClassFactory;
+import mx.core.DPIClassification;
+import mx.core.IFactory;
+import mx.core.mx_internal;
+
+import spark.components.itemRenderers.IItemPartRendererBase;
+import spark.components.itemRenderers.IItemTextPartRenderer;
+import spark.components.itemRenderers.ItemTextPartRenderer;
+import spark.utils.DensityUtil2;
+
+/**  This is the base class for GridColumn
+ *
+ */
+public class PartRendererDescriptorBase extends EventDispatcher implements IPartRendererDescriptor
+{
+
+    private var _colNum:int;
+    private var _dataField:String;
+    private var _width:Number;
+    private var _scaledWidth:Number;
+    private var _itemRenderer:IFactory;
+    private var _labelFunction:Function;
+    private var _styleName:String;
+    private var _textAlign:String;
+
+    public function PartRendererDescriptorBase(target:IEventDispatcher = null)
+    {
+        super(target);
+        _labelFunction = null;
+        width = 100; // default width;
+        itemRenderer = null; // will set default ;
+    }
+
+    /* IDataGridColumn impl*/
+
+    public function set dataField(value:String):void
+    {
+        _dataField = value;
+    }
+
+    public function get dataField():String
+    {
+        return _dataField;
+    }
+
+    public function get labelFunction():Function
+    {
+        return _labelFunction;
+    }
+
+    /**
+     *  An idempotent function that converts a data provider item into a column-specific string
+     *  that's used to initialize the item renderer's <code>label</code> property.
+     *
+     *  <p>You can use a label function to combine the values of several data provider items
+     *  into a single string.
+     *  If specified, this property is used by the
+     *  <code>itemToLabel()</code> method, which computes the value of each item
+     *  renderer's <code>label</code> property in this column.</p>
+     *
+     *  <p>The function specified to the <code>labelFunction</code> property
+     *  must have the following signature:</p>
+     *
+     *  <pre>labelFunction(item:Object):String</pre>
+     *
+     *  <p>The <code>item</code> parameter is the data provider item for an entire row.
+     *  The second parameter is this column object.</p>
+     *
+     *  <p>A typical label function could concatenate the firstName and
+     *  lastName properties of the data provider item ,
+     *  or do some custom formatting on a Date value property.</p>
+     */
+    public function set labelFunction(value:Function):void
+    {
+        _labelFunction = value;
+    }
+
+    public function set styleName(value:String):void
+    {
+        _styleName = value;
+    }
+
+    /** set the desired width of the column at the application's current DPI (or 160 if none)
+     * default value is 100
+     * the actual pixel width maybe higher if the runtimeDPI or application DPI  are different than 160
+     *
+     * @param value = desired width of the column at 160 DPI
+     */
+    public function set width(value:Number):void
+    {
+        _width = value;
+        _scaledWidth = DensityUtil2.dpiScale(value, DPIClassification.DPI_160);
+    }
+
+    /** set the desired width of the column at the application's current DPI (or 160 if none)
+     * default value is 100
+     * the actual pixel width maybe higher if the runtimeDPI or application DPI  are different than 160
+     *
+     * @param value = desired width of the column at 160 DPI
+     */
+    public function set widthAt160DPI(value:Number):void
+    {
+        _width = value;
+        _scaledWidth = DensityUtil2.dpiScale(value, DPIClassification.DPI_160);
+    }
+
+    public function get scaledWidth():Number
+    {
+        return  _scaledWidth;
+    }
+
+    mx_internal function get colNum():int
+    {
+        return _colNum;
+    }
+
+    mx_internal function set colNum(value:int):void
+    {
+        _colNum = value;
+    }
+
+    public function get itemRenderer():IFactory
+    {
+        return _itemRenderer;
+    }
+
+    public function set itemRenderer(value:IFactory):void
+    {
+        _itemRenderer = value ? value : new ClassFactory(ItemTextPartRenderer);
+    }
+
+    public function get styleName():String
+    {
+        return _styleName;
+    }
+
+    [Inspectable(enumeration="left,right,center,justify")]
+    public function set textAlign(value:String):void
+    {
+        _textAlign = value;
+    }
+
+    public function createPartRenderer():IItemPartRendererBase
+    {
+        var pr:IItemPartRendererBase = _itemRenderer.newInstance() as IItemPartRendererBase;
+        if (pr)
+        {
+            pr.cssStyleName = _styleName;
+            if (pr is IItemTextPartRenderer)  {
+                with( IItemTextPartRenderer(pr)){
+                    labelField = _dataField;
+                    labelFunction = _labelFunction;
+                    textAlign = _textAlign;
+                }
+            }
+        }
+        return pr;
+    }
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as b/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
new file mode 100644
index 0000000..06558b7
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/events/MobileGridHeaderEvent.as
@@ -0,0 +1,58 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.events
+{
+import flash.events.Event;
+
+/**
+ *  The MobileGridHeaderEvent class represents events that are dispatched when
+    the user clicks  on the header of a column in the DataGrid to sort it.
+ *
+ *  @see spark.components.MobileGrid
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+ */
+
+//   Note: we didn't use neither mx:DataGridEven because it's in not available for mobile not GridSortEvent because it handles multiple sorting
+public class MobileGridHeaderEvent extends Event
+{
+
+    public static const SORT_CHANGE:String = "sortChange";
+
+    private var _columnIndex:int;
+
+    public function MobileGridHeaderEvent(type:String, pindex:int, bubbles:Boolean = false, cancelable:Boolean = false)
+    {
+        super(type, bubbles, cancelable);
+        this._columnIndex = pindex;
+    }
+
+    public function get columnIndex():int
+    {
+        return _columnIndex;
+    }
+
+    override public function clone():Event
+    {
+        return new MobileGridHeaderEvent(type, columnIndex, bubbles, cancelable);
+    }
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridHeaderButtonBarSkin.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridHeaderButtonBarSkin.as b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridHeaderButtonBarSkin.as
new file mode 100644
index 0000000..5c21a0f
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridHeaderButtonBarSkin.as
@@ -0,0 +1,89 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.skins
+{
+import spark.components.ButtonBarButton;
+import spark.components.DataGroup;
+import spark.layouts.HorizontalLayout;
+import spark.layouts.VerticalAlign;
+import spark.skins.mobile.ButtonBarSkin;
+import spark.skins.mobile.supportClasses.ButtonBarButtonClassFactory;
+
+public class MobileGridHeaderButtonBarSkin extends ButtonBarSkin
+{
+
+    public function MobileGridHeaderButtonBarSkin()
+    {
+        super();
+    }
+
+    override protected function createChildren():void
+    {
+        if (!firstButton)
+        {
+            firstButton = new ButtonBarButtonClassFactory(ButtonBarButton);
+            ButtonBarButtonClassFactory(firstButton).skinClass = MobileGridHeaderFirstButtonSkin;
+        }
+
+        if (!lastButton)
+        {
+            lastButton = new ButtonBarButtonClassFactory(ButtonBarButton);
+            ButtonBarButtonClassFactory(lastButton).skinClass = MobileGridHeaderButtonSkin;
+        }
+
+        if (!middleButton)
+        {
+            middleButton = new ButtonBarButtonClassFactory(ButtonBarButton);
+            ButtonBarButtonClassFactory(middleButton).skinClass = MobileGridHeaderButtonSkin;
+        }
+
+        // create the data group to house the buttons
+        if (!dataGroup)
+        {
+            dataGroup = new DataGroup();
+            var hLayout:HorizontalLayout = new HorizontalLayout();
+            hLayout.gap = 0;
+            hLayout.verticalAlign = VerticalAlign.CONTENT_JUSTIFY;
+            hLayout.useVirtualLayout = false;
+
+            dataGroup.layout = hLayout;
+            addChild(dataGroup);
+        }
+    }
+
+    /**
+     *  @private
+     */
+    override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        super.drawBackground(unscaledWidth, unscaledHeight);
+
+        // backgroundAlpha style is not supported by ButtonBar
+        // TabbedViewNavigatorSkin sets a hard-coded value to support
+        // overlayControls
+        var backgroundAlphaValue:* = getStyle("backgroundAlpha");
+        var backgroundAlpha:Number = (backgroundAlphaValue === undefined)
+                ? 1 : getStyle("backgroundAlpha");
+
+        graphics.beginFill(getStyle("chromeColor"), backgroundAlpha);
+        graphics.drawRect(0, 0, unscaledWidth, unscaledHeight);
+        graphics.endFill();
+    }
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridHeaderButtonSkin.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridHeaderButtonSkin.as b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridHeaderButtonSkin.as
new file mode 100644
index 0000000..425847f
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridHeaderButtonSkin.as
@@ -0,0 +1,43 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.skins
+{
+
+import spark.skins.mobile.ButtonBarMiddleButtonSkin;
+import spark.skins.mobile.assets.MobileGridHeaderButton_down;
+import spark.skins.mobile.assets.MobileGridHeaderButton_up;
+
+public class MobileGridHeaderButtonSkin extends ButtonBarMiddleButtonSkin
+{
+    //--------------------------------------------------------------------------
+    //
+    //  Constructor
+    //
+    //--------------------------------------------------------------------------
+    public function MobileGridHeaderButtonSkin()
+    {
+        super();
+
+        upBorderSkin = MobileGridHeaderButton_up;
+        downBorderSkin = MobileGridHeaderButton_down;
+    }
+
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridHeaderFirstButtonSkin.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridHeaderFirstButtonSkin.as b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridHeaderFirstButtonSkin.as
new file mode 100644
index 0000000..d3240c2
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridHeaderFirstButtonSkin.as
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.skins
+{
+import spark.skins.mobile.assets.MobileGridHeaderFirstButton_down;
+import spark.skins.mobile.assets.MobileGridHeaderFirstButton_up;
+
+public class MobileGridHeaderFirstButtonSkin extends MobileGridHeaderButtonSkin
+{
+
+    public function MobileGridHeaderFirstButtonSkin()
+    {
+        super();
+        upBorderSkin = MobileGridHeaderFirstButton_up;
+        downBorderSkin = MobileGridHeaderFirstButton_down;
+    }
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
new file mode 100644
index 0000000..20c46a0
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/skins/MobileGridSkin.as
@@ -0,0 +1,178 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.skins
+{
+import flash.display.BlendMode;
+
+import mx.core.BitmapAsset;
+import mx.core.ClassFactory;
+import mx.core.DPIClassification;
+import mx.core.mx_internal;
+
+import spark.components.DataGroup;
+import spark.components.LabelItemRenderer;
+import spark.components.MobileGrid;
+import spark.components.Scroller;
+import spark.components.supportClasses.MobileGridHeader;
+import spark.layouts.HorizontalAlign;
+import spark.layouts.VerticalLayout;
+import spark.skins.mobile.supportClasses.MobileSkin;
+import spark.utils.MultiDPIBitmapSource;
+import spark.utils.MultiDPIBitmapSourceExt;
+
+use namespace mx_internal;
+
+public class MobileGridSkin extends MobileSkin
+{
+
+    [Embed(source="../../../assets/images/mobile320/dg_header_shadow.png")]
+    private const headerShadowCls320:Class;
+
+    [Embed(source="../../../assets/images/mobile160/dg_header_shadow.png")]
+    private const headerShadowCls160:Class;
+
+    public var hostComponent:MobileGrid;
+    // skin parts
+    public var headerGroup:MobileGridHeader;
+    public var scroller:Scroller;
+    public var dataGroup:DataGroup;
+    private var headerShadowCls:Class;
+    private var headerShadow:BitmapAsset;
+
+
+    public function MobileGridSkin()
+    {
+        super();
+        minWidth = 112;
+        blendMode = BlendMode.NORMAL;
+        switch (applicationDPI)
+        {
+            case DPIClassification.DPI_320:
+            case DPIClassification.DPI_480:
+                minWidth = 200;
+                break;
+            case DPIClassification.DPI_160:
+            case DPIClassification.DPI_240:
+            default:
+                minWidth = 100;
+                break;
+        }
+        var headerShadowSrc:MultiDPIBitmapSource = new MultiDPIBitmapSourceExt();
+        headerShadowSrc.source320dpi = headerShadowCls320;
+        headerShadowSrc.source160dpi = headerShadowCls160;
+        headerShadowCls = Class(headerShadowSrc.getSource(NaN));
+    }
+
+    override protected function commitCurrentState():void
+    {
+        super.commitCurrentState();
+        alpha = currentState.indexOf("disabled") == -1 ? 1 : 0.5;
+    }
+
+
+    /**
+     *  @private
+     */
+    override protected function createChildren():void
+    {
+
+        if (!dataGroup)
+        {
+            // Create data group layout
+            var layout:VerticalLayout = new VerticalLayout();
+            layout.requestedMinRowCount = 5;
+            layout.horizontalAlign = HorizontalAlign.JUSTIFY;
+            layout.gap = 0;
+
+            // Create data group
+            dataGroup = new DataGroup();
+            dataGroup.layout = layout;
+            dataGroup.itemRenderer = new ClassFactory(LabelItemRenderer);
+        }
+        if (!scroller)
+        {
+            // Create scroller
+            scroller = new Scroller();
+            scroller.minViewportInset = 1;
+            scroller.hasFocusableChildren = false;
+            scroller.ensureElementIsVisibleForSoftKeyboard = false;
+            addChild(scroller);
+        }
+
+        // Associate scroller with data group
+        if (!scroller.viewport)
+        {
+            scroller.viewport = dataGroup;
+        }
+
+        headerShadow = new headerShadowCls();
+        addChild(headerShadow);
+
+        /* add after, for the drop shadow*/
+
+        headerGroup = new MobileGridHeader();
+        headerGroup.id = "hg";
+        addChild(headerGroup);
+    }
+
+    /**
+     *  @private
+     */
+    override protected function measure():void
+    {
+        measuredWidth = scroller.getPreferredBoundsWidth();
+        measuredHeight = scroller.getPreferredBoundsHeight() + headerGroup.getPreferredBoundsHeight();
+    }
+
+    /**
+     *  @private
+     */
+    override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+    {
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+        var borderWidth:int = getStyle("borderVisible") ? 1 : 0;
+        var headerHeight:Number = headerGroup.getPreferredBoundsHeight();
+
+        // Background
+        graphics.beginFill(getStyle("contentBackgroundColor"), getStyle("contentBackgroundAlpha"));
+        graphics.drawRect(borderWidth, borderWidth, unscaledWidth - 2 * borderWidth, unscaledHeight - 2 * borderWidth);
+        graphics.endFill();
+
+        // Border
+        if (getStyle("borderVisible"))
+        {
+            graphics.lineStyle(1, getStyle("borderColor"), getStyle("borderAlpha"), true);
+            graphics.drawRect(0, 0, unscaledWidth - 1, unscaledHeight - 1);
+        }
+
+        // Header
+        setElementSize(headerGroup, unscaledWidth, headerHeight);
+        setElementPosition(headerGroup, 0, 0);
+
+        //Shadow
+        setElementSize(headerShadow, unscaledWidth, headerShadow.height);
+        setElementPosition(headerShadow, 0, headerHeight);
+        // Scroller
+        scroller.minViewportInset = borderWidth;
+        setElementSize(scroller, unscaledWidth, unscaledHeight);
+        setElementPosition(scroller, 0, headerHeight);
+    }
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderButton_down.fxg
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderButton_down.fxg b/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderButton_down.fxg
new file mode 100644
index 0000000..37be5cc
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderButton_down.fxg
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+-->
+<Graphic version="2.0" xmlns="http://ns.adobe.com/fxg/2008"
+         scaleGridLeft="5" scaleGridRight="49" scaleGridTop="10" scaleGridBottom="54">
+
+    <Rect width="50" height="64">
+        <fill>
+            <LinearGradient x="0" y="0" scaleX="64" rotation="90">
+                <GradientEntry color="#B0B0B0" ratio="0"/>
+                <GradientEntry color="#5b5b5b" ratio="0.05"/>
+                <GradientEntry color="#505050" ratio="0.75"/>
+                <GradientEntry color="#404040" ratio="1"/>
+            </LinearGradient>
+        </fill>
+    </Rect>
+    <Rect width="1" height="40" x="0" y="12">
+        <fill>
+            <SolidColor color="#666666" alpha="0.5"/>
+        </fill>
+    </Rect>
+    <Rect width="1" height="40" x="1" y="12">
+        <fill>
+            <SolidColor color="#cccccc" alpha="0.5"/>
+        </fill>
+    </Rect>
+
+</Graphic>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderButton_up.fxg
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderButton_up.fxg b/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderButton_up.fxg
new file mode 100644
index 0000000..6130486
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderButton_up.fxg
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+-->
+<Graphic version="2.0" xmlns="http://ns.adobe.com/fxg/2008"
+         scaleGridLeft="5" scaleGridRight="49" scaleGridTop="10" scaleGridBottom="54">
+    <Rect width="50" height="64">
+        <fill>
+            <LinearGradient x="0" y="0" scaleX="64" rotation="90">
+                <GradientEntry color="#999999" ratio="0"/>
+                <GradientEntry color="#404040" ratio="0.05"/>
+                <GradientEntry color="#303030" ratio="0.75"/>
+                <GradientEntry color="#202020" ratio="1"/>
+            </LinearGradient>
+        </fill>
+    </Rect>
+    <Rect width="1" height="40" x="0" y="12">
+        <fill>
+            <SolidColor color="#666666" alpha="0.5"/>
+        </fill>
+    </Rect>
+    <Rect width="1" height="40" x="1" y="12">
+        <fill>
+            <SolidColor color="#cccccc" alpha="0.5"/>
+        </fill>
+    </Rect>
+</Graphic>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderFirstButton_down.fxg
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderFirstButton_down.fxg b/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderFirstButton_down.fxg
new file mode 100644
index 0000000..1540367
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderFirstButton_down.fxg
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+-->
+<Graphic version="2.0" xmlns="http://ns.adobe.com/fxg/2008">
+    <Rect width="160" height="64">
+        <fill>
+            <LinearGradient x="0" y="0" scaleX="64" rotation="90">
+                <GradientEntry color="#B0B0B0" ratio="0"/>
+                <GradientEntry color="#5b5b5b" ratio="0.05"/>
+                <GradientEntry color="#505050" ratio="0.75"/>
+                <GradientEntry color="#404040" ratio="1"/>
+            </LinearGradient>
+        </fill>
+    </Rect>
+
+</Graphic>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderFirstButton_up.fxg
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderFirstButton_up.fxg b/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderFirstButton_up.fxg
new file mode 100644
index 0000000..d898d78
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/skins/mobile/assets/MobileGridHeaderFirstButton_up.fxg
@@ -0,0 +1,32 @@
+<Graphic version="2.0" xmlns="http://ns.adobe.com/fxg/2008">
+    <!--
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.
+//
+////////////////////////////////////////////////////////////////////////////////
+-->
+    <Rect width="100" height="64">
+        <fill>
+            <LinearGradient x="0" y="0" scaleX="64" rotation="90">
+                <GradientEntry color="#999999" ratio="0"/>
+                <GradientEntry color="#404040" ratio="0.05"/>
+                <GradientEntry color="#303030" ratio="0.75"/>
+                <GradientEntry color="#202020" ratio="1"/>
+            </LinearGradient>
+        </fill>
+    </Rect>
+</Graphic>

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as b/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
new file mode 100644
index 0000000..8c76e73
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/DensityUtil2.as
@@ -0,0 +1,88 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.utils
+{
+
+import mx.core.FlexGlobals;
+import mx.core.mx_internal;
+import mx.managers.SystemManager;
+
+import spark.components.Application;
+
+public class DensityUtil2
+{
+
+    use namespace mx_internal;
+
+    private static var _setApplicationDPI:Number = 0;
+
+    /**  Calculates a scale factor to be used when element authored for  <code>sourceDPI</code>
+     *   two algorithms: <br/>
+     *   Application.applicationDPI has been set, which means scaling factor  occurs already, so additional scaling is required, return 1
+     *  Application.applicationDPI has not been set, then return runTimeDPI / sourceDPI
+     *  examples:
+     *  runtimeDPI = 320 and sourceDPI = 160 and  applicationDPI not set  (ie=320) => 2
+     *  runtimeDPI = 160 and sourceDPI = 160 and applicationDPI not set (ie=160)  => 1
+     *  runtimeDPI = 160 and sourceDPI = 160 and applicationDPI = 160 => 1
+     *  runtimeDPI = 320 and sourceDPI = 160 and applicationDPI = 160 => 1 (scaling occurs)
+     * @param sourceDPI
+     * @return  scale factor
+     */
+
+    public static function getPostDPIScale(sourceDPI:Number):Number
+    {
+
+        var appDPI:Number = getSetApplicationDPI();
+        if (isNaN(appDPI))
+        {
+            // was not set,
+            var runDPI:Number = FlexGlobals.topLevelApplication.runtimeDPI;
+            return runDPI / sourceDPI;
+        }
+        else
+            return 1.0; //  already scaled
+    }
+
+
+    public static function dpiScale(value:Number, sourceDPI:Number):Number
+    {
+        var appDPI:Number = getSetApplicationDPI();
+        if (isNaN(appDPI))
+        {
+            var runDPI:Number = FlexGlobals.topLevelApplication.runtimeDPI;
+            return value * runDPI / sourceDPI;
+        }
+        else
+            return value; //  already scaled
+
+    }
+
+    private static function getSetApplicationDPI():Number
+    {
+        if (_setApplicationDPI == 0)
+        {
+            var application:Application = FlexGlobals.topLevelApplication as Application;
+            var sm:SystemManager = application ? application.systemManager as SystemManager : null;
+            _setApplicationDPI = sm ? sm.info()["applicationDPI"] : NaN;
+        }
+        return _setApplicationDPI;
+    }
+
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as b/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
new file mode 100644
index 0000000..eb3ac03
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/MultiDPIBitmapSourceExt.as
@@ -0,0 +1,44 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.utils
+{
+import mx.core.FlexGlobals;
+import mx.utils.DensityUtil;
+
+public class MultiDPIBitmapSourceExt extends MultiDPIBitmapSource
+{
+
+
+    override public function getSource(desiredDPI:Number):Object
+    {
+        if (isNaN(desiredDPI))
+        {
+            var app:Object = FlexGlobals.topLevelApplication;
+            var dpi:Number;
+            if ("runtimeDPI" in app)
+                dpi = app["runtimeDPI"];
+            else
+                dpi = DensityUtil.getRuntimeDPI();
+            return getSource(dpi);
+        }
+        else
+            return super.getSource(desiredDPI);
+    }
+}
+}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/b78de5c0/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as b/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
new file mode 100644
index 0000000..0ecf82c
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/UIComponentUtils.as
@@ -0,0 +1,163 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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 spark.utils
+{
+import mx.collections.IList;
+import mx.core.IFlexDisplayObject;
+import mx.core.ILayoutElement;
+import mx.core.UIComponent;
+
+import spark.components.IItemRendererOwner;
+
+public class UIComponentUtils
+{
+
+    /* fast function based on char length and not on pixel length*/
+    public static function computeLongestItem(listComponent:IItemRendererOwner, dataProvider:IList, max:int = 10):Object
+    {
+        if (!dataProvider)
+        {
+            return null;
+        }
+        max = Math.min(max, dataProvider.length);
+        var maxLength:int = 0;
+        var longestItem:Object;
+        var item:Object;
+        var itemStringLength:int;
+        for (var i:int = 0; i < max; i++)
+        {
+            item = dataProvider.getItemAt(i);
+            itemStringLength = listComponent.itemToLabel(item).length;
+            if (itemStringLength >= maxLength)
+            {
+                maxLength = itemStringLength;
+                longestItem = item;
+            }
+        }
+        return longestItem;
+    }
+
+    public static function itemToLabel(item:Object, labelField:String, labelFunction:Function, nullLabel:String = '-'):String
+    {
+        if (labelFunction != null)
+        {
+            return labelFunction(item);
+        }
+        else if (item == null)
+        {
+            return nullLabel;
+        }
+        else
+        {
+            return   item[labelField];
+        }
+    }
+
+    public static function clearBoundsSize(comp:UIComponent):void
+    {
+        comp.explicitWidth = NaN; // was set before
+        comp.explicitHeight = NaN;
+        comp.setLayoutBoundsSize(NaN, NaN);
+    }
+
+    public static function setElementSize(element:Object, width:Number, height:Number):void
+    {
+        if (element is ILayoutElement)
+        {
+            ILayoutElement(element).setLayoutBoundsSize(width, height, false);
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            IFlexDisplayObject(element).setActualSize(width, height);
+        }
+        else
+        {
+            element.width = width;
+            element.height = height;
+        }
+    }
+
+    public static function setElementPosition(element:Object, x:Number, y:Number):void
+    {
+        if (element is ILayoutElement)
+        {
+            ILayoutElement(element).setLayoutBoundsPosition(x, y, false);
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            IFlexDisplayObject(element).move(x, y);
+        }
+        else
+        {
+            element.x = x;
+            element.y = y;
+        }
+    }
+
+    public static function getElementPreferredWidth(element:Object):Number
+    {
+        var result:Number;
+
+        if (element is ILayoutElement)
+        {
+            result = ILayoutElement(element).getPreferredBoundsWidth();
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            result = IFlexDisplayObject(element).measuredWidth;
+        }
+        else
+        {
+            result = element.width;
+        }
+        return Math.round(result);
+    }
+
+    public static function getElementPreferredHeight(element:Object):Number
+    {
+        var result:Number;
+
+        if (element is ILayoutElement)
+        {
+            result = ILayoutElement(element).getPreferredBoundsHeight();
+        }
+        else if (element is IFlexDisplayObject)
+        {
+            result = IFlexDisplayObject(element).measuredHeight;
+        }
+        else
+        {
+            result = element.height;
+        }
+        return Math.ceil(result);
+    }
+
+    public static function offsetForCenter(inLength:Number, outLength:Number):Number
+    {
+        return ( outLength - inLength) / 2;
+    }
+
+    public static function setElementPositionTopRight(component:Object, container:Object, paddingTop:Number = 0, paddingRight:Number = 0):void
+    {
+        var right:Number = getElementPreferredWidth(container) - getElementPreferredWidth(component) - paddingRight;
+        setElementPosition(component, paddingTop, right);
+    }
+
+}
+}


[11/15] git commit: [flex-sdk] [refs/heads/develop] - https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile - clean up code to prepare integration with SDK (continued) renamed class DensityUtil2 to MobileGridUtil

Posted by ma...@apache.org.
https://issues.apache.org/jira/browse/FLEX-33777 Dagrid for mobile
- clean up code to prepare integration with SDK (continued)
renamed class DensityUtil2 to MobileGridUtil


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/908829a5
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/908829a5
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/908829a5

Branch: refs/heads/develop
Commit: 908829a5184c42ecea79de9ae5e3136c271bcec2
Parents: b2fb601
Author: mamsellem <ma...@systar.com>
Authored: Fri Oct 4 01:37:03 2013 +0200
Committer: mamsellem <ma...@systar.com>
Committed: Fri Oct 4 01:37:03 2013 +0200

----------------------------------------------------------------------
 .../src/spark/layouts/MobileGridLayout.as       |  4 +-
 .../src/spark/utils/MobileGridUtil.as           | 80 ++++++++++++++++++++
 2 files changed, 82 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/908829a5/frameworks/projects/experimental_mobile/src/spark/layouts/MobileGridLayout.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/layouts/MobileGridLayout.as b/frameworks/projects/experimental_mobile/src/spark/layouts/MobileGridLayout.as
index 8149dfe..a5901d8 100644
--- a/frameworks/projects/experimental_mobile/src/spark/layouts/MobileGridLayout.as
+++ b/frameworks/projects/experimental_mobile/src/spark/layouts/MobileGridLayout.as
@@ -4,7 +4,7 @@ import mx.core.mx_internal;
 
 import spark.components.MobileGrid;
 import spark.components.supportClasses.MobileGridColumn;
-import spark.utils.DensityUtil2;
+import spark.utils.MobileGridUtil;
 
 use namespace  mx_internal;
 
@@ -66,7 +66,7 @@ public class MobileGridLayout extends VerticalLayout
             else
             {
                 colWidth = isNaN(col.width) ? 100 : col.width;
-                colActualWidth = DensityUtil2.dpiScale(colWidth);
+                colActualWidth = MobileGridUtil.dpiScale(colWidth);
                 col.actualWidth = colActualWidth; // can immediately set actual width
                 totalFixedWidths += colActualWidth;
             }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/908829a5/frameworks/projects/experimental_mobile/src/spark/utils/MobileGridUtil.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/experimental_mobile/src/spark/utils/MobileGridUtil.as b/frameworks/projects/experimental_mobile/src/spark/utils/MobileGridUtil.as
new file mode 100644
index 0000000..41a8344
--- /dev/null
+++ b/frameworks/projects/experimental_mobile/src/spark/utils/MobileGridUtil.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 spark.utils
+{
+
+import mx.core.DPIClassification;
+import mx.core.FlexGlobals;
+import mx.managers.SystemManager;
+
+import spark.components.Application;
+
+//TODO merge with spark.utils.DensityUtil
+
+/**
+ * @private
+ * Utility class for MobileGrid
+ *
+ *  @langversion 3.0
+ *  @playerversion AIR 3.8
+ *  @productversion Flex 4.11
+
+ */
+
+
+public class MobileGridUtil
+{
+
+    private static var _setApplicationDPI:Number = 0;
+
+    /**  returns the actual  value for  a value authored for  <code>sourceDPI</code>, taking into account any dpi scaling.
+     *  <ul>
+     *      <li> If Application.applicationDPI has been set, which means dpi scaling factor is already applied, return the original value.</li>
+     *     <li> If Application.applicationDPI has not been set, then return scaled value runTimeDPI / sourceDPI   </li>
+     *  </li>
+     * @param sourceDPI
+     * @return  scaled value
+     */
+    public static function dpiScale(value:Number, sourceDPI:Number = DPIClassification.DPI_160):Number
+    {
+        var appDPI:Number = getSetApplicationDPI();
+        if (isNaN(appDPI))
+        {
+            var runDPI:Number = FlexGlobals.topLevelApplication.runtimeDPI;
+            return value * runDPI / sourceDPI;
+        }
+        else
+            return value; //  already scaled
+    }
+
+    /**
+     *  returns the applicationDPI that was explicitly set in top level application , or NaN if none */
+    private static function getSetApplicationDPI():Number
+    {
+        if (_setApplicationDPI == 0)
+        {
+            var application:Application = FlexGlobals.topLevelApplication as Application;
+            var sm:SystemManager = application ? application.systemManager as SystemManager : null;
+            _setApplicationDPI = sm ? sm.info()["applicationDPI"] : NaN;
+        }
+        return _setApplicationDPI;
+    }
+
+}
+}