Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AD9A210E65 for ; Mon, 24 Nov 2014 21:12:58 +0000 (UTC) Received: (qmail 68273 invoked by uid 500); 24 Nov 2014 21:12:52 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 68220 invoked by uid 500); 24 Nov 2014 21:12:52 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 67669 invoked by uid 99); 24 Nov 2014 21:12:52 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Nov 2014 21:12:52 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 21812A1792E; Mon, 24 Nov 2014 21:12:52 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: bigosmallm@apache.org To: commits@flex.apache.org Date: Mon, 24 Nov 2014 21:13:19 -0000 Message-Id: In-Reply-To: <55bb966a3c2d47c5a55280eac85fc41d@git.apache.org> References: <55bb966a3c2d47c5a55280eac85fc41d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [29/44] git commit: [flex-sdk] [refs/heads/develop] - Remove the newly created MobileBusyIndicator. The existing BusyIndicator component has been modified instead. Remove the newly created MobileBusyIndicator. The existing BusyIndicator component has been modified instead. Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/0dd7d821 Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/0dd7d821 Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/0dd7d821 Branch: refs/heads/develop Commit: 0dd7d82180ff17d7481eca3ef516a9e77deb89b4 Parents: 58b0548 Author: OmPrakash Muppirala Authored: Tue Nov 4 16:08:31 2014 -0800 Committer: OmPrakash Muppirala Committed: Tue Nov 4 16:08:31 2014 -0800 ---------------------------------------------------------------------- .../projects/mobilecomponents/manifest.xml | 1 - .../src/spark/components/MobileBusyIndicator.as | 181 ------------------- 2 files changed, 182 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/0dd7d821/frameworks/projects/mobilecomponents/manifest.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/mobilecomponents/manifest.xml b/frameworks/projects/mobilecomponents/manifest.xml index 4e85f42..810bfea 100644 --- a/frameworks/projects/mobilecomponents/manifest.xml +++ b/frameworks/projects/mobilecomponents/manifest.xml @@ -25,7 +25,6 @@ --> - http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/0dd7d821/frameworks/projects/mobilecomponents/src/spark/components/MobileBusyIndicator.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/mobilecomponents/src/spark/components/MobileBusyIndicator.as b/frameworks/projects/mobilecomponents/src/spark/components/MobileBusyIndicator.as deleted file mode 100644 index c9f22d1..0000000 --- a/frameworks/projects/mobilecomponents/src/spark/components/MobileBusyIndicator.as +++ /dev/null @@ -1,181 +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 -{ - import flash.events.Event; - import mx.core.IUIComponent; - import mx.core.IVisualElement; - import mx.events.FlexEvent; - import mx.states.State; - import spark.components.supportClasses.SkinnableComponent; - - [SkinState("rotatingState")] - [SkinState("notRotatingState")] - - public class MobileBusyIndicator extends SkinnableComponent - { - private var effectiveVisibility:Boolean = false; - private var effectiveVisibilityChanged:Boolean = true; - - public function MobileBusyIndicator() - { - super(); - // Listen to added to stage and removed from stage. - // Start rotating when we are on the stage and stop - // when we are removed from the stage. - addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler); - addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler); - states = [ - new State({name:"notRotatingState"}), - new State({name:"rotatingState"}) - ]; - } - - override protected function getCurrentSkinState():String - { - return currentState; - } - - private function addedToStageHandler(event:Event):void - { - // Check our visibility here since we haven't added - // visibility listeners yet. - computeEffectiveVisibility(); - - if (canRotate()) - currentState = "rotatingState"; - - addVisibilityListeners(); - invalidateSkinState(); - } - - private function removedFromStageHandler(event:Event):void - { - currentState = "notRotatingState"; - - removeVisibilityListeners(); - invalidateSkinState(); - } - - private function computeEffectiveVisibility():void - { - - // Check our design layer first. - if (designLayer && !designLayer.effectiveVisibility) - { - effectiveVisibility = false; - return; - } - - // Start out with true visibility and enablement - // then loop up parent-chain to see if any of them are false. - effectiveVisibility = true; - var current:IVisualElement = this; - - while (current) - { - if (!current.visible) - { - if (!(current is IUIComponent) || !IUIComponent(current).isPopUp) - { - // Treat all pop ups as if they were visible. This is to - // fix a bug where the BusyIndicator does not spin when it - // is inside modal popup. The problem is in we do not get - // an event when the modal window is made visible in - // PopUpManagerImpl.fadeInEffectEndHandler(). When the modal - // window is made visible, setVisible() is passed "true" so - // as to not send an event. When do get events when the - // non-modal windows are popped up. Only modal windows are - // a problem. - // The downside of this fix is BusyIndicator components that are - // inside of hidden, non-modal, popup windows will paint themselves - // on a timer. - effectiveVisibility = false; - break; - } - } - - current = current.parent as IVisualElement; - } - } - - /** - * The BusyIndicator can be rotated if it is both on the display list and - * visible. - * - * @returns true if the BusyIndicator can be rotated, false otherwise. - */ - private function canRotate():Boolean - { - if (effectiveVisibility && stage != null) - return true; - - return false; - } - - - /** - * @private - * Add event listeners for SHOW and HIDE on all the ancestors up the parent chain. - * Adding weak event listeners just to be safe. - */ - private function addVisibilityListeners():void - { - var current:IVisualElement = this.parent as IVisualElement; - while (current) - { - // add visibility listeners to the parent - current.addEventListener(FlexEvent.HIDE, visibilityChangedHandler, false, 0, true); - current.addEventListener(FlexEvent.SHOW, visibilityChangedHandler, false, 0, true); - - current = current.parent as IVisualElement; - } - } - - /** - * @private - * Remove event listeners for SHOW and HIDE on all the ancestors up the parent chain. - */ - private function removeVisibilityListeners():void - { - var current:IVisualElement = this; - while (current) - { - current.removeEventListener(FlexEvent.HIDE, visibilityChangedHandler, false); - current.removeEventListener(FlexEvent.SHOW, visibilityChangedHandler, false); - - current = current.parent as IVisualElement; - } - } - - /** - * @private - * Event call back whenever the visibility of us or one of our ancestors - * changes - */ - private function visibilityChangedHandler(event:FlexEvent):void - { - effectiveVisibilityChanged = true; - invalidateProperties(); - } - - - } -} \ No newline at end of file