flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmcl...@apache.org
Subject [2/2] git commit: [flex-sdk] [refs/heads/develop] - FLEX-33989 saved MultiDPIBitmapSource information for icon when saving view data
Date Thu, 26 Dec 2013 00:24:34 GMT
FLEX-33989 saved MultiDPIBitmapSource information for icon when saving view data


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

Branch: refs/heads/develop
Commit: bdbf46e9026b4e1de360d5c4ff4b8639fb79321d
Parents: 9d2bc06
Author: Justin Mclean <jmclean@apache.org>
Authored: Thu Dec 26 11:24:09 2013 +1100
Committer: Justin Mclean <jmclean@apache.org>
Committed: Thu Dec 26 11:24:09 2013 +1100

----------------------------------------------------------------------
 .../supportClasses/ViewNavigatorBase.as         | 29 ++++++++++++--------
 1 file changed, 17 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/bdbf46e9/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as
b/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as
index 140b705..857f97a 100644
--- a/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as
+++ b/frameworks/projects/mobilecomponents/src/spark/components/supportClasses/ViewNavigatorBase.as
@@ -440,7 +440,7 @@ public class ViewNavigatorBase extends SkinnableContainer
      *  Serializes all data related to
      *  the navigator's children into an object that can be saved
      *  by the persistence manager.  
-     *  This returned object is passed to the <code>restoreViewData()</code>

+     *  This returned object is passed to the <code>loadViewData()</code> 
      *  method when the navigator is reinstantiated.
      * 
      *  @return The object that represents the navigators state
@@ -452,13 +452,12 @@ public class ViewNavigatorBase extends SkinnableContainer
     public function saveViewData():Object
     {
         var iconData:Object = icon;
-        
-        if (iconData is MultiDPIBitmapSource)
-            iconData = MultiDPIBitmapSource(iconData).getMultiSource();
-        
+
         if (iconData is Class)
-            return {label:label, iconClassName:getQualifiedClassName(iconData)};
-        if (iconData is String)
+            return {label:label, iconClassName:getQualifiedClassName(iconData),
+				multiSource:(iconData is MultiDPIBitmapSource)};
+        
+		if (iconData is String)
             return {label:label, iconStringName: iconData};
         
         return {label:label};
@@ -478,14 +477,20 @@ public class ViewNavigatorBase extends SkinnableContainer
      */
     public function loadViewData(value:Object):void
     {
+		var iconClassName:String;
+		
         label = value.label;
         
-        var iconClassName:String = value.iconClassName;
-
-        if (iconClassName == null)
+		if ("iconClassName" in value) {
+			iconClassName =  value.iconClassName;
+			if (value.multiSource)
+				icon = MultiDPIBitmapSource(getDefinitionByName(iconClassName)).getMultiSource();
+			else 
+				icon = getDefinitionByName(iconClassName);
+		}
+		else if ("iconStringName" in value) {
             icon = value.iconStringName;
-        else if (iconClassName != null)
-            icon = getDefinitionByName(iconClassName);
+		}
         
         // TODO (chiedozi): This is not module safe because of its use of 
         // getDefinitionByName.  Should use systemManager to do this. (SDK-27424)


Mime
View raw message