Return-Path: X-Original-To: apmail-incubator-flex-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-flex-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 67EB4DD2B for ; Tue, 30 Oct 2012 19:32:32 +0000 (UTC) Received: (qmail 94128 invoked by uid 500); 30 Oct 2012 19:32:32 -0000 Delivered-To: apmail-incubator-flex-commits-archive@incubator.apache.org Received: (qmail 94098 invoked by uid 500); 30 Oct 2012 19:32:32 -0000 Mailing-List: contact flex-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: flex-dev@incubator.apache.org Delivered-To: mailing list flex-commits@incubator.apache.org Received: (qmail 94091 invoked by uid 99); 30 Oct 2012 19:32:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2012 19:32:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2012 19:32:29 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9F6D423888EA; Tue, 30 Oct 2012 19:31:44 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1403832 - /incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/Group.as Date: Tue, 30 Oct 2012 19:31:44 -0000 To: flex-commits@incubator.apache.org From: cframpton@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20121030193144.9F6D423888EA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: cframpton Date: Tue Oct 30 19:31:44 2012 New Revision: 1403832 URL: http://svn.apache.org/viewvc?rev=1403832&view=rev Log: Defer adding IAdvancedStyleClients to a Group until after its children have been created with createChildren(). The locale was not propagating properly. [SDK-30452] Modified: incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/Group.as Modified: incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/Group.as URL: http://svn.apache.org/viewvc/incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/Group.as?rev=1403832&r1=1403831&r2=1403832&view=diff ============================================================================== --- incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/Group.as (original) +++ incubator/flex/sdk/branches/develop/frameworks/projects/spark/src/spark/components/Group.as Tue Oct 30 19:31:44 2012 @@ -23,9 +23,9 @@ package spark.components import flash.display.BlendMode; import flash.display.DisplayObject; import flash.geom.Rectangle; +import flash.utils.Dictionary; import mx.core.FlexVersion; -import mx.styles.IAdvancedStyleClient; import mx.core.IFlexModule; import mx.core.IFontContextComponent; import mx.core.IUIComponent; @@ -43,6 +43,8 @@ import mx.graphics.shaderClasses.HueShad import mx.graphics.shaderClasses.LuminosityShader; import mx.graphics.shaderClasses.SaturationShader; import mx.graphics.shaderClasses.SoftLightShader; +import mx.styles.AdvancedStyleClient; +import mx.styles.IAdvancedStyleClient; import mx.styles.ISimpleStyleClient; import mx.styles.IStyleClient; import mx.styles.StyleProtoChain; @@ -239,6 +241,7 @@ public class Group extends GroupBase imp private var needsDisplayObjectAssignment:Boolean = false; private var layeringMode:uint = ITEM_ORDERED_LAYERING; private var numGraphicElements:uint = 0; + private var deferredStyleClients:Dictionary = null; // of IAdvancedStyleClient private static const ITEM_ORDERED_LAYERING:uint = 0; private static const SPARSE_LAYERING:uint = 1; @@ -841,6 +844,37 @@ public class Group extends GroupBase imp /** * @private + * Defer adding IAdvancedStyleClients until createChildren() time. The AdvancedStyleClient's + * styleName might be a component's show inclusion in the IVisualElement hierarchy was also + * deferred. + */ + override public function addStyleClient(styleClient:IAdvancedStyleClient):void + { + if (!createChildrenCalled) + { + if (!deferredStyleClients) + deferredStyleClients = new Dictionary(true); + deferredStyleClients[styleClient] = true; + } + else + { + super.addStyleClient(styleClient); + } + } + + /** + * @private + */ + override public function removeStyleClient(styleClient:IAdvancedStyleClient):void + { + if (deferredStyleClients && !createChildrenCalled) + delete deferredStyleClients[styleClient]; + else + super.removeStyleClient(styleClient); + } + + /** + * @private * Whether createChildren() has been called or not. * We use this in the setter for mxmlContent to know * whether to validate the value immediately, or just @@ -862,6 +896,17 @@ public class Group extends GroupBase imp mxmlContentChanged = false; setMXMLContent(_mxmlContent); } + + if (deferredStyleClients) + { + for (var obj:Object in deferredStyleClients) + { + var styleClient:IAdvancedStyleClient = obj as IAdvancedStyleClient; + if (styleClient) + super.addStyleClient(styleClient); + } + deferredStyleClients = null; + } } /**