This is an automated email from the ASF dual-hosted git repository. yishayw pushed a commit to branch develop in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
commit 2e7283264d8e04c619410a06320b62e249112d49 Author: Yishay Weiss <[email protected]> AuthorDate: Fri Sep 25 07:40:48 2020 +0100 Adding some mx stubs --- .../mx/collections/errors/ItemPendingError.as | 133 ++++ .../mx/controls/scrollClasses/ScrollThumb.as | 230 +++++++ .../MXRoyale/src/main/royale/mx/effects/IEffect.as | 692 +++++++++++++++++++++ .../MXRoyale/src/main/royale/mx/events/RSLEvent.as | 363 +++++++++++ .../mx/skins/halo/DataGridHeaderSeparator.as | 116 ++++ 5 files changed, 1534 insertions(+) diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/collections/errors/ItemPendingError.as b/frameworks/projects/MXRoyale/src/main/royale/mx/collections/errors/ItemPendingError.as new file mode 100644 index 0000000..615bdb7 --- /dev/null +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/collections/errors/ItemPendingError.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 mx.collections.errors +{ + +import mx.rpc.IResponder; + +/** + * This error is thrown when retrieving an item from a collection view + * requires an asynchronous call. This error occurs when the backing data + * is provided from a remote source and the data is not yet available locally. + * + * <p>If the receiver of this error needs notification when the requested item + * becomes available (that is, when the asynchronous call completes), it must + * use the <code>addResponder()</code> method and specify + * an object that supports the <code>mx.rpc.IResponder</code> + * interface to respond when the item is available. + * The <code>mx.collections.ItemResponder</code> class implements the + * IResponder interface and supports a <code>data</code> property.</p> + * + * @see mx.collections.ItemResponder + * @see mx.rpc.IResponder + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ +public class ItemPendingError extends Error +{ + include "../../core/Version.as"; + + //-------------------------------------------------------------------------- + // + // Constructor + // + //-------------------------------------------------------------------------- + + /** + * Constructor. + * + * <p>Called by the Flex Framework when a request is made + * for an item that isn't local.</p> + * + * @param message A message providing information about the error cause. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public function ItemPendingError(message:String) + { + super(message); + } + + //-------------------------------------------------------------------------- + // + // Properties + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // responder + //---------------------------------- + + /** + * @private + */ + private var _responders:Array; + + /** + * An array of IResponder handlers that will be called when + * the asynchronous request completes. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public function get responders():Array + { + return _responders; + } + + //-------------------------------------------------------------------------- + // + // Methods + // + //-------------------------------------------------------------------------- + + /** + * <code>addResponder</code> adds a responder to an Array of responders. + * The object assigned to the responder parameter must implement the + * mx.rpc.IResponder interface. + * + * @param responder A handler which will be called when the asynchronous request completes. + * + * @see mx.rpc.IResponder + * @see mx.collections.ItemResponder + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public function addResponder(responder:IResponder):void + { + if (!_responders) + _responders = []; + + _responders.push(responder); + } +} + +} diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/controls/scrollClasses/ScrollThumb.as b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/scrollClasses/ScrollThumb.as new file mode 100644 index 0000000..ea1e28b --- /dev/null +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/controls/scrollClasses/ScrollThumb.as @@ -0,0 +1,230 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 mx.controls.scrollClasses +{ + +import flash.events.MouseEvent; +import flash.geom.Point; +import mx.controls.Button; +import mx.core.mx_internal; +import mx.events.ScrollEventDetail; +import mx.managers.ISystemManager; + +use namespace mx_internal; + +/** + * The ScrollThumb class defines the thumb of a ScrollBar control. + * + * @see mx.controls.scrollClasses.ScrollBar + * @see mx.controls.HScrollBar + * @see mx.controls.VScrollBar + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ +public class ScrollThumb extends Button +{ + include "../../core/Version.as"; + + //-------------------------------------------------------------------------- + // + // Constructor + // + //-------------------------------------------------------------------------- + + /** + * Constructor. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public function ScrollThumb() + { + super(); + + explicitMinHeight = 10; + + stickyHighlighting = true; + } + + //-------------------------------------------------------------------------- + // + // Variables + // + //-------------------------------------------------------------------------- + + /** + * @private + */ + private var ymin:Number; + + /** + * @private + */ + private var ymax:Number; + + /** + * @private + */ + private var datamin:Number; + + /** + * @private + */ + private var datamax:Number; + + /** + * @private + * Last position of the thumb. + */ + private var lastY:Number; + + //-------------------------------------------------------------------------- + // + // Overridden methods: Button + // + //-------------------------------------------------------------------------- + + /** + * @private + */ + override mx_internal function buttonReleased():void + { + super.buttonReleased(); + + stopDragThumb(); + } + + //-------------------------------------------------------------------------- + // + // Methods + // + //-------------------------------------------------------------------------- + + /** + * @private + * Set the range of motion for the thumb: + * how far it can move and what data values that covers. + */ + mx_internal function setRange(ymin:Number, ymax:Number, + datamin:Number, datamax:Number):void + { + this.ymin = ymin; + this.ymax = ymax; + + this.datamin = datamin; + this.datamax = datamax; + } + + /** + * @private + * Stop dragging the thumb around. + */ + private function stopDragThumb():void + { + var scrollBar:ScrollBar = ScrollBar(parent); + + scrollBar.isScrolling = false; + + scrollBar.dispatchScrollEvent(scrollBar.oldPosition, + ScrollEventDetail.THUMB_POSITION); + + scrollBar.oldPosition = NaN; + + systemManager.getSandboxRoot().removeEventListener( + MouseEvent.MOUSE_MOVE, mouseMoveHandler, true); + + } + + //-------------------------------------------------------------------------- + // + // Overridden event handlers: Button + // + //-------------------------------------------------------------------------- + + /** + * @private + * User pressed on the thumb, so start tracking in case they drag it. + */ + override protected function mouseDownHandler(event:MouseEvent):void + { + super.mouseDownHandler(event); + + var scrollBar:ScrollBar = ScrollBar(parent); + scrollBar.oldPosition = scrollBar.scrollPosition; + + lastY = event.localY; + + systemManager.getSandboxRoot().addEventListener( + MouseEvent.MOUSE_MOVE, mouseMoveHandler, true); + + } + + //-------------------------------------------------------------------------- + // + // Event handlers + // + //-------------------------------------------------------------------------- + + /** + * @private + * Drag the thumb around and update the scroll bar accordingly. + */ + private function mouseMoveHandler(event:MouseEvent):void + { + if (ymin == ymax) + return; + + var pt:Point = new Point(event.stageX, event.stageY); + pt = globalToLocal(pt); + + var scrollMove:Number = pt.y - lastY; + scrollMove += y; + + if (scrollMove < ymin) + scrollMove = ymin; + else if (scrollMove > ymax) + scrollMove = ymax; + + var scrollBar:ScrollBar = ScrollBar(parent); + + scrollBar.isScrolling = true; + + $y = scrollMove; + + // In an ideal world, this would probably dispatch an event, + // however this object is rather hardwired into a scroll bar + // so we'll just have it tell the scroll bar to change its position. + var oldPosition:Number = scrollBar.scrollPosition; + var pos:Number = Math.round( + (datamax - datamin) * (y - ymin) / (ymax - ymin)) + datamin; + scrollBar.scrollPosition = pos; + scrollBar.dispatchScrollEvent(oldPosition, + ScrollEventDetail.THUMB_TRACK); + event.updateAfterEvent(); + } + +} + +} diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/effects/IEffect.as b/frameworks/projects/MXRoyale/src/main/royale/mx/effects/IEffect.as new file mode 100644 index 0000000..0fd3bdf --- /dev/null +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/effects/IEffect.as @@ -0,0 +1,692 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 mx.effects +{ + +import flash.events.Event; +import flash.events.IEventDispatcher; + +/** + * The IEffect interface defines the base + * interface of all Flex effects. + * The IEffectInstance interface defines the base interface for all effect + * instance subclasses. + * + * @see mx.effects.IEffectInstance + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ +public interface IEffect extends IAbstractEffect +{ + //-------------------------------------------------------------------------- + // + // Properties + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // className + //---------------------------------- + + /** + * The name of the effect class, such as <code>"Fade"</code>. + * + * <p>This is a short, or unqualified, class name + * that does not include the package name. + * If you need the qualified name, use the + * <code>getQualifiedClassName()</code> method + * in the flash.utils package.</p> + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get className():String; + + //---------------------------------- + // customFilter + //---------------------------------- + + /** + * Specifies a custom filter object, of type EffectTargetFilter, + * used by the effect to determine the targets + * on which to play the effect. + * + * <p>Target filtering is only performed if you call the + * <code>captureStartValues()</code> method before playing the effect. + * Flex automatically calls the <code>captureStartValues()</code> method + * when the effect is part of a transition.</p> + * + * <p>Use the <code>filter</code> property for simple filtering. + * If the <code>customFilter</code> property is non-null, + * the <code>filter</code> property is ignored.</p> + * + * @default null + * + * @see mx.effects.EffectTargetFilter + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get customFilter():EffectTargetFilter; + + /** + * @private + */ + function set customFilter(value:EffectTargetFilter):void; + + //---------------------------------- + // duration + //---------------------------------- + + /** + * Duration of the effect in milliseconds. + * + * <p>In a Parallel or Sequence effect, the <code>duration</code> + * property sets the duration of each effect. + * For example, if a Sequence effect has its <code>duration</code> + * property set to 3000, each effect in the Sequence takes 3000 ms + * to play.</p> + * + * <p>For a repeated effect, the <code>duration</code> property + * specifies the duration of a single instance of the effect. + * Therefore, if an effect has a <code>duration</code> property + * set to 2000, and a <code>repeatCount</code> property set to 3, + * the effect takes a total of 6000 ms (6 seconds) to play.</p> + * + * @default 500 + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get duration():Number; + + /** + * @private + */ + function set duration(value:Number):void; + + //---------------------------------- + // effectTargetHost + //---------------------------------- + + /** + * A property that lets you access the target list-based control + * of a data effect. + * This property enables an instance of an effect class to communicate + * with the list-based control on which the effect is playing. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get effectTargetHost():IEffectTargetHost; + + /** + * @private + */ + function set effectTargetHost(value:IEffectTargetHost):void; + + //---------------------------------- + // filter + //---------------------------------- + + /** + * Specifies an algorithm for filtering targets for an effect. + * A value of <code>null</code> specifies no filtering. + * + * <p>Target filtering is only performed if you call the + * <code>captureStartValues()</code> method before playing the effect. + * Flex automatically calls the <code>captureStartValues()</code> method + * when the effect is part of a transition, or part of a data effect + * for a list-based control.</p> + * + * <p>Use this property for simple filtering. + * Use the <code>customFilter</code> property for more complex filtering. + * If the <code>customFilter</code> property has a non-null value, + * this property is ignored.</p> + * + * <p>You can use the following values for the <code>filter</code> + * property:</p> + * + * <ul> + * <li>A value of <code>"add"</code> plays the effect on any targets + * that are added as a child to a container.</li> + * <li>A value of <code>"addItem"</code> plays the effect + * on the item renderer for any list items added to a List + * or TileList control.</li> + * <li>A value of <code>"hide"</code> plays the effect on any targets + * whose visible property changed from <code>true</code> to + * <code>false</code>.</li> + * <li>A value of <code>"move"</code> plays the effect on any targets + * that changed their <code>x</code> or <code>y</code> + * properties.</li> + * <li>A value of <code>"remove"</code> plays the effect on any targets + * that are removed as a child of a container.</li> + * <li>A value of <code>"removeItem"</code> plays the effect + * on the item renderer for any list items removed from a List + * or TileList control.</li> + * <li>A value of <code>"replacedItem"</code> plays the effect + * on the item renderer for any list items replaced in a List + * or TileList control by a new item.</li> + * <li>A value of <code>"replacementItem"</code> plays the effect + * on the item renderer for any list items added to a List + * or TileList control that replaces an existing item.</li> + * <li>A value of <code>"resize"</code> plays the effect + * on any targets that changed their <code>width</code> + * or <code>height</code> properties.</li> + * <li>A value of <code>"show"</code> plays the effect + * on any targets whose visible property changed + * from <code>false</code> to <code>true</code>.</li> + * <li>A value of <code>""</code> specifies no filtering.</li> + * </ul> + * + * @default null + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get filter():String; + + /** + * @private + */ + function set filter(value:String):void; + + //---------------------------------- + // hideFocusRing + //---------------------------------- + + /** + * Determines whether the effect should hide the focus ring + * when starting the effect. + * The effect target is responsible for the hiding the focus ring. + * Subclasses of the UIComponent class hide the focus ring automatically. + * If the effect target is not a subclass of the UIComponent class, + * add functionality to it to hide the focus ring. + * + * <p>Set this property to <code>true</code> + * to hide the focus ring during the effect.</p> + * + * <p>For subclasses of Effect, the default value is <code>false</code>. + * For subclasses of MaskEffect, the default value is <code>true</code>. + * </p> + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get hideFocusRing():Boolean; + + /** + * @private + */ + function set hideFocusRing(value:Boolean):void; + + //---------------------------------- + // isPlaying + //---------------------------------- + + /** + * A read-only flag which is true if any instances of the effect + * are currently playing, and false if none are. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get isPlaying():Boolean; + + //---------------------------------- + // perElementOffset + //---------------------------------- + + /** + * Additional delay, in milliseconds, for effect targets + * after the first target of the effect. + * This value is added to the value + * of the <code>startDelay</code> property. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get perElementOffset():Number; + + /** + * @private + */ + function set perElementOffset(value:Number):void; + + //---------------------------------- + // relevantProperties + //---------------------------------- + + /** + * An Array of property names to use when performing filtering. + * This property is used internally and should not be set by + * effect users. + * + * <p>The default value is equal to the Array returned by + * the <code>getAffectedProperties()</code> method.</p> + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get relevantProperties():Array /* of String */; + + /** + * @private + */ + function set relevantProperties(values:Array /* of String */):void; + + //---------------------------------- + // relevantStyles + //---------------------------------- + + /** + * An Array of style names to use when performing filtering. + * This property is used internally and should not be set by + * effect users. + * + * <p>The default value is equal to the Array returned by + * the <code>getAffectedProperties()</code> method.</p> + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get relevantStyles():Array /* of String */; + + /** + * @private + */ + function set relevantStyles(values:Array /* of String */):void; + + + //---------------------------------- + // target + //---------------------------------- + + /** + * The object to which this effect is applied. + * When an effect is triggered by an effect trigger, + * the <code>target</code> property is automatically set to be + * the object that triggers the effect. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get target():Object; + + /** + * @private + */ + function set target(value:Object):void; + + //---------------------------------- + // targets + //---------------------------------- + + /** + * An Array of objects that are targets for the effect. + * When the effect is playing, it performs the effect on each target + * in parallel. + * Setting the <code>target</code> property replaces all objects + * in this Array. + * When the <code>targets</code> property is set, the <code>target</code> + * property returns the first item in this Array. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get targets():Array; + + /** + * @private + */ + function set targets(value:Array):void; + + //---------------------------------- + // triggerEvent + //---------------------------------- + + /** + * The Event object passed to this Effect + * by the EffectManager when an effect is triggered, + * or <code>null</code> if the effect is not being + * played by the EffectManager. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get triggerEvent():Event; + + /** + * @private + */ + function set triggerEvent(value:Event):void; + + //---------------------------------- + // playheadTime + //---------------------------------- + + /** + * Current time position of the effect. + * This property has a value between 0 and the total duration, + * which includes the Effect's <code>startDelay</code>, + * <code>repeatCount</code>, and <code>repeatDelay</code>. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function get playheadTime():Number; + + /** + * @private + */ + function set playheadTime(value:Number):void; + + //-------------------------------------------------------------------------- + // + // Methods + // + //-------------------------------------------------------------------------- + + /** + * Returns an Array of Strings, where each String is the name + * of a property changed by this effect. + * For example, the Move effect returns an Array that contains + * <code>"x"</code> and <code>"y"</code>. + * + * <p>Every subclass of Effect must implement this method. + * The EffectManager uses this method + * to ensure that no two effects are trying to animate + * the same property of the same object at the same time.</p> + * + * @return An Array of Strings specifying the names of the + * properties modified by this effect. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function getAffectedProperties():Array /* of String */; + + /** + * Takes an Array of target objects and invokes the + * <code>createInstance()</code> method on each target. + * + * @param targets Array of objects to animate with this effect. + * + * @return Array of effect instance objects, one per target, + * for the effect. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function createInstances(targets:Array = null):Array /* of EffectInstance */; + + /** + * Creates a single effect instance and initializes it. + * Use this method instead of the <code>play()</code> method + * to manipulate the effect instance properties + * before the effect instance plays. + * + * <p>The effect instance is created with the type + * specified in the <code>instanceClass</code> property. + * It is then initialized using the <code>initInstance()</code> method. + * If the instance was created by the EffectManager + * (when the effect is triggered by an effect trigger), + * the effect is further initialized by a call to the + * <code>EffectInstance.initEffect()</code> method.</p> + * + * <p>Calling the <code>createInstance()</code> method + * does not play the effect. + * Call the <code>startEffect()</code> method + * on the returned effect instance. </p> + * + * <p>This function is automatically called by the + * <code>Effect.play()</code> method. </p> + * + * @param target Object to animate with this effect. + * + * @return The effect instance object for the effect. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function createInstance(target:Object = null):IEffectInstance; + + /** + * Removes event listeners from an instance + * and removes it from the list of instances. + * + * @param instance The effect instance. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function deleteInstance(instance:IEffectInstance):void; + + /** + * Begins playing the effect. + * You typically call the <code>end()</code> method + * before you call the <code>play()</code> method + * to ensure that any previous instance of the effect + * has ended before you start a new one. + * + * <p>All subclasses must implement this method.</p> + * + * @param targets Array of target objects on which to play this effect. + * If this parameter is specified, then the effect's <code>targets</code> + * property is not used. + * + * @param playReversedFromEnd If <code>true</code>, + * play the effect backwards. + * + * @return Array of EffectInstance objects, one per target, + * for the effect. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function play(targets:Array = null, + playReversedFromEnd:Boolean = false): + Array /* of EffectInstance */; + + /** + * Pauses the effect until you call the <code>resume()</code> method. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function pause():void; + + /** + * Stops the effect, leaving the effect targets in their current state. + * Unlike a call to the <code>pause()</code> method, + * you cannot call the <code>resume()</code> method after calling + * the <code>stop()</code> method. + * However, you can call the <code>play()</code> method to restart the effect. + * + * <p>The effect instance dispatches an <code>effectEnd</code> event + * when you call this method as part of ending the effect.</p> + * + * <p>For mask effects, the mask is not removed automatically + * when the effect is stopped. + * Running further mask effects on the same target(s) + * without first removing the mask can produce unexpected results.</p> + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function stop():void; + + /** + * Resumes the effect after it has been paused + * by a call to the <code>pause()</code> method. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function resume():void; + + /** + * Plays the effect in reverse, if the effect is currently playing, + * starting from the current position of the effect. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function reverse():void; + + /** + * Interrupts an effect that is currently playing, + * and jumps immediately to the end of the effect. + * Calling this method invokes the <code>EffectInstance.end()</code> + * method. + * + * <p>The effect instance dispatches an <code>effectEnd</code> event + * when you call this method as part of ending the effect.</p> + * + * <p>If you pass an effect instance as an argument, + * just that instance is interrupted. + * If no argument is passed in, all effect instances currently + * spawned from the effect are interrupted.</p> + * + * @param effectInstance EffectInstance to terminate. + * + * @see mx.effects.EffectInstance#end() + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function end(effectInstance:IEffectInstance = null):void; + + /** + * Captures the current values of the relevant properties + * on the effect's targets. + * Flex automatically calls the <code>captureStartValues()</code> + * method when the effect is part of a transition. + * + * <p>Use this function when you want the effect to figure out the start + * and end values of the effect. + * The proper usage of this function is to use it + * in the following steps:</p> + * + * <ol> + * <li>Call the <code>captureStartValues()</code> method. + * The effect captures the starting effect values.</li> + * <li>Make changes to your effect targets, such as + * adding/removing children, altering properties, + * changing location, or changing dimensions.</li> + * <li>Call the <code>play()</code> method. + * The effect captures the end values. + * This function populates the + * <code>EffectInstance.propertyChanges</code> property + * for each effect instance created by this effect. + * Effect developers can use the <code>propertyChanges</code> property + * to retrieve the start and end values for their effect.</li> + * </ol> + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function captureStartValues():void; + + /** + * Captures the current values of the relevant properties + * of an additional set of targets + * + * <p>Flex uses this function when a data change + * effect is run.</p> + * + * @param targets Array of targets for which values are captured + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function captureMoreStartValues(targets:Array):void; + + /** + * Captures the current values of the relevant properties + * on the effect's targets and saves them as end values. + * + * <p>Flex automatically calls the <code>captureEndValues()</code> method + * when the effect is part of a data change effect.</p> + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + function captureEndValues():void; +} + +} diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/events/RSLEvent.as b/frameworks/projects/MXRoyale/src/main/royale/mx/events/RSLEvent.as new file mode 100644 index 0000000..c34c4c8 --- /dev/null +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/events/RSLEvent.as @@ -0,0 +1,363 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 mx.events +{ + +import flash.display.LoaderInfo; +import flash.events.Event; +import flash.events.ProgressEvent; +import flash.net.URLRequest; + +/** + * The RSLEvent class represents an event object used by the + * DownloadProgressBar class when an RSL is being downloaded by the Preloader class. + * + * @see mx.preloaders.DownloadProgressBar + * @see mx.preloaders.Preloader + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ +public class RSLEvent extends ProgressEvent +{ + include "../core/Version.as"; + + //-------------------------------------------------------------------------- + // + // Class constants + // + //-------------------------------------------------------------------------- + + /** + * The <code>RSLEvent.RSL_ADD_PRELOADED</code> constant defines the value of the + * <code>type</code> property of the event object for an + * <code>rslAddPreloaded</code> event. This event is dispatched from an + * IFlexModuleFactory after a child IFlexModuleFactory preloads an RSL + * into its application domain. + * + * <p>The properties of the event object have the following values:</p> + * <table class="innertable"> + * <tr><th>Property</th><th>Value</th></tr> + * <tr><td><code>bubbles</code></td><td>false</td></tr> + * <tr><td><code>cancelable</code></td><td>false</td></tr> + * <tr><td><code>currentTarget</code></td><td>The Object that defines the + * event listener that handles the event. For example, if you use + * <code>myButton.addEventListener()</code> to register an event listener, + * myButton is the value of the <code>currentTarget</code>. </td></tr> + * <tr><td><code>loaderInfo</code></td><td>The LoaderInfo instance + * associated with this RSL.</td></tr> + * <tr><td><code>target</code></td><td>The Object that dispatched the event; + * it is not always the Object listening for the event. + * Use the <code>currentTarget</code> property to always access the + * Object listening for the event.</td></tr> + * </table> + * + * @eventType rslAddPreloaded + * + * @langversion 3.0 + * @playerversion Flash 10 + * @playerversion AIR 1.5 + * @productversion Flex 4.5 + */ + public static const RSL_ADD_PRELOADED:String = "rslAddPreloaded"; + + /** + * Dispatched when the RSL has finished downloading. + * The <code>RSLEvent.RSL_COMPLETE</code> constant defines the value of the + * <code>type</code> property of the event object for a <code>rslComplete</code> event. + * + * <p>The properties of the event object have the following values:</p> + * <table class="innertable"> + * <tr><th>Property</th><th>Value</th></tr> + * <tr><td><code>bubbles</code></td><td>false</td></tr> + * <tr><td><code>bytesLoaded</code></td><td>The number of bytes loaded.</td></tr> + * <tr><td><code>bytesTotal</code></td><td>The total number of bytes to load.</td></tr> + * <tr><td><code>cancelable</code></td><td>false</td></tr> + * <tr><td><code>currentTarget</code></td><td>The Object that defines the + * event listener that handles the event. For example, if you use + * <code>myButton.addEventListener()</code> to register an event listener, + * myButton is the value of the <code>currentTarget</code>. </td></tr> + * <tr><td><code>errorText</code></td><td>Empty</td></tr> + * <tr><td><code>isResourceModule</code></td><td>True if we loaded a resourceModule + * instead of an RSL</td></tr> + * <tr><td><code>rslIndex</code></td><td>The index number of the RSL + * currently being downloaded. </td></tr> + * <tr><td><code>rslTotal</code></td><td>The total number of RSLs + * being downloaded. </td></tr> + * <tr><td><code>target</code></td><td>The Object that dispatched the event; + * it is not always the Object listening for the event. + * Use the <code>currentTarget</code> property to always access the + * Object listening for the event.</td></tr> + * <tr><td><code>url</code></td><td>The URLRequest object that represents + * the location of the RSL being downloaded.</td></tr> + * </table> + * + * @eventType rslComplete + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public static const RSL_COMPLETE:String = "rslComplete"; + + /** + * Dispatched when there is an error downloading the RSL. + * The <code>RSLEvent.RSL_ERROR</code> constant defines the value of the + * <code>type</code> property of the event object for a <code>rslError</code> event. + * + * <p>The properties of the event object have the following values:</p> + * <table class="innertable"> + * <tr><th>Property</th><th>Value</th></tr> + * <tr><td><code>bubbles</code></td><td>false</td></tr> + * <tr><td><code>bytesLoaded</code></td><td>Empty</td></tr> + * <tr><td><code>bytesTotal</code></td><td>Empty</td></tr> + * <tr><td><code>cancelable</code></td><td>false</td></tr> + * <tr><td><code>currentTarget</code></td><td>The Object that defines the + * event listener that handles the event. For example, if you use + * <code>myButton.addEventListener()</code> to register an event listener, + * myButton is the value of the <code>currentTarget</code>. </td></tr> + * <tr><td><code>errorText</code></td>An error message.<td></td></tr> + * <tr><td><code>isResourceModule</code></td><td>True if we loaded a resourceModule + * instead of an RSL</td></tr> + * <tr><td><code>rslIndex</code></td><td>The index number of the RSL + * currently being downloaded. </td></tr> + * <tr><td><code>rslTotal</code></td><td>The total number of RSLs + * being downloaded. </td></tr> + * <tr><td><code>target</code></td><td>The Object that dispatched the event; + * it is not always the Object listening for the event. + * Use the <code>currentTarget</code> property to always access the + * Object listening for the event.</td></tr> + * <tr><td><code>url</code></td><td>The URLRequest object that represents + * the location of the RSL being downloaded.</td></tr> + * </table> + * + * @eventType rslError + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public static const RSL_ERROR:String = "rslError"; + + /** + * Dispatched when the RSL is downloading. + * The <code>RSLEvent.RSL_PROGRESS</code> constant defines the value of the + * <code>type</code> property of the event object for a <code>rslProgress</code> event. + * + * <p>The properties of the event object have the following values:</p> + * <table class="innertable"> + * <tr><th>Property</th><th>Value</th></tr> + * <tr><td><code>bubbles</code></td><td>false</td></tr> + * <tr><td><code>bytesLoaded</code></td><td>The number of bytes loaded.</td></tr> + * <tr><td><code>bytesTotal</code></td><td>The total number of bytes to load.</td></tr> + * <tr><td><code>cancelable</code></td><td>false</td></tr> + * <tr><td><code>currentTarget</code></td><td>The Object that defines the + * event listener that handles the event. For example, if you use + * <code>myButton.addEventListener()</code> to register an event listener, + * myButton is the value of the <code>currentTarget</code>. </td></tr> + * <tr><td><code>errorText</code></td>Empty<td></td></tr> + * <tr><td><code>isResourceModule</code></td><td>True if we loaded a resourceModule + * instead of an RSL</td></tr> + * <tr><td><code>rslIndex</code></td><td>The index number of the RSL + * currently being downloaded. </td></tr> + * <tr><td><code>rslTotal</code></td><td>The total number of RSLs + * being downloaded. </td></tr> + * <tr><td><code>target</code></td><td>The Object that dispatched the event; + * it is not always the Object listening for the event. + * Use the <code>currentTarget</code> property to always access the + * Object listening for the event.</td></tr> + * <tr><td><code>url</code></td><td>The URLRequest object that represents + * the location of the RSL being downloaded.</td></tr> + * </table> + * + * @eventType rslProgress + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public static const RSL_PROGRESS:String = "rslProgress"; + + //-------------------------------------------------------------------------- + // + // Constructor + // + //-------------------------------------------------------------------------- + + /** + * Constructor. + * + * @param type The type of the event. Possible values are: + * <ul> + * <li>"rslProgress" (<code>RSLEvent.RSL_PROGRESS</code>);</li> + * <li>"rslComplete" (<code>RSLEvent.RSL_COMPLETE</code>);</li> + * <li>"rslError" (<code>RSLEvent.RSL_ERROR</code>);</li> + * </ul> + * + * @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow. + * + * @param cancelable Determines whether the Event object can be cancelled. + * + * @param bytesLoaded The number of bytes loaded at the time the listener processes the event. + * + * @param bytesTotal The total number of bytes that will ultimately be loaded if the loading process succeeds. + * + * @param rslIndex The index number of the RSL relative to the total. This should be a value between 0 and <code>total - 1</code>. + * + * @param rslTotal The total number of RSLs being loaded. + * + * @param url The location of the RSL. + * + * @param errorText The error message of the error when type is RSLEvent.RSL_ERROR. + * + * @param isResourceModule True if the event occurred when loading a ResourceModule. + * + * @tiptext Constructor for <code>RSLEvent</code> objects. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public function RSLEvent(type:String, bubbles:Boolean = false, + cancelable:Boolean = false, + bytesLoaded:int = -1, bytesTotal:int = -1, + rslIndex:int = -1, rslTotal:int = -1, + url:URLRequest = null, errorText:String = null, + isResourceModule:Boolean = false, + loaderInfo:LoaderInfo = null) + { + super(type, bubbles, cancelable, bytesLoaded, bytesTotal); + + this.rslIndex = rslIndex; + this.rslTotal = rslTotal; + this.url = url; + this.errorText = errorText; + this.isResourceModule = isResourceModule; + this.loaderInfo = loaderInfo; + } + + //-------------------------------------------------------------------------- + // + // Properties + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // errorText + //---------------------------------- + + /** + * The error message if the type is RSL_ERROR; otherwise, it is null; + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public var errorText:String; + + //---------------------------------- + // isResourceModule + //---------------------------------- + + /** + * True if the event is for loading a resourceModule instead of an RSL + */ + public var isResourceModule:Boolean; + + //---------------------------------- + // loaderInfo + //---------------------------------- + + /** + * The loaderInfo associated with this event. This is only set in the + * RSLEvent.RSL_COMPLETE event. Otherwise loaderInfo will be null. + */ + public var loaderInfo:LoaderInfo; + + //---------------------------------- + // rslIndex + //---------------------------------- + + /** + * The index number of the RSL currently being downloaded. + * This is a number between 0 and <code>rslTotal - 1</code>. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public var rslIndex:int; + + //---------------------------------- + // rslTotal + //---------------------------------- + + /** + * The total number of RSLs being downloaded by the preloader + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public var rslTotal:int; + + //---------------------------------- + // url + //---------------------------------- + + /** + * The URLRequest object that represents the location + * of the RSL being downloaded. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public var url:URLRequest; + + //-------------------------------------------------------------------------- + // + // Overridden properties: Event + // + //-------------------------------------------------------------------------- + + /** + * @private + */ + override public function clone():Event + { + return new RSLEvent(type, bubbles, cancelable, + bytesLoaded, bytesTotal, rslIndex, + rslTotal, url, errorText, isResourceModule, + loaderInfo); + } +} + +} diff --git a/frameworks/projects/MXRoyale/src/main/royale/mx/skins/halo/DataGridHeaderSeparator.as b/frameworks/projects/MXRoyale/src/main/royale/mx/skins/halo/DataGridHeaderSeparator.as new file mode 100644 index 0000000..0f3d621 --- /dev/null +++ b/frameworks/projects/MXRoyale/src/main/royale/mx/skins/halo/DataGridHeaderSeparator.as @@ -0,0 +1,116 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 mx.skins.halo +{ + +import flash.display.Graphics; +import mx.skins.ProgrammaticSkin; + +/** + * The skin for the separator between column headers in a DataGrid. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ +public class DataGridHeaderSeparator extends ProgrammaticSkin +{ + include "../../core/Version.as"; + + //-------------------------------------------------------------------------- + // + // Constructor + // + //-------------------------------------------------------------------------- + + /** + * Constructor. + * + * @langversion 3.0 + * @playerversion Flash 9 + * @playerversion AIR 1.1 + * @productversion Flex 3 + */ + public function DataGridHeaderSeparator() + { + super(); + } + + //-------------------------------------------------------------------------- + // + // Overridden properties + // + //-------------------------------------------------------------------------- + + //---------------------------------- + // measuredWidth + //---------------------------------- + + /** + * @private + */ + override public function get measuredWidth():Number + { + return 2; + } + + //---------------------------------- + // measuredHeight + //---------------------------------- + + /** + * @private + */ + override public function get measuredHeight():Number + { + return 10; + } + + //-------------------------------------------------------------------------- + // + // Overridden methods + // + //-------------------------------------------------------------------------- + + /** + * @private + */ + override protected function updateDisplayList(w:Number, h:Number):void + { + super.updateDisplayList(w, h); + var g:Graphics = graphics; + + g.clear(); + + // Highlight + g.lineStyle(1, 0xFFFFFF, 0.5); + g.moveTo(0, 0); + g.lineTo(0, h); + g.lineStyle(1, getStyle("borderColor")); + g.moveTo(1, 0); + g.lineTo(1, h); + } + +} + +} + +
