Repository: flex-asjs Updated Branches: refs/heads/core_js_to_as [created] 91d942674
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/events/BrowserEvent.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/events/BrowserEvent.as b/frameworks/projects/Core/as/src/org/apache/flex/events/BrowserEvent.as new file mode 100644 index 0000000..1ef3923 --- /dev/null +++ b/frameworks/projects/Core/as/src/org/apache/flex/events/BrowserEvent.as @@ -0,0 +1,479 @@ +/** + * Licensed 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 org.apache.flex.events +{ + +import goog.events.BrowserEvent.MouseButton; + + [ExcludeClass] + COMPILE::AS3 + internal class BrowserEvent + { + } + + /** + * @fileoverview A patched, standardized event object for browser events. + * + * <pre> + * The patched event object contains the following members: + * - type {string} Event type, e.g. 'click' + * - timestamp {Date} A date object for when the event was fired + * - target {Object} The element that actually triggered the event + * - currentTarget {Object} The element the listener is attached to + * - relatedTarget {Object} For mouseover and mouseout, the previous object + * - offsetX {number} X-coordinate relative to target + * - offsetY {number} Y-coordinate relative to target + * - clientX {number} X-coordinate relative to viewport + * - clientY {number} Y-coordinate relative to viewport + * - screenX {number} X-coordinate relative to the edge of the screen + * - screenY {number} Y-coordinate relative to the edge of the screen + * - button {number} Mouse button. Use isButton() to test. + * - keyCode {number} Key-code + * - ctrlKey {boolean} Was ctrl key depressed + * - altKey {boolean} Was alt key depressed + * - shiftKey {boolean} Was shift key depressed + * - metaKey {boolean} Was meta key depressed + * - defaultPrevented {boolean} Whether the default action has been prevented + * - state {Object} History state object + * + * NOTE: The keyCode member contains the raw browser keyCode. For normalized + * key and character code use {@link goog.events.KeyHandler}. + * </pre> + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + COMPILE::JS + public class BrowserEvent + { + + //-------------------------------------- + // Property + //-------------------------------------- + + /** + * @type {?goog.events.BrowserEvent} + */ + public var wrappedEvent:goog.events.BrowserEvent; + + //-------------------------------------- + // Function + //-------------------------------------- + + /** + * Was altKey key depressed. + * @type {boolean} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get altKey():Boolean + { + return wrappedEvent.altKey; + } + + /** + * Which mouse button was pressed. + * @type {number} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get button():uint + { + return wrappedEvent.button; + } + + /** + * CharCode of key press. + * Native browser event.charCode || (type == 'keypress' ? event.keyCode : 0); + * @type {number} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get charCode():uint + { + return wrappedEvent.charCode; + } + + /** + * X-coordinate relative to the window. + * @type {number} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get clientX():Number + { + return wrappedEvent.clientX; + } + + /** + * Y-coordinate relative to the window. + * @type {number} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get clientY():Number + { + return wrappedEvent.clientY; + } + + /** + * Was ctrl key depressed. + * @type {boolean} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get ctrlKey():Boolean + { + return wrappedEvent.ctrlKey; + } + + /** + * The element the listener is attached to. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get currentTarget():Object + { + var o:Object = wrappedEvent.currentTarget; + + if (o && o.flexjs_wrapper) + return o.flexjs_wrapper; + return o; + } + + /** + * Whether the default action has been prevented. + * @type {boolean} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get defaultPrevented():Boolean + { + return wrappedEvent.defaultPrevented; + } + + /** + * The underlying browser event object. + * (for debugging purposes) + * + * @return The underlying browser event object. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function getBrowserEvent():Object + { + return wrappedEvent.getBrowserEvent(); + } + + /** + * Tests to see which button was pressed during the event. This is really only + * useful in IE and Gecko browsers. And in IE, it's only useful for + * mousedown/mouseup events, because click only fires for the left mouse button. + * + * Safari 2 only reports the left button being clicked, and uses the value '1' + * instead of 0. Opera only reports a mousedown event for the middle button, and + * no mouse events for the right button. Opera has default behavior for left and + * middle click that can only be overridden via a configuration setting. + * + * There's a nice table of this mess at http://www.unixpapa.com/js/mouse.html. + * + * @param button The button to test for. + * @return True if button was pressed. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function isButton(button:MouseButton):Boolean + { + return wrappedEvent.isButton(button); + } + + /** + * Whether this has an "action"-producing mouse button. + * + * By definition, this includes left-click on windows/linux, and left-click + * without the ctrl key on Macs. + * + * @return The result. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function isMouseActionButton():Boolean + { + wrappedEvent.isMouseActionButton(); + } + + /** + * Keycode of key press. + * Native browser event.keyCode || 0; + * @type {number} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get keyCode():uint + { + return wrappedEvent.keyCode; + } + + /** + * Whether the meta key was pressed at time of event. + * @type {boolean} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get metaKey():Boolean + { + return wrappedEvent.metaKey; + } + + /** + * X-coordinate relative to target. + * @type {number} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get offsetX():Number + { + return wrappedEvent.offsetX; + } + + /** + * Y-coordinate relative to target. + * @type {number} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get offsetY():Number + { + return wrappedEvent.offsetY; + } + + /** + * Whether the default platform modifier key was pressed at time of event. + * (This is control for all platforms except Mac, where it's Meta.) + * @type {boolean} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get platformModifierKey():Boolean + { + return platformModifierKey; + } + + /** + * Whether the default action has been prevented. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function preventDefault():void + { + wrappedEvent.preventDefault(); + } + + /** + * For mouseover and mouseout, the previous object. + * @type {object} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get relatedTarget():Object + { + var o:Object = wrappedEvent.relatedTarget; + + if (o && o.flexjs_wrapper) + return o.flexjs_wrapper; + return o; + } + + /** + * X-coordinate relative to the monitor. + * @type {number} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get screenX():Number + { + return wrappedEvent.screenX; + } + + /** + * Y-coordinate relative to the monitor. + * @type {number} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get screenY():Number + { + return wrappedEvent.screenY; + } + + /** + * Was shiftKey key depressed. + * @type {boolean} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get shiftKey():Boolean + { + return wrappedEvent.shiftKey; + } + + /** + * History state object, only set for PopState events where it's a copy of the + * state object provided to pushState or replaceState. + * @type {Object} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get state():Object + { + return wrappedEvent.state; + } + + /** + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function stopImmediatePropagation():void + { + //wrappedEvent.stopImmediatePropagation(); // not in goog.events.BrowserEvent + wrappedEvent.stopPropagation(); + } + + /** + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function stopPropagation():void + { + wrappedEvent.stopPropagation(); + } + + /** + * The element that actually triggered the event. + * @type {object} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get target():Object + { + var o:Object = wrappedEvent.target; + + if (o && o.flexjs_wrapper) + return o.flexjs_wrapper; + return o; + } + + /** + * A date object for when the event was fired. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get timestamp():Date + { + return wrappedEvent.timestamp; + } + + /** + * Event type, e.g. 'click'. + * @type {string} + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function get type():String + { + return wrappedEvent.type; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/events/CustomEvent.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/events/CustomEvent.as b/frameworks/projects/Core/as/src/org/apache/flex/events/CustomEvent.as index 3a291dc..880e860 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/events/CustomEvent.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/events/CustomEvent.as @@ -1,5 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// // + // 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. @@ -18,33 +19,40 @@ //////////////////////////////////////////////////////////////////////////////// package org.apache.flex.events { + /** - * MXML auto-imports flash.events.Event which then requires - * full qualification to use org.apache.flex.events.Event. - * Use CustomEvent to skip all that extra typing. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 + * MXML auto-imports flash.events.Event which then requires + * full qualification to use org.apache.flex.events.Event. + * Use CustomEvent to skip all that extra typing. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class CustomEvent extends Event { - /** - * Constructor. - * - * @param type The name of the event. - * @param bubbles Whether the event bubbles. - * @param cancelable Whether the event can be canceled. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ + + //-------------------------------------- + // Constructor + //-------------------------------------- + + /** + * Constructor. + * + * @param type The name of the event. + * @param bubbles Whether the event bubbles. + * @param cancelable Whether the event can be canceled. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ public function CustomEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false) { super(type, bubbles, cancelable); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/events/ElementEvents.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/events/ElementEvents.as b/frameworks/projects/Core/as/src/org/apache/flex/events/ElementEvents.as new file mode 100644 index 0000000..9fbc602 --- /dev/null +++ b/frameworks/projects/Core/as/src/org/apache/flex/events/ElementEvents.as @@ -0,0 +1,40 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 org.apache.flex.events +{ + + COMPILE::JS + public class ElementEvents + { + + //-------------------------------------- + // Static Property + //-------------------------------------- + + static public const elementEvents:Object = { + 'mouseover': 1, + 'mouseout': 1, + 'mouseup': 1, + 'mousedown': 1, + 'mousemove': 1, + 'rollover': 1, + 'rollout': 1 + }; + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/events/Event.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/events/Event.as b/frameworks/projects/Core/as/src/org/apache/flex/events/Event.as index 53a6f41..03b4812 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/events/Event.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/events/Event.as @@ -18,61 +18,97 @@ //////////////////////////////////////////////////////////////////////////////// package org.apache.flex.events { - import flash.events.Event; - +import goog.events.Event; + + COMPILE::AS3 { + import flash.events.Event; + } + /** - * This class simply wraps flash.events.Event so that - * no flash packages are needed on the JS side. - * At runtime, this class is not always the event object - * that is dispatched. In most cases we are dispatching - * DOMEvents instead, so as long as you don't actually - * check the typeof(event) it will work - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 + * This class simply wraps flash.events.Event so that + * no flash packages are needed on the JS side. + * At runtime, this class is not always the event object + * that is dispatched. In most cases we are dispatching + * DOMEvents instead, so as long as you don't actually + * check the typeof(event) it will work + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class Event extends flash.events.Event { - public static const CHANGE:String = "change"; - /** - * Constructor. - * - * @param type The name of the event. - * @param bubbles Whether the event bubbles. - * @param cancelable Whether the event can be canceled. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function Event(type:String, bubbles:Boolean=false, cancelable:Boolean=false) + //-------------------------------------- + // Static Property + //-------------------------------------- + + static public const CHANGE:String = "change"; + + //-------------------------------------- + // Constructor + //-------------------------------------- + + /** + * Constructor. + * + * @param type The name of the event. + * @param bubbles Whether the event bubbles. + * @param cancelable Whether the event can be canceled. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function Event(type:String, bubbles:Boolean = false, cancelable:Boolean = false) { super(type, bubbles, cancelable); } - - /** - * @private - */ - override public function clone():flash.events.Event - { - return cloneEvent(); - } - - /** - * Create a copy/clone of the Event object. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function cloneEvent():org.apache.flex.events.Event - { - return new org.apache.flex.events.Event(type, bubbles, cancelable); - } + + //-------------------------------------- + // Property + //-------------------------------------- + + //-------------------------------------- + // Function + //-------------------------------------- + + /** + * @private + */ + public override function clone():flash.events.Event + { + return cloneEvent(); + } + + /** + * Create a copy/clone of the Event object. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function cloneEvent():org.apache.flex.events.Event + { + return new org.apache.flex.events.Event(type, bubbles, cancelable); + } } -} \ No newline at end of file + + COMPILE::JS + public class Event extends goog.events.Event { + + public static const CHANGE:String = "change"; + + public function Event(type:String, target:Object = null) { + super(type, target); + } + + public function init(type:String):void { + this.type = type; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/events/EventDispatcher.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/events/EventDispatcher.as b/frameworks/projects/Core/as/src/org/apache/flex/events/EventDispatcher.as index d0b268a..afe1bcb 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/events/EventDispatcher.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/events/EventDispatcher.as @@ -18,30 +18,66 @@ //////////////////////////////////////////////////////////////////////////////// package org.apache.flex.events { - import flash.events.EventDispatcher; - + COMPILE::JS + { + import goog.events.EventTarget; + } + + COMPILE::AS3 + { + import flash.events.EventDispatcher; + } + /** - * This class simply wraps flash.events.EventDispatcher so that - * no flash packages are needed on the JS side. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 + * This class simply wraps flash.events.EventDispatcher so that + * no flash packages are needed on the JS side. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class EventDispatcher extends flash.events.EventDispatcher implements IEventDispatcher { - /** - * Constructor. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ + /** + * Constructor. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ public function EventDispatcher() { super(); } - } -} \ No newline at end of file + } + + COMPILE::JS + public class EventDispatcher extends EventTarget implements IEventDispatcher + { + + override public function addEventListener(type:String, handler:Object, opt_capture:Boolean = false, opt_handlerScope:Object = null):void + { + super.addEventListener(type, handler, opt_capture, opt_handlerScope); + + const that:* = this; + var source:* = this; + + if (that.element && that.element.nodeName && + that.element.nodeName.toLowerCase() !== 'div' && + that.element.nodeName.toLowerCase() !== 'body') + { + source = that.element; + } + else if (ElementEvents.elementEvents[type]) + { + // mouse and keyboard events also dispatch off the element. + source = that.element; + } + + goog.events["listen"](source, type, handler); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/events/IEventDispatcher.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/events/IEventDispatcher.as b/frameworks/projects/Core/as/src/org/apache/flex/events/IEventDispatcher.as index a051942..97d8e59 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/events/IEventDispatcher.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/events/IEventDispatcher.as @@ -18,19 +18,29 @@ //////////////////////////////////////////////////////////////////////////////// package org.apache.flex.events { - import flash.events.IEventDispatcher; - + COMPILE::AS3 + { + import flash.events.IEventDispatcher; + } + /** - * This class simply wraps flash.events.EventDispatcher so that - * no flash packages are needed on the JS side. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 + * This class simply wraps flash.events.EventDispatcher so that + * no flash packages are needed on the JS side. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 */ + COMPILE::AS3 public interface IEventDispatcher extends flash.events.IEventDispatcher { - + + } + + COMPILE::JS + public interface IEventDispatcher + { + } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/events/MouseEvent.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/events/MouseEvent.as b/frameworks/projects/Core/as/src/org/apache/flex/events/MouseEvent.as index bd8baef..9a17235 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/events/MouseEvent.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/events/MouseEvent.as @@ -32,6 +32,7 @@ package org.apache.flex.events * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class MouseEvent extends Event { public static const MOUSE_DOWN:String = "mouseDown"; @@ -151,4 +152,4 @@ package org.apache.flex.events return _stagePoint.y; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/events/ValueChangeEvent.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/events/ValueChangeEvent.as b/frameworks/projects/Core/as/src/org/apache/flex/events/ValueChangeEvent.as index 7790767..9befb62 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/events/ValueChangeEvent.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/events/ValueChangeEvent.as @@ -29,6 +29,7 @@ package org.apache.flex.events * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class ValueChangeEvent extends Event { /** @@ -119,4 +120,4 @@ package org.apache.flex.events return event; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/events/ValueEvent.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/events/ValueEvent.as b/frameworks/projects/Core/as/src/org/apache/flex/events/ValueEvent.as index c4d11c2..e1f34a3 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/events/ValueEvent.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/events/ValueEvent.as @@ -28,6 +28,7 @@ package org.apache.flex.events * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class ValueEvent extends Event { /** @@ -56,4 +57,4 @@ package org.apache.flex.events public var value:Object; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/events/utils/MouseEventConverter.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/events/utils/MouseEventConverter.as b/frameworks/projects/Core/as/src/org/apache/flex/events/utils/MouseEventConverter.as index 8556c39..a969a44 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/events/utils/MouseEventConverter.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/events/utils/MouseEventConverter.as @@ -32,6 +32,7 @@ package org.apache.flex.events.utils * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class MouseEventConverter { /** @@ -162,4 +163,4 @@ package org.apache.flex.events.utils target.addEventListener(eventType, eventHandler, false, 9999); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/events/utils/MouseUtils.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/events/utils/MouseUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/events/utils/MouseUtils.as index 9ead0e5..c58122b 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/events/utils/MouseUtils.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/events/utils/MouseUtils.as @@ -29,6 +29,7 @@ package org.apache.flex.events.utils * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class MouseUtils { public function MouseUtils() @@ -100,4 +101,4 @@ package org.apache.flex.events.utils return event.screenY; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/geom/Point.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/geom/Point.as b/frameworks/projects/Core/as/src/org/apache/flex/geom/Point.as index 0753e67..462c3b1 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/geom/Point.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/geom/Point.as @@ -32,6 +32,7 @@ import flash.geom.Point; * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ +COMPILE::AS3 public class Point extends flash.geom.Point { public function Point(x:Number = 0, y:Number = 0) @@ -39,4 +40,4 @@ public class Point extends flash.geom.Point super(x, y); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/geom/Rectangle.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/geom/Rectangle.as b/frameworks/projects/Core/as/src/org/apache/flex/geom/Rectangle.as index ba81988..3fb403d 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/geom/Rectangle.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/geom/Rectangle.as @@ -32,6 +32,7 @@ import flash.geom.Rectangle; * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ +COMPILE::AS3 public class Rectangle extends flash.geom.Rectangle { public function Rectangle(x:Number = 0, y:Number = 0, width:Number = 0, height:Number = 0) @@ -39,4 +40,4 @@ public class Rectangle extends flash.geom.Rectangle super(x, y, width, height); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/states/AddItems.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/states/AddItems.as b/frameworks/projects/Core/as/src/org/apache/flex/states/AddItems.as index 1c26fd5..7b4a2bd 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/states/AddItems.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/states/AddItems.as @@ -37,6 +37,7 @@ package org.apache.flex.states * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class AddItems implements IDocument { /** @@ -98,4 +99,4 @@ package org.apache.flex.states return Object(this); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/states/ItemAndDescriptor.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/states/ItemAndDescriptor.as b/frameworks/projects/Core/as/src/org/apache/flex/states/ItemAndDescriptor.as index 58621f9..4116704 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/states/ItemAndDescriptor.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/states/ItemAndDescriptor.as @@ -31,6 +31,7 @@ package org.apache.flex.states * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class ItemAndDescriptor { /** @@ -67,4 +68,4 @@ package org.apache.flex.states public var descriptor:Array; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/states/SetEventHandler.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/states/SetEventHandler.as b/frameworks/projects/Core/as/src/org/apache/flex/states/SetEventHandler.as index 035309b..8865d9f 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/states/SetEventHandler.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/states/SetEventHandler.as @@ -34,6 +34,7 @@ package org.apache.flex.states * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class SetEventHandler implements IDocument { /** @@ -76,4 +77,4 @@ package org.apache.flex.states return Object(this); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/states/SetProperty.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/states/SetProperty.as b/frameworks/projects/Core/as/src/org/apache/flex/states/SetProperty.as index 56ba67c..0528bd7 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/states/SetProperty.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/states/SetProperty.as @@ -34,6 +34,7 @@ package org.apache.flex.states * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class SetProperty implements IDocument { /** @@ -78,4 +79,4 @@ package org.apache.flex.states return Object(this); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/states/State.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/states/State.as b/frameworks/projects/Core/as/src/org/apache/flex/states/State.as index dc620d1..0232505 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/states/State.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/states/State.as @@ -33,6 +33,7 @@ package org.apache.flex.states * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class State { /** @@ -80,4 +81,4 @@ package org.apache.flex.states */ public var overrides:Array; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/BeadMetrics.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/BeadMetrics.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/BeadMetrics.as index 93a7d59..89926e0 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/BeadMetrics.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/BeadMetrics.as @@ -30,6 +30,7 @@ import org.apache.flex.core.ValuesManager; * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ +COMPILE::AS3 public class BeadMetrics { @@ -145,4 +146,4 @@ public class BeadMetrics return result; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/BinaryData.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/BinaryData.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/BinaryData.as index b34f493..5feb0dc 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/BinaryData.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/BinaryData.as @@ -31,6 +31,7 @@ import flash.utils.ByteArray; * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ +COMPILE::AS3 public class BinaryData { /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as index 6e8a378..61fecc7 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/CSSBorderUtils.as @@ -36,6 +36,7 @@ package org.apache.flex.utils * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class CSSBorderUtils { /** @@ -215,4 +216,4 @@ package org.apache.flex.utils } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/EffectTimer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/EffectTimer.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/EffectTimer.as index 43794de..020919d 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/EffectTimer.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/EffectTimer.as @@ -51,6 +51,7 @@ import org.apache.flex.events.ValueEvent; * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ +COMPILE::AS3 public class EffectTimer extends EventDispatcher implements IEffectTimer { /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/Language.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/Language.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/Language.as new file mode 100644 index 0000000..d48b61c --- /dev/null +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/Language.as @@ -0,0 +1,318 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 org.apache.flex.utils +{ + + public class Language + { + + //-------------------------------------- + // Static Property + //-------------------------------------- + + //-------------------------------------- + // Static Function + //-------------------------------------- + + /** + * _as() + * + * @export + * @param {?} leftOperand The lefthand operand of the + * binary as operator in AS3. + * @param {?} rightOperand The righthand operand of the + * binary operator in AS3. + * @param {?=} coercion The cast is a coercion, + * throw expception if it fails. + * @return {?} Returns the lefthand operand if it is of the + * type of the righthand operand, otherwise null. + */ + static public function _as(leftOperand:Object, rightOperand:Object, coercion:* = null):Object + { + var error:Error, itIs:Boolean, message:String; + + coercion = (coercion !== undefined) ? coercion : false; + + itIs = _is(leftOperand, rightOperand); + + if (!itIs && coercion) + { + message = 'Type Coercion failed'; + + if (TypeError) + { + error = new TypeError(message); + } + else + { + error = new Error(message); + } + throw error; + } + + return (itIs) ? leftOperand : null; + } + + + /** + * int() + * + * @export + * @param {?} value The value to be cast. + * @return {number} + */ + static public function _int(value:Number):int + { + return value >> 0; + } + + /** + * _is() + * + * @export + * @param {?} leftOperand The lefthand operand of the + * binary as operator in AS3. + * @param {?} rightOperand The righthand operand of the + * binary operator in AS3. + * @return {boolean} + */ + static public function _is(leftOperand:Object, rightOperand:Object):Boolean + { + var checkInterfaces:Function, superClass:Object; + + if (!leftOperand) + return false; + + if (leftOperand && !rightOperand) + { + return false; + } + + checkInterfaces = function(left:Object) { + var i:uint, interfaces:Array; + + interfaces = left.FLEXJS_CLASS_INFO.interfaces; + for (i = interfaces.length - 1; i > -1; i--) { + if (interfaces[i] === rightOperand) { + return true; + } + + if (interfaces[i].prototype.FLEXJS_CLASS_INFO.interfaces) { + var isit:Boolean = checkInterfaces(new interfaces[i]()); + if (isit) return true; + } + } + + return false; + }; + + if ((rightOperand === String && typeof leftOperand === 'string') || + (leftOperand instanceof /** @type {Object} */(rightOperand))) + { + return true; + } + + if (typeof leftOperand === 'string') + return false; // right was not String otherwise exit above + + if (typeof leftOperand === 'number') + return rightOperand === Number; + + if (rightOperand === Array && Array.isArray(leftOperand)) + return true; + + if (leftOperand.FLEXJS_CLASS_INFO === undefined) + return false; // could be a function but not an instance + + if (leftOperand.FLEXJS_CLASS_INFO.interfaces) + { + if (checkInterfaces(leftOperand)) + { + return true; + } + } + + superClass = leftOperand.constructor.superClass_; + + if (superClass) + { + while (superClass && superClass.FLEXJS_CLASS_INFO) + { + if (superClass.FLEXJS_CLASS_INFO.interfaces) + { + if (checkInterfaces(superClass)) + { + return true; + } + } + superClass = superClass.constructor.superClass_; + } + } + + return false; + } + + /** + * postdecrement handles foo++ + * + * @export + * @param {Object} obj The object with the getter/setter. + * @param {string} prop The name of a property. + * @return {number} + */ + static public function postdecrement(obj:Object, prop:String):int + { + var value:int = obj[prop]; + obj[prop] = value - 1; + return value; + } + + /** + * postincrement handles foo++ + * + * @export + * @param {Object} obj The object with the getter/setter. + * @param {string} prop The name of a property. + * @return {number} + */ + static public function postincrement(obj:Object, prop:String):int + { + var value:int = obj[prop]; + obj[prop] = value + 1; + return value; + } + + /** + * predecrement handles ++foo + * + * @export + * @param {Object} obj The object with the getter/setter. + * @param {string} prop The name of a property. + * @return {number} + */ + static public function predecrement(obj:Object, prop:String):int + { + var value:int = obj[prop] - 1; + obj[prop] = value; + return value; + } + + /** + * preincrement handles --foo + * + * @export + * @param {Object} obj The object with the getter/setter. + * @param {string} prop The name of a property. + * @return {number} + */ + static public function preincrement(obj:Object, prop:String):int + { + var value:int = obj[prop] + 1; + obj[prop] = value; + return value; + } + + /** + * superGetter calls the getter on the given class' superclass. + * + * @export + * @param {Object} clazz The class. + * @param {Object} pthis The this pointer. + * @param {string} prop The name of the getter. + * @return {Object} + */ + static public function superGetter(clazz:Object, pthis:Object, prop:String):Object + { + var superClass:Object = clazz.superClass_; + var superdesc:Object = Object.getOwnPropertyDescriptor(superClass, prop); + + while (superdesc == null) + { + superClass = superClass.constructor.superClass_; + superdesc = Object.getOwnPropertyDescriptor(superClass, prop); + } + return superdesc.get.call(pthis); + } + + /** + * superSetter calls the setter on the given class' superclass. + * + * @export + * @param {Object} clazz The class. + * @param {Object} pthis The this pointer. + * @param {string} prop The name of the getter. + * @param {Object} value The value. + */ + static public function superSetter(clazz:Object, pthis:Object, prop:String, value:Object):void + { + var superClass:Object = clazz.superClass_; + var superdesc:Object = Object.getOwnPropertyDescriptor(superClass, prop); + + while (superdesc == null) + { + superClass = superClass.constructor.superClass_; + superdesc = Object.getOwnPropertyDescriptor(superClass, prop); + } + superdesc.set.apply(pthis, [value]); + } + + static public function trace(...rest):void + { + var theConsole:*; + + var msg:String = ''; + + for (var i:uint = 0; i < rest.length; i++) + { + if (i > 0) + msg += ' '; + msg += rest[i]; + } + + theConsole = ["goog"]["global"]["console"]; + + if (theConsole === undefined && window.console !== undefined) + theConsole = window.console; + + try + { + if (theConsole && theConsole.log) + { + theConsole.log(msg); + } + } + catch (e:Error) + { + // ignore; at least we tried ;-) + } + } + + /** + * uint() + * + * @export + * @param {?} value The value to be cast. + * @return {number} + */ + static public function uint(value:Number):uint + { + return value >>> 0; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/MXMLDataInterpreter.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/MXMLDataInterpreter.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/MXMLDataInterpreter.as index 89ce693..e800b8c 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/MXMLDataInterpreter.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/MXMLDataInterpreter.as @@ -40,6 +40,7 @@ import org.apache.flex.events.IEventDispatcher; * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ +COMPILE::AS3 public class MXMLDataInterpreter { /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/MixinManager.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/MixinManager.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/MixinManager.as index bbac35e..f57dc9f 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/MixinManager.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/MixinManager.as @@ -35,6 +35,7 @@ import org.apache.flex.core.IStrand; * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ +COMPILE::AS3 public class MixinManager implements IBead { /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/PNGEncoder.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/PNGEncoder.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/PNGEncoder.as index bd1fce4..d34ce13 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/PNGEncoder.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/PNGEncoder.as @@ -34,6 +34,7 @@ import flash.utils.ByteArray; * @playerversion AIR 1.1 * @productversion Flex 3 */ +COMPILE::AS3 public class PNGEncoder { http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/PointUtils.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/PointUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/PointUtils.as index 499db9f..e39e029 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/PointUtils.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/PointUtils.as @@ -33,6 +33,7 @@ package org.apache.flex.utils * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class PointUtils { /** @@ -77,4 +78,4 @@ package org.apache.flex.utils return new org.apache.flex.geom.Point(fpt.x, fpt.y); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as index 2c11b13..bb74b2a 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/SolidBorderUtil.as @@ -32,6 +32,7 @@ import flash.display.Graphics; * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ +COMPILE::AS3 public class SolidBorderUtil { /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/StringTrimmer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/StringTrimmer.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/StringTrimmer.as index b6de591..fe170df 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/StringTrimmer.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/StringTrimmer.as @@ -28,6 +28,7 @@ package org.apache.flex.utils * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class StringTrimmer { /** @@ -172,4 +173,4 @@ package org.apache.flex.utils } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/Timer.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/Timer.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/Timer.as index 2d8b075..9f462ef 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/Timer.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/Timer.as @@ -47,6 +47,7 @@ import org.apache.flex.events.Event; * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ +COMPILE::AS3 public class Timer extends flash.utils.Timer { /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/UIUtils.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/UIUtils.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/UIUtils.as index d76539c..57a0595 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/UIUtils.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/UIUtils.as @@ -31,6 +31,7 @@ package org.apache.flex.utils * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class UIUtils { /** @@ -104,4 +105,4 @@ package org.apache.flex.utils (start as IPopUpHost).removeElement(popUp); } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/ViewSourceContextMenuOption.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/ViewSourceContextMenuOption.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/ViewSourceContextMenuOption.as index 23a1324..da0b027 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/ViewSourceContextMenuOption.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/ViewSourceContextMenuOption.as @@ -40,6 +40,7 @@ import org.apache.flex.core.IStrand; * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ +COMPILE::AS3 public class ViewSourceContextMenuOption implements IBead { /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/as/src/org/apache/flex/utils/dbg/DOMPathUtil.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/as/src/org/apache/flex/utils/dbg/DOMPathUtil.as b/frameworks/projects/Core/as/src/org/apache/flex/utils/dbg/DOMPathUtil.as index 8e783ac..3b3da0e 100644 --- a/frameworks/projects/Core/as/src/org/apache/flex/utils/dbg/DOMPathUtil.as +++ b/frameworks/projects/Core/as/src/org/apache/flex/utils/dbg/DOMPathUtil.as @@ -35,6 +35,7 @@ package org.apache.flex.utils.dbg * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class DOMPathUtil { /** @@ -91,4 +92,4 @@ package org.apache.flex.utils.dbg return name; } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/asjs/src/CoreASJSClasses.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/asjs/src/CoreASJSClasses.as b/frameworks/projects/Core/asjs/src/CoreASJSClasses.as index ef6790d..46c1be8 100644 --- a/frameworks/projects/Core/asjs/src/CoreASJSClasses.as +++ b/frameworks/projects/Core/asjs/src/CoreASJSClasses.as @@ -18,11 +18,10 @@ //////////////////////////////////////////////////////////////////////////////// package { - /** * @private * This class is used to link additional classes into rpc.swc - * beyond those that are found by dependecy analysis starting + * beyond those that are found by dependency analysis starting * from the classes specified in manifest.xml. */ internal class CoreASJSClasses @@ -34,6 +33,5 @@ internal class CoreASJSClasses import org.apache.flex.core.ParentDocumentBead; ParentDocumentBead; import org.apache.flex.utils.CSSUtils; CSSUtils; } - } http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/asjs/src/org/apache/flex/core/BindableCSSStyles.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/asjs/src/org/apache/flex/core/BindableCSSStyles.as b/frameworks/projects/Core/asjs/src/org/apache/flex/core/BindableCSSStyles.as index 9f8ac05..71feda5 100644 --- a/frameworks/projects/Core/asjs/src/org/apache/flex/core/BindableCSSStyles.as +++ b/frameworks/projects/Core/asjs/src/org/apache/flex/core/BindableCSSStyles.as @@ -31,6 +31,7 @@ package org.apache.flex.core * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class BindableCSSStyles extends EventDispatcher { /** @@ -102,4 +103,4 @@ package org.apache.flex.core [Bindable] public var borderWidth:*; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridLayout.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridLayout.as b/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridLayout.as index d50bc27..cf74612 100644 --- a/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridLayout.as +++ b/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridLayout.as @@ -28,6 +28,7 @@ package org.apache.flex.core * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public interface IDataGridLayout extends IBeadLayout { /** @@ -52,4 +53,4 @@ package org.apache.flex.core function get columns():Array; function set columns(value:Array):void; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridModel.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridModel.as b/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridModel.as index 5ac0584..72eb394 100644 --- a/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridModel.as +++ b/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridModel.as @@ -28,6 +28,7 @@ package org.apache.flex.core * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public interface IDataGridModel extends ISelectionModel { /** @@ -41,4 +42,4 @@ package org.apache.flex.core function get columns():Array; function set columns(value:Array):void; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridPresentationModel.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridPresentationModel.as b/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridPresentationModel.as index 7307148..8fe7733 100644 --- a/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridPresentationModel.as +++ b/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDataGridPresentationModel.as @@ -29,6 +29,7 @@ package org.apache.flex.core * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public interface IDataGridPresentationModel extends IListPresentationModel { /** http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDateChooserModel.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDateChooserModel.as b/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDateChooserModel.as index 7944591..be337fc 100644 --- a/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDateChooserModel.as +++ b/frameworks/projects/Core/asjs/src/org/apache/flex/core/IDateChooserModel.as @@ -28,6 +28,7 @@ package org.apache.flex.core * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public interface IDateChooserModel extends IEventDispatcher, IBeadModel { /** @@ -98,4 +99,4 @@ package org.apache.flex.core function get selectedDate():Date; function set selectedDate(value:Date):void; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/asjs/src/org/apache/flex/core/ParentDocumentBead.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/asjs/src/org/apache/flex/core/ParentDocumentBead.as b/frameworks/projects/Core/asjs/src/org/apache/flex/core/ParentDocumentBead.as index 77c0c4c..d466b5f 100644 --- a/frameworks/projects/Core/asjs/src/org/apache/flex/core/ParentDocumentBead.as +++ b/frameworks/projects/Core/asjs/src/org/apache/flex/core/ParentDocumentBead.as @@ -42,6 +42,7 @@ package org.apache.flex.core * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class ParentDocumentBead extends EventDispatcher implements IBead { /** @@ -124,4 +125,4 @@ package org.apache.flex.core } } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/asjs/src/org/apache/flex/core/SimpleCSSStyles.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/asjs/src/org/apache/flex/core/SimpleCSSStyles.as b/frameworks/projects/Core/asjs/src/org/apache/flex/core/SimpleCSSStyles.as index b9bfef0..2e03949 100644 --- a/frameworks/projects/Core/asjs/src/org/apache/flex/core/SimpleCSSStyles.as +++ b/frameworks/projects/Core/asjs/src/org/apache/flex/core/SimpleCSSStyles.as @@ -30,6 +30,7 @@ package org.apache.flex.core * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class SimpleCSSStyles { /** @@ -74,4 +75,4 @@ package org.apache.flex.core public var borderRadius:*; public var borderWidth:*; } -} \ No newline at end of file +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/91d94267/frameworks/projects/Core/asjs/src/org/apache/flex/utils/CSSUtils.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/asjs/src/org/apache/flex/utils/CSSUtils.as b/frameworks/projects/Core/asjs/src/org/apache/flex/utils/CSSUtils.as index 10dad30..16c37d7 100644 --- a/frameworks/projects/Core/asjs/src/org/apache/flex/utils/CSSUtils.as +++ b/frameworks/projects/Core/asjs/src/org/apache/flex/utils/CSSUtils.as @@ -28,6 +28,7 @@ package org.apache.flex.utils * @playerversion AIR 2.6 * @productversion FlexJS 0.0 */ + COMPILE::AS3 public class CSSUtils { /** @@ -320,4 +321,4 @@ package org.apache.flex.utils purple: 0xFF800080 } } -} \ No newline at end of file +}
