http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js deleted file mode 100644 index a0345a8..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/core/UIBase.js +++ /dev/null @@ -1,872 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.core.UIBase'); - -goog.require('org.apache.flex.core.HTMLElementWrapper'); -goog.require('org.apache.flex.core.IBeadController'); -goog.require('org.apache.flex.core.IBeadLayout'); -goog.require('org.apache.flex.core.IBeadModel'); -goog.require('org.apache.flex.core.IBeadView'); -goog.require('org.apache.flex.core.ILayoutChild'); -goog.require('org.apache.flex.core.IParentIUIBase'); -goog.require('org.apache.flex.core.IStyleableObject'); -goog.require('org.apache.flex.core.IUIBase'); -goog.require('org.apache.flex.core.ValuesManager'); -goog.require('org.apache.flex.events.ValueChangeEvent'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IUIBase} - * @implements {org.apache.flex.core.ILayoutChild} - * @implements {org.apache.flex.core.IParentIUIBase} - * @extends {org.apache.flex.core.HTMLElementWrapper} - */ -org.apache.flex.core.UIBase = function() { - org.apache.flex.core.UIBase.base(this, 'constructor'); - - /** - * @private - * @type {string} - */ - this.lastDisplay_ = ''; - - /** - * @private - * @type {number} - */ - this.explicitWidth_ = NaN; - - /** - * @private - * @type {number} - */ - this.explicitHeight_ = NaN; - - - /** - * @private - * @type {number} - */ - this.percentWidth_ = NaN; - - - /** - * @private - * @type {number} - */ - this.percentHeight_ = NaN; - - /** - * @private - * @type {Array.<Object>} - */ - this.mxmlBeads_ = null; - - /** - * @private - * @type {Object} - */ - this.style_ = null; - - /** - * @private - * @type {?string} - */ - this.id_ = null; - - /** - * @private - * @type {?string} - */ - this.className_ = ''; - - /** - * @private - * @type {Object} - */ - this.model_ = null; - - this.createElement(); -}; -goog.inherits(org.apache.flex.core.UIBase, - org.apache.flex.core.HTMLElementWrapper); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.core.UIBase.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'UIBase', - qName: 'org.apache.flex.core.UIBase' }], - interfaces: [org.apache.flex.core.IUIBase, - org.apache.flex.core.IParentIUIBase, - org.apache.flex.core.ILayoutChild, - org.apache.flex.core.IStyleableObject] }; - - -/** - * @export - * @type {Object} - */ -org.apache.flex.core.UIBase.prototype.positioner = null; - - -/** - * @return {Object} The array of children. - */ -org.apache.flex.core.UIBase.prototype.internalChildren = - function() { - return this.element.childNodes; -}; - - -/** - * @protected - * @return {Object} The actual element to be parented. - */ -org.apache.flex.core.UIBase.prototype.createElement = function() { - if (this.element == null) - this.element = document.createElement('div'); - if (this.positioner == null) - this.positioner = this.element; - this.positioner.style.display = 'block'; - this.positioner.style.position = 'relative'; - - this.element.flexjs_wrapper = this; - - return this.positioner; -}; - - -/** - * @protected - * @type {?function()} - */ -org.apache.flex.core.UIBase.prototype.finalizeElement = null; - - -/** - * @param {Object} c The child element. - * @param {boolean=} opt_dispatchEvent Use 'false' to skip sending a childrenAdded event. - */ -org.apache.flex.core.UIBase.prototype.addElement = function(c, opt_dispatchEvent) { - this.element.appendChild(c.positioner); - c.addedToParent(); -}; - - -/** - * @param {Object} c The child element. - * @param {number} index The index. - * @param {boolean=} opt_dispatchEvent Use 'false' to skip sending a childrenAdded event. - */ -org.apache.flex.core.UIBase.prototype.addElementAt = function(c, index, opt_dispatchEvent) { - var children = this.internalChildren(); - if (index >= children.length) - this.addElement(c); - else - { - this.element.insertBefore(c.positioner, - children[index]); - c.addedToParent(); - } -}; - - -/** - * @param {number} index The index in parent. - * @return {Object} The child element. - */ -org.apache.flex.core.UIBase.prototype.getElementAt = function(index) { - var children = this.internalChildren(); - return children[index].flexjs_wrapper; -}; - - -/** - * @param {Object} c The child element. - * @return {number} The index in parent. - */ -org.apache.flex.core.UIBase.prototype.getElementIndex = function(c) { - var children = this.internalChildren(); - var n = children.length; - for (var i = 0; i < n; i++) - { - if (children[i] == c.element) - return i; - } - return -1; -}; - - -/** - * @param {Object} c The child element. - */ -org.apache.flex.core.UIBase.prototype.removeElement = function(c) { - this.element.removeChild(c.element); -}; - - -/** - */ -org.apache.flex.core.UIBase.prototype.addedToParent = function() { - var s, value; - var styles = this.style; - if (styles) - org.apache.flex.core.ValuesManager.valuesImpl.applyStyles(this, styles); - - if (isNaN(this.explicitWidth_) && isNaN(this.percentWidth_)) { - value = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this, 'width'); - if (value !== undefined) { - if (typeof(value) === 'string') { - s = value; - if (s.indexOf('%') != -1) - this.percentWidth_ = Number(s.substring(0, s.length - 1)); - else { - if (s.indexOf('px') != -1) - s = s.substring(0, s.length - 2); - this.width_ = this.explicitWidth_ = Number(s); - } - } - else - this.width_ = this.explicitWidth_ = value; - } - } - - if (isNaN(this.explicitHeight_) && isNaN(this.percentHeight_)) { - value = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this, 'height'); - if (value !== undefined) { - if (typeof(value) === 'string') { - s = value; - if (s.indexOf('%') != -1) - this.percentHeight_ = Number(s.substring(0, s.length - 1)); - else { - if (s.indexOf('px') != -1) - s = s.substring(0, s.length - 2); - this.height_ = this.explicitHeight_ = Number(s); - } - } - else - this.height_ = this.explicitHeight_ = value; - } - } - - if (this.mxmlBeads_) { - var n = this.mxmlBeads_.length; - for (var i = 0; i < n; i++) { - this.addBead(this.mxmlBeads_[i]); - } - } - - /** - * @type {Function} - */ - var c; - if (this.getBeadByType(org.apache.flex.core.IBeadModel) == null) - { - if (org.apache.flex.core.ValuesManager.valuesImpl.getValue) { - c = /** @type {Function} */ (org.apache.flex.core.ValuesManager.valuesImpl. - getValue(this, 'iBeadModel')); - if (c) - { - var model = new c(); - if (model) - this.addBead(model); - } - } - } - if (this.view_ == null && this.getBeadByType(org.apache.flex.core.IBeadView) == null) - { - if (org.apache.flex.core.ValuesManager.valuesImpl.getValue) { - c = /** @type {Function} */ (org.apache.flex.core.ValuesManager.valuesImpl. - getValue(this, 'iBeadView')); - if (c) - { - var view = new c(); - if (view) { - this.view_ = view; - this.addBead(view); - } - } - } - } - if (this.getBeadByType(org.apache.flex.core.IBeadLayout) == null) - { - if (org.apache.flex.core.ValuesManager.valuesImpl.getValue) { - c = /** @type {Function} */ (org.apache.flex.core.ValuesManager.valuesImpl. - getValue(this, 'iBeadLayout')); - if (c) - { - var layout = new c(); - if (layout) - this.addBead(layout); - } - } - } - if (this.getBeadByType(org.apache.flex.core.IBeadController) == null) - { - if (org.apache.flex.core.ValuesManager.valuesImpl.getValue) { - c = /** @type {Function} */ (org.apache.flex.core.ValuesManager.valuesImpl. - getValue(this, 'iBeadController')); - if (c) - { - var controller = new c(); - if (controller) - this.addBead(controller); - } - } - } - - this.dispatchEvent(new org.apache.flex.events.Event('beadsAdded')); -}; - - -/** - * @param {Object} bead The bead to be added. - */ -org.apache.flex.core.UIBase.prototype.addBead = function(bead) { - if (!this._beads) { - this._beads = []; - } - this._beads.push(bead); - - if (org.apache.flex.utils.Language.is(bead, org.apache.flex.core.IBeadModel)) - this.model_ = bead; - - if (org.apache.flex.utils.Language.is(bead, org.apache.flex.core.IBeadView)) { - this.view_ = bead; - this.dispatchEvent(new org.apache.flex.events.Event('viewChanged')); - } - - bead.strand = this; -}; - - -/** - * @param {Object} classOrInterface A type or interface. - * @return {Object} The bead of the given type or null. - */ -org.apache.flex.core.UIBase.prototype.getBeadByType = - function(classOrInterface) { - if (!this._beads) { - this._beads = []; - } - for (var i = 0; i < this._beads.length; i++) { - var bead = this._beads[i]; - if (org.apache.flex.utils.Language.is(bead, classOrInterface)) { - return bead; - } - } - return null; -}; - - -/** - * @param {Object} value The bead to be removed. - * @return {Object} The bead that was removed. - */ -org.apache.flex.core.UIBase.prototype.removeBead = - function(value) { - if (!this._beads) return null; - var n = this._beads.length; - for (var i = 0; i < n; i++) { - var bead = this._beads[i]; - if (bead == value) { - this._beads.splice(i, 1); - return bead; - } - } - - return null; -}; - - -Object.defineProperties(org.apache.flex.core.UIBase.prototype, { - /** @export */ - beads: { - /** @this {org.apache.flex.core.UIBase} */ - set: function(value) { - this.mxmlBeads_ = value; - } - }, - /** @export */ - numElements: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - var children = this.internalChildren(); - return children.length; - } - }, - /** @export */ - parent: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - var p = this.positioner.parentNode; - var wrapper = p ? p.flexjs_wrapper : null; - return wrapper; - } - }, - /** @export */ - alpha: { - /** @this {org.apache.flex.core.UIBase} */ - set: function(alpha) { - this.positioner.style.opacity = alpha; - }, - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - var stralpha = this.positioner.style.opacity; - var alpha = parseFloat(stralpha); - return alpha; - } - }, - /** @export */ - x: { - /** @this {org.apache.flex.core.UIBase} */ - set: function(pixels) { - this.positioner.style.position = 'absolute'; - this.positioner.style.left = pixels.toString() + 'px'; - }, - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - var strpixels = this.positioner.style.left; - var pixels = parseFloat(strpixels); - if (isNaN(pixels)) - pixels = this.positioner.offsetLeft; - return pixels; - } - }, - /** @export */ - y: { - /** @this {org.apache.flex.core.UIBase} */ - set: function(pixels) { - this.positioner.style.position = 'absolute'; - this.positioner.style.top = pixels.toString() + 'px'; - }, - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - var strpixels = this.positioner.style.top; - var pixels = parseFloat(strpixels); - if (isNaN(pixels)) - pixels = this.positioner.offsetTop; - return pixels; - } - }, - /** @export */ - clientWidth: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - return this.positioner.clientWidth; - } - }, - /** @export */ - CSSWidth: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - var pixels; - var strpixels = this.positioner.style.width; - if (strpixels !== null && strpixels.indexOf('%') != -1) - pixels = NaN; - else - pixels = parseFloat(strpixels); - return pixels; - } - }, - /** @export */ - width: { - /** @this {org.apache.flex.core.UIBase} */ - set: function(pixels) { - this.explicitWidth = pixels; - this.setWidth(pixels); - }, - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - var pixels; - var strpixels = this.positioner.style.width; - if (strpixels !== null && strpixels.indexOf('%') != -1) - pixels = NaN; - else - pixels = parseFloat(strpixels); - if (isNaN(pixels)) { - pixels = this.positioner.offsetWidth; - if (pixels === 0 && this.positioner.scrollWidth !== 0) { - // invisible child elements cause offsetWidth to be 0. - pixels = this.positioner.scrollWidth; - } - } - return pixels; - } - }, - /** @export */ - explicitWidth: { - /** @this {org.apache.flex.core.UIBase} */ - set: function(pixels) { - this.explicitWidth_ = pixels; - if (!isNaN(pixels)) - this.percentWidth_ = NaN; - }, - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - return this.explicitWidth_; - } - }, - /** @export */ - percentWidth: { - /** @this {org.apache.flex.core.UIBase} */ - set: function(pixels) { - this.percentWidth_ = pixels; - this.positioner.style.width = pixels.toString() + '%'; - if (!isNaN(pixels)) - this.explicitWidth_ = NaN; - }, - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - return this.percentWidth_; - } - }, - /** @export */ - clientHeight: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - return this.positioner.clientHeight; - } - }, - /** @export */ - CSSHeight: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - var pixels; - var strpixels = this.positioner.style.height; - if (strpixels !== null && strpixels.indexOf('%') != -1) - pixels = NaN; - else - pixels = parseFloat(strpixels); - return pixels; - } - }, - /** @export */ - height: { - /** @this {org.apache.flex.core.UIBase} */ - set: function(pixels) { - this.explicitHeight = pixels; - this.setHeight(pixels); - }, - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - var pixels; - var strpixels = this.positioner.style.height; - if (strpixels !== null && strpixels.indexOf('%') != -1) - pixels = NaN; - else - pixels = parseFloat(strpixels); - if (isNaN(pixels)) { - pixels = this.positioner.offsetHeight; - if (pixels === 0 && this.positioner.scrollHeight !== 0) { - // invisible child elements cause offsetHeight to be 0. - pixels = this.positioner.scrollHeight; - } - } - return pixels; - } - }, - /** @export */ - explicitHeight: { - /** @this {org.apache.flex.core.UIBase} */ - set: function(pixels) { - this.explicitHeight_ = pixels; - if (!isNaN(pixels)) - this.percentHeight_ = NaN; - }, - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - return this.explicitHeight_; - } - }, - /** @export */ - percentHeight: { - /** @this {org.apache.flex.core.UIBase} */ - set: function(pixels) { - this.percentHeight_ = pixels; - this.positioner.style.height = pixels.toString() + '%'; - if (!isNaN(pixels)) - this.explicitHeight_ = NaN; - }, - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - return this.percentHeight_; - } - }, - /** @export */ - id: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - return this.id_; - }, - /** @this {org.apache.flex.core.UIBase} */ - set: function(value) { - if (this.id_ !== value) { - this.element.id = value; - this.id_ = value; - this.dispatchEvent('idChanged'); - } - } - }, - /** @export */ - className: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - return this.className_; - }, - /** @this {org.apache.flex.core.UIBase} */ - set: function(value) { - if (this.className_ !== value) { - this.element.className = this.typeNames ? value + ' ' + this.typeNames : value; - this.className_ = value; - this.dispatchEvent('classNameChanged'); - } - } - }, - /** @export */ - model: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - if (this.model_ == null) { - // addbead will set _model - if (org.apache.flex.core.ValuesManager.valuesImpl.getValue) { - /** - * @type {Function} - */ - var m = /** @type {Function} */ (org.apache.flex.core.ValuesManager.valuesImpl. - getValue(this, 'iBeadModel')); - var b = new m(); - this.addBead(b); - } - } - return this.model_; - }, - /** @this {org.apache.flex.core.UIBase} */ - set: function(value) { - if (this.model_ !== value) { - this.addBead(value); - this.dispatchEvent('modelChanged'); - } - } - }, - /** @export */ - style: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - return this.style_; - }, - /** @this {org.apache.flex.core.UIBase} */ - set: function(value) { - if (this.style_ !== value) { - if (typeof(value) == 'string') - value = org.apache.flex.core.ValuesManager.valuesImpl.parseStyles(value); - this.style_ = value; - if (value.addEventListener) - value.addEventListener(org.apache.flex.events.ValueChangeEvent.VALUE_CHANGE, - goog.bind(this.styleChangeHandler, this)); - this.dispatchEvent('stylesChanged'); - } - } - }, - /** @export */ - view: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - if (this.view_ == null) { - /** - * @type {Function} - */ - var v = /** @type {Function} */(org.apache.flex.core.ValuesManager.valuesImpl. - getValue(this, 'iBeadView')); - this.view_ = new v(); - this.addBead(this.view_); - } - return this.view_; - }, - /** @this {org.apache.flex.core.UIBase} */ - set: function(value) { - if (this.view_ != value) { - this.view_ = value; - this.addBead(value); - } - } - }, - /** @export */ - visible: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - return this.positioner.style.display !== 'none'; - }, - /** @this {org.apache.flex.core.UIBase} */ - set: function(value) { - var oldValue = this.positioner.style.display !== 'none'; - if (value !== oldValue) { - if (!value) { - this.lastDisplay_ = this.positioner.style.display; - this.positioner.style.display = 'none'; - this.dispatchEvent(new org.apache.flex.events.Event('hide')); - } else { - if (this.lastDisplay_) { - this.positioner.style.display = this.lastDisplay_; - } else { - this.positioner.style.display = this.internalDisplay; - } - this.dispatchEvent(new org.apache.flex.events.Event('show')); - } - this.dispatchEvent(new org.apache.flex.events.Event('visibleChanged')); - } - } - }, - /** @export */ - topMostEventDispatcher: { - /** @this {org.apache.flex.core.UIBase} */ - get: function() { - return document.body.flexjs_wrapper; - } - } -}); - - -/** - * @export - * @param {number} value The height of the object in pixels. - * @param {boolean=} opt_noEvent Whether to skip sending a change event. - */ -org.apache.flex.core.UIBase.prototype.setHeight = - function(value, opt_noEvent) -{ - if (opt_noEvent === undefined) - opt_noEvent = false; - - if (value === undefined) - value = 0; - - var _height = this.CSSHeight; - if (isNaN(_height) || _height != value) { - this.positioner.style.height = value.toString() + 'px'; - if (!opt_noEvent) - this.dispatchEvent('heightChanged'); - } -}; - - -/** - * @export - * @param {number} value The width of the object in pixels. - * @param {boolean=} opt_noEvent Whether to skip sending a change event. - */ -org.apache.flex.core.UIBase.prototype.setWidth = - function(value, opt_noEvent) -{ - if (opt_noEvent === undefined) - opt_noEvent = false; - - if (value === undefined) - value = 0; - - var _width = this.CSSWidth; - if (isNaN(_width) || _width != value) { - this.positioner.style.width = value.toString() + 'px'; - if (!opt_noEvent) - this.dispatchEvent('widthChanged'); - } -}; - - -/** - * @export - * @param {number} newWidth The width of the object in pixels. - * @param {number} newHeight The height of the object in pixels. - * @param {boolean=} opt_noEvent Whether to skip sending a change event. - */ -org.apache.flex.core.UIBase.prototype.setWidthAndHeight = - function(newWidth, newHeight, opt_noEvent) -{ - if (opt_noEvent === undefined) - opt_noEvent = false; - - if (newWidth === undefined) - newWidth = 0; - if (newHeight === undefined) - newHeight = 0; - - var _width = this.CSSWidth; - if (isNaN(_width) || _width != newWidth) { - this.positioner.style.width = newWidth.toString() + 'px'; - if (!opt_noEvent) - this.dispatchEvent('widthChanged'); - } - var _height = this.CSSHeight; - if (isNaN(_height) || _height != newHeight) { - this.positioner.style.height = newHeight.toString() + 'px'; - if (!opt_noEvent) - this.dispatchEvent('heightChanged'); - } - this.dispatchEvent('sizeChanged'); -}; - - -/** - * @export - * @return {boolean} True if width sized to content. - */ -org.apache.flex.core.UIBase.prototype.isWidthSizedToContent = function() -{ - if (!isNaN(this.explicitWidth_) || !isNaN(this.percentWidth_)) - return false; - var left = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this, 'left'); - var right = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this, 'right'); - // not sized to content if both left and right are specified - return (left === undefined || right === undefined); -}; - - -/** - * @export - * @return {boolean} True if height sized to content. - */ -org.apache.flex.core.UIBase.prototype.isHeightSizedToContent = function() -{ - if (!isNaN(this.explicitHeight_) || !isNaN(this.percentHeight_)) - return false; - var top = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this, 'top'); - var bottom = org.apache.flex.core.ValuesManager.valuesImpl.getValue(this, 'bottom'); - // not sized to content if both top and bottom are specified - return (top === undefined || bottom === undefined); -}; - - -/** - * @export - * @type {string} - */ -org.apache.flex.core.UIBase.prototype.typeNames = ''; - - -/** - * @export - * @param {org.apache.flex.events.ValueChangeEvent} value The new style properties. - */ -org.apache.flex.core.UIBase.prototype.styleChangeHandler = function(value) { - var newStyle = {}; - newStyle[value.propertyName] = value.newValue; - org.apache.flex.core.ValuesManager.valuesImpl.applyStyles(this, newStyle); -};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/core/ValuesManager.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/ValuesManager.js b/frameworks/projects/Core/js/src/org/apache/flex/core/ValuesManager.js deleted file mode 100644 index 00515de..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/core/ValuesManager.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.core.ValuesManager'); - -goog.require('org.apache.flex.core.IValuesImpl'); - - - -/** - * @constructor - */ -org.apache.flex.core.ValuesManager = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.core.ValuesManager.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ValuesManager', - qName: 'org.apache.flex.core.ValuesManager' }] }; - - -/** - * @export - * @type {org.apache.flex.core.IValuesImpl} - */ -org.apache.flex.core.ValuesManager.prototype.valuesImpl = null; - - -Object.defineProperties(org.apache.flex.core.ValuesManager.prototype, { - /** @export */ - valuesImpl: { - /** @this {org.apache.flex.core.ValuesManager} */ - get: function() { - return org.apache.flex.core.ValuesManager.valuesImpl; - }, - /** @this {org.apache.flex.core.ValuesManager} */ - set: function(value) { - org.apache.flex.core.ValuesManager.valuesImpl = value; - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBase.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBase.js deleted file mode 100644 index 4bded41..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBase.js +++ /dev/null @@ -1,143 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.core.ViewBase'); - -goog.require('org.apache.flex.core.ContainerBase'); -goog.require('org.apache.flex.core.IPopUpHost'); -goog.require('org.apache.flex.core.UIBase'); -goog.require('org.apache.flex.core.ValuesManager'); -goog.require('org.apache.flex.events.Event'); -goog.require('org.apache.flex.events.ValueChangeEvent'); -goog.require('org.apache.flex.utils.MXMLDataInterpreter'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IPopUpHost} - * @extends {org.apache.flex.core.ContainerBase} - */ -org.apache.flex.core.ViewBase = function() { - org.apache.flex.core.ViewBase.base(this, 'constructor'); - - this.document = this; -}; -goog.inherits(org.apache.flex.core.ViewBase, org.apache.flex.core.ContainerBase); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.core.ViewBase.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ViewBase', - qName: 'org.apache.flex.core.ViewBase' }], - interfaces: [org.apache.flex.core.IPopUpHost] }; - - -/** - * @private - * @type {Object} - */ -org.apache.flex.core.ViewBase.prototype.applicationModel_ = null; - - -/** - * @export - * @param {Array} data The data for the attributes. - */ -org.apache.flex.core.ViewBase.prototype.generateMXMLAttributes = function(data) { - org.apache.flex.utils.MXMLDataInterpreter.generateMXMLProperties(this, data); -}; - - -/** - * @export - * @type {Object} The document. - */ -org.apache.flex.core.ViewBase.prototype.document = null; - - -/** - * @export - * @param {Object} doc The document. - * @param {Array} desc The descriptor data; - */ -org.apache.flex.core.ViewBase.prototype.setMXMLDescriptor = - function(doc, desc) { - this.MXMLDescriptor = desc; - this.document = doc; -}; - - -/** - * @export - */ -org.apache.flex.core.ViewBase.prototype.addedToParent = function() { - - //org.apache.flex.core.ViewBase.base(this,'addedToParent'); - this.element.flexjs_wrapper = this; - if (org.apache.flex.core.ValuesManager.valuesImpl.init) { - org.apache.flex.core.ValuesManager.valuesImpl.init(this); - } - - org.apache.flex.core.ViewBase.base(this, 'addedToParent'); - - this.dispatchEvent(new org.apache.flex.events.Event('childrenAdded')); -}; - - -/** - * @export - * @param {string} state The name of the state. - * @return {boolean} True if state in states array. - */ -org.apache.flex.core.ViewBase.prototype.hasState = function(state) { - var states = this.states; - for (var p in states) - { - var s = states[p]; - if (s.name == state) - return true; - } - return false; -}; - - -Object.defineProperties(org.apache.flex.core.ViewBase.prototype, { - /** @export */ - MXMLDescriptor: { - /** @this {org.apache.flex.core.ViewBase} */ - get: function() { - return this.mxmldd; - }, - /** @this {org.apache.flex.core.ViewBase} */ - set: function(value) { - this.mxmldd = value; - } - }, - /** @export */ - applicationModel: { - /** @this {org.apache.flex.core.ViewBase} */ - get: function() { - return this.applicationModel_; - }, - /** @this {org.apache.flex.core.ViewBase} */ - set: function(value) { - this.applicationModel_ = value; - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/events/BrowserEvent.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/events/BrowserEvent.js b/frameworks/projects/Core/js/src/org/apache/flex/events/BrowserEvent.js deleted file mode 100644 index 2891d93..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/events/BrowserEvent.js +++ /dev/null @@ -1,162 +0,0 @@ -/** - * 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. - */ -goog.provide('org.apache.flex.events.BrowserEvent'); - -goog.require('goog.events.BrowserEvent'); - - - -/** - * @constructor - */ -org.apache.flex.events.BrowserEvent = function() { - -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.events.BrowserEvent.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'BrowserEvent', - qName: 'org.apache.flex.events.BrowserEvent' }] }; - - -/** - * @type {?goog.events.BrowserEvent} - */ -org.apache.flex.events.BrowserEvent.prototype.wrappedEvent = null; - - -/** - */ -org.apache.flex.events.BrowserEvent.prototype.preventDefault = function() { - this.wrappedEvent.preventDefault(); -}; - - -/** - */ -org.apache.flex.events.BrowserEvent.prototype.stopPropagation = function() { - this.wrappedEvent.stopPropagation(); -}; - - -/** - */ -org.apache.flex.events.BrowserEvent.prototype.stopImmediatePropagation = function() { - //this.wrappedEvent.stopImmediatePropagation(); // not in goog.events.BrowserEvent - this.wrappedEvent.stopPropagation(); -}; - - -Object.defineProperties(org.apache.flex.events.BrowserEvent.prototype, { - /** @export */ - currentTarget: { - /** @this {org.apache.flex.events.BrowserEvent} */ - get: function() { - var o = this.wrappedEvent.currentTarget; - if (o && o.flexjs_wrapper) - return o.flexjs_wrapper; - return o; - } - }, - /** @export */ - button: { - /** @this {org.apache.flex.events.BrowserEvent} */ - get: function() { - return this.wrappedEvent.button; - } - }, - /** @export */ - charCode: { - /** @this {org.apache.flex.events.BrowserEvent} */ - get: function() { - return this.wrappedEvent.charCode; - } - }, - /** @export */ - clientX: { - /** @this {org.apache.flex.events.BrowserEvent} */ - get: function() { - return this.wrappedEvent.clientX; - } - }, - /** @export */ - clientY: { - /** @this {org.apache.flex.events.BrowserEvent} */ - get: function() { - return this.wrappedEvent.clientY; - } - }, - /** @export */ - keyCode: { - /** @this {org.apache.flex.events.BrowserEvent} */ - get: function() { - return this.wrappedEvent.keyCode; - } - }, - /** @export */ - offsetX: { - /** @this {org.apache.flex.events.BrowserEvent} */ - get: function() { - return this.wrappedEvent.offsetX; - } - }, - /** @export */ - offsetY: { - /** @this {org.apache.flex.events.BrowserEvent} */ - get: function() { - return this.wrappedEvent.offsetY; - } - }, - /** @export */ - screenX: { - /** @this {org.apache.flex.events.BrowserEvent} */ - get: function() { - return this.wrappedEvent.screenX; - } - }, - /** @export */ - screenY: { - /** @this {org.apache.flex.events.BrowserEvent} */ - get: function() { - return this.wrappedEvent.screenY; - } - }, - /** @export */ - relatedTarget: { - /** @this {org.apache.flex.events.BrowserEvent} */ - get: function() { - var o = this.wrappedEvent.relatedTarget; - if (o && o.flexjs_wrapper) - return o.flexjs_wrapper; - return o; - } - }, - /** @export */ - target: { - /** @this {org.apache.flex.events.BrowserEvent} */ - get: function() { - var o = this.wrappedEvent.target; - if (o && o.flexjs_wrapper) - return o.flexjs_wrapper; - return o; - } - } -}); - - http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/events/CustomEvent.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/events/CustomEvent.js b/frameworks/projects/Core/js/src/org/apache/flex/events/CustomEvent.js deleted file mode 100644 index a89143c..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/events/CustomEvent.js +++ /dev/null @@ -1,58 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.events.CustomEvent'); - -goog.require('goog.events.Event'); - - - -/** - * @constructor - * @extends {goog.events.Event} - * @param {string} type The event type. - */ -org.apache.flex.events.CustomEvent = function(type) { - org.apache.flex.events.CustomEvent.base(this, 'constructor', type); - - this.type = type; -}; -goog.inherits(org.apache.flex.events.CustomEvent, - goog.events.Event); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.events.CustomEvent.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'CustomEvent', - qName: 'org.apache.flex.events.CustomEvent'}] }; - - -/** - * @export - * @param {string} type The event type. - */ -org.apache.flex.events.CustomEvent.prototype.init = function(type) { - this.type = type; -}; - - -/** - * @export - * @type {string} type The event type. - */ -org.apache.flex.events.CustomEvent.prototype.type = ''; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/events/ElementEvents.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/events/ElementEvents.js b/frameworks/projects/Core/js/src/org/apache/flex/events/ElementEvents.js deleted file mode 100644 index ce46b37..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/events/ElementEvents.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * 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. - */ -goog.provide('org.apache.flex.events.ElementEvents'); - - - -/** - * @constructor - */ -org.apache.flex.events.ElementEvents = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.events.ElementEvents.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ElementEvents', - qName: 'org.apache.flex.events.ElementEvents' }] }; - - -/** - * @type {Object} - */ -org.apache.flex.events.ElementEvents.elementEvents = { - 'click': 1, - 'change': 1, - 'keyup': 1, - 'keydown': 1, - 'load': 1, - '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/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/events/Event.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/events/Event.js b/frameworks/projects/Core/js/src/org/apache/flex/events/Event.js deleted file mode 100644 index ca54f3e..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/events/Event.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * 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. - */ -// EventHandler and ErrorHandler are not listed as deps for -// some of the event classes because they would cause -// circularities so we force them in here. -goog.provide('org.apache.flex.events.Event'); - -goog.require('goog.debug.ErrorHandler'); -goog.require('goog.events.Event'); -goog.require('goog.events.EventHandler'); - - - -/** - * @constructor - * @extends {goog.events.Event} - * @param {string} type The event type. - */ -org.apache.flex.events.Event = function(type) { - org.apache.flex.events.Event.base(this, 'constructor', type); - - this.type = type; -}; -goog.inherits(org.apache.flex.events.Event, - goog.events.Event); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.events.Event.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'Event', - qName: 'org.apache.flex.events.Event' }] }; - - -/** - * Enum type for the events fired by the FlexJS Event - * @enum {string} - */ -org.apache.flex.events.Event.EventType = { - CHANGE: 'change' - }; - - -/** - * @export - * @type {string} type The event type. - */ -org.apache.flex.events.Event.prototype.type = ''; - - -/** - * @export - * @param {string} type The event type. - */ -org.apache.flex.events.Event.prototype.init = function(type) { - this.type = type; -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/events/EventDispatcher.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/events/EventDispatcher.js b/frameworks/projects/Core/js/src/org/apache/flex/events/EventDispatcher.js deleted file mode 100644 index 0429dbd..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/events/EventDispatcher.js +++ /dev/null @@ -1,138 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.events.EventDispatcher'); - -goog.require('goog.events.EventTarget'); -goog.require('org.apache.flex.events.ElementEvents'); -goog.require('org.apache.flex.events.IEventDispatcher'); - - - -/** - * @constructor - * @extends {goog.events.EventTarget} - * @implements {org.apache.flex.events.IEventDispatcher} - */ -org.apache.flex.events.EventDispatcher = function() { - org.apache.flex.events.EventDispatcher.base(this, 'constructor'); -}; -goog.inherits(org.apache.flex.events.EventDispatcher, - goog.events.EventTarget); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.events.EventDispatcher.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'EventDispatcher', - qName: 'org.apache.flex.events.EventDispatcher'}], - interfaces: [org.apache.flex.events.IEventDispatcher] }; - - -/** - * @private - * @param {string} type The event name. - * @return {goog.events.EventTarget} The target. - */ -org.apache.flex.events.EventDispatcher.prototype.getActualDispatcher_ = function(type) { - /** - * A bit of a hack, but for 'native' HTML element based controls, we - * want to listen to the 'native' events from the element; for other - * types of controls, we listen to 'custom' events. - */ - var source = this; - /* - if (this.element && this.element.nodeName && - this.element.nodeName.toLowerCase() !== 'div' && - // we don't use any native img events right now, we wrapthem - this.element.nodeName.toLowerCase() !== 'img' && - this.element.nodeName.toLowerCase() !== 'body') { - source = this.element; - } else */ if (org.apache.flex.events.ElementEvents.elementEvents[type]) { - // mouse and keyboard events also dispatch off the element. - source = this.element; - } - return source; -}; - - -/** - * @override - * @export - */ -org.apache.flex.events.EventDispatcher.prototype.dispatchEvent = function(e) { - var t; - if (typeof(e) === 'string') { - t = e; - if (e === 'change') - e = new Event(e); - } - else { - t = e.type; - if (org.apache.flex.events.ElementEvents.elementEvents[t]) { - e = new Event(t); - } - } - var source = this.getActualDispatcher_(t); - if (source == this) - return org.apache.flex.events.EventDispatcher.base(this, 'dispatchEvent', e); - - return source.dispatchEvent(e); -}; - - -/** - * @override - * @export - */ -org.apache.flex.events.EventDispatcher.prototype.addEventListener = - function(type, handler, opt_capture, opt_handlerScope) { - var source; - - source = this.getActualDispatcher_(type); - - goog.events.listen(source, type, handler); -}; - - -/** - * @override - * @export - */ -org.apache.flex.events.EventDispatcher.prototype.removeEventListener = - function(type, handler, opt_capture, opt_handlerScope) { - var source; - - source = this.getActualDispatcher_(type); - - goog.events.unlisten(source, type, handler); -}; - - -/** - * @export - * @param {string} type The event name. - * @return {boolean} True if there is a listener. - */ -org.apache.flex.events.EventDispatcher.prototype.hasEventListener = - function(type) { - var source; - - source = this.getActualDispatcher_(type); - - return goog.events.hasListener(source, type); -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/events/IEventDispatcher.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/events/IEventDispatcher.js b/frameworks/projects/Core/js/src/org/apache/flex/events/IEventDispatcher.js deleted file mode 100644 index a87d8a1..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/events/IEventDispatcher.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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. - */ - -/** - * @fileoverview - * @suppress {checkTypes} - */ - -goog.provide('org.apache.flex.events.IEventDispatcher'); - - - -/** - * IEventDispatcher - * - * @interface - */ -org.apache.flex.events.IEventDispatcher = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.events.IEventDispatcher.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'IEventDispatcher', - qName: 'org.apache.flex.events.IEventDispatcher'}] }; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/events/MouseEvent.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/events/MouseEvent.js b/frameworks/projects/Core/js/src/org/apache/flex/events/MouseEvent.js deleted file mode 100644 index d553858..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/events/MouseEvent.js +++ /dev/null @@ -1,186 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.events.MouseEvent'); - -goog.require('goog.events.BrowserEvent'); - - - -/** - * @constructor - * @extends {goog.events.BrowserEvent} - * - * This is a shim class. As long as you don't test - * with "is" or "as", your code should work even - * if the runtime is actually sending a native - * browser MouseEvent - */ -org.apache.flex.events.MouseEvent = function() { - org.apache.flex.events.MouseEvent.base(this, 'constructor'); -}; -goog.inherits(org.apache.flex.events.MouseEvent, - goog.events.BrowserEvent); - - -/** - * @type {string} - */ -org.apache.flex.events.MouseEvent.ROLL_OVER = 'rollover'; - - -/** - * @type {string} - */ -org.apache.flex.events.MouseEvent.ROLL_OUT = 'rollout'; - - -/** - * @type {string} - */ -org.apache.flex.events.MouseEvent.MOUSE_OVER = 'mouseover'; - - -/** - * @type {string} - */ -org.apache.flex.events.MouseEvent.MOUSE_OUT = 'mouseout'; - - -/** - * @type {string} - */ -org.apache.flex.events.MouseEvent.MOUSE_UP = 'mouseup'; - - -/** - * @type {string} - */ -org.apache.flex.events.MouseEvent.MOUSE_DOWN = 'mousedown'; - - -/** - * @type {string} - */ -org.apache.flex.events.MouseEvent.MOUSE_MOVE = 'mousemove'; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.events.MouseEvent.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'MouseEvent', - qName: 'org.apache.flex.events.MouseEvent' }] }; - - -/** - * @return {boolean} - */ -org.apache.flex.events.MouseEvent.installRollOverMixin = function() { - window.addEventListener(org.apache.flex.events.MouseEvent.MOUSE_OVER, - org.apache.flex.events.MouseEvent.mouseOverHandler); - return true; -}; - - -/** - * @param {Event} e The event. - * RollOver/RollOut is entirely implemented in mouseOver because - * when a parent and child share an edge, you only get a mouseout - * for the child and not the parent and you need to send rollout - * to both. A similar issue exists for rollover. - */ -org.apache.flex.events.MouseEvent.mouseOverHandler = function(e) { - var j, m, outs, me, parent; - var target = e.target.flexjs_wrapper; - if (target === undefined) - return; // probably over the html tag - var targets = org.apache.flex.events.MouseEvent.targets; - var index = targets.indexOf(target); - if (index != -1) { - // get all children - outs = targets.slice(index + 1); - m = outs.length; - for (j = 0; j < m; j++) { - me = org.apache.flex.events.MouseEvent.makeMouseEvent( - org.apache.flex.events.MouseEvent.ROLL_OUT, e); - outs[j].element.dispatchEvent(me); - } - org.apache.flex.events.MouseEvent.targets = targets.slice(0, index + 1); - } - else { - var newTargets = [target]; - if (target.hasOwnProperty('parent') === undefined) - parent = null; - else - parent = target.parent; - while (parent) { - index = targets.indexOf(parent); - if (index == -1) { - newTargets.unshift(parent); - if (parent.hasOwnProperty('parent') === undefined) - break; - parent = parent.parent; - } - else { - outs = targets.slice(index + 1); - m = outs.length; - for (j = 0; j < m; j++) { - me = org.apache.flex.events.MouseEvent.makeMouseEvent( - org.apache.flex.events.MouseEvent.ROLL_OUT, e); - outs[j].element.dispatchEvent(me); - } - targets = targets.slice(0, index + 1); - break; - } - } - var n = newTargets.length; - for (var i = 0; i < n; i++) { - me = org.apache.flex.events.MouseEvent.makeMouseEvent( - org.apache.flex.events.MouseEvent.ROLL_OVER, e); - newTargets[i].element.dispatchEvent(me); - } - org.apache.flex.events.MouseEvent.targets = targets.concat(newTargets); - } -}; - - -/** - * @type {boolean} - */ -org.apache.flex.events.MouseEvent.rollOverMixin = - org.apache.flex.events.MouseEvent.installRollOverMixin(); - - -/** - * @type {Object} - */ -org.apache.flex.events.MouseEvent.targets = []; - - -/** - * @param {string} type The event type. - * @param {Event} e The mouse event. - * @return {MouseEvent} The new event. - */ -org.apache.flex.events.MouseEvent.makeMouseEvent = function(type, e) { - var out = new MouseEvent(type); - out.initMouseEvent(type, false, false, - e.view, e.detail, e.screenX, e.screenY, - e.clientX, e.clientY, e.ctrlKey, e.altKey, - e.shiftKey, e.metaKey, e.button, e.relatedTarget); - return out; -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/events/ValueChangeEvent.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/events/ValueChangeEvent.js b/frameworks/projects/Core/js/src/org/apache/flex/events/ValueChangeEvent.js deleted file mode 100644 index 2d04c58..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/events/ValueChangeEvent.js +++ /dev/null @@ -1,119 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.events.ValueChangeEvent'); - -goog.require('goog.events.Event'); - - - -/** - * @constructor - * @extends {goog.events.Event} - * @param {string} type The event type. - * @param {boolean} b The bubbles parameter. - * @param {boolean} c The cancelable parameter. - * @param {*} ov The old value. - * @param {*} nv The new value. - */ -org.apache.flex.events.ValueChangeEvent = function(type, b, c, ov, nv) { - org.apache.flex.events.ValueChangeEvent.base(this, 'constructor', type); - - this.type = type; - this.oldValue = ov; - this.newValue = nv; -}; -goog.inherits(org.apache.flex.events.ValueChangeEvent, - goog.events.Event); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.events.ValueChangeEvent.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ValueChangeEvent', - qName: 'org.apache.flex.events.ValueChangeEvent' }] }; - - -/** - * @export - * @param {string} type The event type. - */ -org.apache.flex.events.ValueChangeEvent.prototype.init = function(type) { - this.type = type; -}; - - -/** - * @export - * @type {string} type The event type. - */ -org.apache.flex.events.ValueChangeEvent.prototype.type = ''; - - -/** - * @export - * @type {*} oldValue The old value. - */ -org.apache.flex.events.ValueChangeEvent.prototype.oldValue = null; - - -/** - * @export - * @type {*} newValue The new value. - */ -org.apache.flex.events.ValueChangeEvent.prototype.newValue = null; - - -/** - * @export - * @type {string} propertyName The property that changed. - */ -org.apache.flex.events.ValueChangeEvent.prototype.propertyName = ''; - - -/** - * @export - * @type {Object} source The object that changed. - */ -org.apache.flex.events.ValueChangeEvent.prototype.source = null; - - -/** - * @export - * @param {Object} source The object that changed. - * @param {string} name The property that changed. - * @param {*} oldValue The old value. - * @param {*} newValue The new value. - * @return {Object} An event object. - */ -org.apache.flex.events.ValueChangeEvent.createUpdateEvent = - function(source, name, oldValue, newValue) - { - var event = new org.apache.flex.events.ValueChangeEvent( - org.apache.flex.events.ValueChangeEvent.VALUE_CHANGE, - false, false, oldValue, newValue); - event.propertyName = name; - event.source = source; - return event; -}; - - -/** - * @export - * @type {string} VALUE_CHANGE The type of the event. - */ -org.apache.flex.events.ValueChangeEvent.VALUE_CHANGE = 'valueChange'; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/events/ValueEvent.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/events/ValueEvent.js b/frameworks/projects/Core/js/src/org/apache/flex/events/ValueEvent.js deleted file mode 100644 index 53f101c..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/events/ValueEvent.js +++ /dev/null @@ -1,69 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.events.ValueEvent'); - -goog.require('goog.events.Event'); - - - -/** - * @constructor - * @extends {goog.events.Event} - * @param {string} type The event type. - * @param {*} v The value. - */ -org.apache.flex.events.ValueEvent = function(type, v) { - org.apache.flex.events.ValueEvent.base(this, 'constructor', type); - - this.type = type; - this.value = v; -}; -goog.inherits(org.apache.flex.events.ValueEvent, - goog.events.Event); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.events.ValueEvent.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ValueEvent', - qName: 'org.apache.flex.events.ValueEvent' }] }; - - -/** - * @export - * @param {string} type The event type. - */ -org.apache.flex.events.ValueEvent.prototype.init = function(type) { - this.type = type; -}; - - -/** - * @export - * @type {string} type The event type. - */ -org.apache.flex.events.ValueEvent.prototype.type = ''; - - -/** - * @export - * @type {*} value The old value. - */ -org.apache.flex.events.ValueEvent.prototype.value = null; - - http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/events/utils/MouseUtils.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/events/utils/MouseUtils.js b/frameworks/projects/Core/js/src/org/apache/flex/events/utils/MouseUtils.js deleted file mode 100644 index 4d8048d..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/events/utils/MouseUtils.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * 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. - */ - - -goog.provide('org.apache.flex.events.utils.MouseUtils'); - - -/** - * @param {Object} event The event. - * @return {Object} class instance associated with the event.target. - */ -org.apache.flex.events.utils.MouseUtils.eventTarget = function(event) { - var target = event.target; - return target.flexjs_wrapper; -}; - - -/** - * @param {Object} event The event. - * @return {number} The x position of the mouse with respect to its parent. - */ -org.apache.flex.events.utils.MouseUtils.localX = function(event) { - return event.offsetX; -}; - - -/** - * @param {Object} event The event. - * @return {number} The y position of the mouse with respect to its parent. - */ -org.apache.flex.events.utils.MouseUtils.localY = function(event) { - return event.offsetY; -}; - - -/** - * @param {Object} event The event. - * @return {number} The x position of the mouse with respect to the screen. - */ -org.apache.flex.events.utils.MouseUtils.globalX = function(event) { - return event.clientX; -}; - - -/** - * @param {Object} event The event. - * @return {number} The y position of the mouse with respect to the screen. - */ -org.apache.flex.events.utils.MouseUtils.globalY = function(event) { - return event.clientY; -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/geom/Point.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/geom/Point.js b/frameworks/projects/Core/js/src/org/apache/flex/geom/Point.js deleted file mode 100644 index 12cbb7a..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/geom/Point.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.geom.Point'); - - - -/** - * @constructor - * @param {number} x - * @param {number} y - */ -org.apache.flex.geom.Point = function(x, y) { - - this.x = x; - - this.y = y; - -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.geom.Point.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'Point', - qName: 'org.apache.flex.geom.Point'}] }; - - -/** - * @export - * The x coordinate. - * @type {number} value The x coordinate. - */ -org.apache.flex.geom.Point.prototype.x = 0; - - -/** - * @export - * The y coordinate. - * @type {number} value The y coordinate. - */ -org.apache.flex.geom.Point.prototype.y = 0; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/geom/Rectangle.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/geom/Rectangle.js b/frameworks/projects/Core/js/src/org/apache/flex/geom/Rectangle.js deleted file mode 100644 index 887391b..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/geom/Rectangle.js +++ /dev/null @@ -1,104 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.geom.Rectangle'); - - - -/** - * @constructor - * @param {number} left - * @param {number} top - * @param {number} width - * @param {number} height - */ -org.apache.flex.geom.Rectangle = function(left, top, width, height) { - - this.left = left; - - this.top = top; - - this.width = width; - - this.height = height; - -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.geom.Rectangle.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'Rectangle', - qName: 'org.apache.flex.geom.Rectangle'}] }; - - -/** - * @export - * The left coordinate. - * @type {number} value The left coordinate. - */ -org.apache.flex.geom.Rectangle.prototype.left = 0; - - -/** - * @export - * The top coordinate. - * @type {number} value The top coordinate. - */ -org.apache.flex.geom.Rectangle.prototype.top = 0; - - -/** - * @export - * The width coordinate. - * @type {number} value The width coordinate. - */ -org.apache.flex.geom.Rectangle.prototype.width = 0; - - -/** - * @export - * The height coordinate. - * @type {number} value The height coordinate. - */ -org.apache.flex.geom.Rectangle.prototype.height = 9; - - -Object.defineProperties(org.apache.flex.geom.Rectangle.prototype, { - /** @export */ - right: { - /** @this {org.apache.flex.geom.Rectangle} */ - get: function() { - return this.left + this.width; - }, - /** @this {org.apache.flex.geom.Rectangle} */ - set: function(value) { - this.width = value - this.left; - } - }, - /** @export */ - bottom: { - /** @this {org.apache.flex.geom.Rectangle} */ - get: function() { - return this.top + this.height; - }, - /** @this {org.apache.flex.geom.Rectangle} */ - set: function(value) { - this.height = value - this.top; - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/geom/Size.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/geom/Size.js b/frameworks/projects/Core/js/src/org/apache/flex/geom/Size.js deleted file mode 100644 index 1f209d6..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/geom/Size.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.geom.Size'); - - - -/** - * @constructor - * @param {number} width - * @param {number} height - */ -org.apache.flex.geom.Size = function(width, height) { - - this.width = width; - - this.height = height; - -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.geom.Size.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'Size', - qName: 'org.apache.flex.geom.Size'}] }; - - -/** - * @export - * The width value. - * @type {number} value The width value. - */ -org.apache.flex.geom.Size.prototype.width = 0; - - -/** - * @export - * The height value. - * @type {number} value The height value. - */ -org.apache.flex.geom.Size.prototype.height = 0; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/states/AddItems.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/states/AddItems.js b/frameworks/projects/Core/js/src/org/apache/flex/states/AddItems.js deleted file mode 100644 index 737074d..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/states/AddItems.js +++ /dev/null @@ -1,249 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.states.AddItems'); - -goog.require('org.apache.flex.core.IDocument'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IDocument} - */ -org.apache.flex.states.AddItems = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.states.AddItems.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'AddItems', - qName: 'org.apache.flex.states.AddItems' }], - interfaces: [org.apache.flex.core.IDocument] }; - - -/** - * @param {Object} document The MXML object. - * @param {?string=} opt_id The id. - */ -org.apache.flex.states.AddItems.prototype.setDocument = function(document, opt_id) { - opt_id = typeof opt_id !== 'undefined' ? opt_id : null; - this.document = document; - var data = document['mxmlsd'][this.itemsDescriptorIndex]; - if (typeof(data.slice) == 'function') { - this.itemsDescriptor = {}; - this.itemsDescriptor.descriptor = data; - // replace the entry in the document so subsequent - // addItems know it is shared - this.document['mxmlsd'][this.itemsDescriptorIndex] = this.itemsDescriptor; - } else - this.itemsDescriptor = data; -}; - - -/** - * @private - * @type {Object} document The MXML object. - */ -org.apache.flex.states.AddItems.prototype.document_ = null; - - -/** - * @private - * @type {Array} items The array of items to add. - */ -org.apache.flex.states.AddItems.prototype.items_ = null; - - -/** - * @private - * @type {number} itemsDescriptor The index into the array - * of itemDescriptors on the document - */ -org.apache.flex.states.AddItems.prototype.itemsDescriptorIndex_ = -1; - - -/** - * @private - * @type {Object} itemsDescriptor The descriptors for items. - */ -org.apache.flex.states.AddItems.prototype.itemsDescriptor_ = null; - - -/** - * @private - * @type {string} destination The id of the parent. - */ -org.apache.flex.states.AddItems.prototype.destination_ = ''; - - -/** - * @private - * @type {string} propertyName The child property name (e.g. mxmlContent). - */ -org.apache.flex.states.AddItems.prototype.propertyName_ = ''; - - -/** - * @private - * @type {string} position Where the item goes relative to relativeTo. - */ -org.apache.flex.states.AddItems.prototype.position_ = ''; - - -/** - * @private - * @type {?string} relativeTo The id of the child where the item goes. - */ -org.apache.flex.states.AddItems.prototype.relativeTo_ = null; - - -/** - * @export - * @param {Object} properties The properties for the new object. - * @return {Object} The new object. - */ -org.apache.flex.states.AddItems.prototype.initializeFromObject = function(properties) { - var p; - - for (p in properties) { - this[p] = properties[p]; - } - - return this; -}; - - -Object.defineProperties(org.apache.flex.states.AddItems.prototype, - /** @lends {org.apache.flex.states.AddItems.prototype} */ { - /** @export */ - document: { - /** @this {org.apache.flex.states.AddItems} */ - get: function() { - return this.document_; - }, - - /** @this {org.apache.flex.states.AddItems} */ - set: function(value) { - if (value != this.document_) { - this.document_ = value; - } - } - }, - /** @export */ - items: { - /** @this {org.apache.flex.states.AddItems} */ - get: function() { - return this.items_; - }, - - /** @this {org.apache.flex.states.AddItems} */ - set: function(value) { - if (value != this.items_) { - this.items_ = value; - } - } - }, - /** @export */ - itemsDescriptorIndex: { - /** @this {org.apache.flex.states.AddItems} - @return {number} */ - get: function() { - return this.itemsDescriptorIndex_; - }, - - /** @this {org.apache.flex.states.AddItems} - @param {number} value The value. */ - set: function(value) { - if (value != this.itemsDescriptorIndex_) { - this.itemsDescriptorIndex_ = value; - } - } - }, - /** @export */ - itemsDescriptor: { - /** @this {org.apache.flex.states.AddItems} */ - get: function() { - return this.itemsDescriptor_; - }, - - /** @this {org.apache.flex.states.AddItems} */ - set: function(value) { - if (value != this.itemsDescriptor_) { - this.itemsDescriptor_ = value; - } - } - }, - /** @export */ - destination: { - /** @this {org.apache.flex.states.AddItems} */ - get: function() { - return this.destination_; - }, - - /** @this {org.apache.flex.states.AddItems} */ - set: function(value) { - if (value != this.destination_) { - this.destination_ = value; - } - } - }, - /** @export */ - propertyName: { - /** @this {org.apache.flex.states.AddItems} */ - get: function() { - return this.propertyName_; - }, - - /** @this {org.apache.flex.states.AddItems} */ - set: function(value) { - if (value != this.propertyName_) { - this.propertyName_ = value; - } - } - }, - /** @export */ - position: { - /** @this {org.apache.flex.states.AddItems} */ - get: function() { - return this.position_; - }, - - /** @this {org.apache.flex.states.AddItems} */ - set: function(value) { - if (value != this.position_) { - this.position_ = value; - } - } - }, - /** @export */ - relativeTo: { - /** @this {org.apache.flex.states.AddItems} */ - get: function() { - return this.relativeTo_; - }, - - /** @this {org.apache.flex.states.AddItems} */ - set: function(value) { - if (value != this.relativeTo_) { - this.relativeTo_ = value; - } - } - } -}); - http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/states/SetEventHandler.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/states/SetEventHandler.js b/frameworks/projects/Core/js/src/org/apache/flex/states/SetEventHandler.js deleted file mode 100644 index 6d23259..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/states/SetEventHandler.js +++ /dev/null @@ -1,152 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.states.SetEventHandler'); - -goog.require('org.apache.flex.core.IDocument'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IDocument} - */ -org.apache.flex.states.SetEventHandler = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.states.SetEventHandler.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'SetEventHandler', - qName: 'org.apache.flex.states.SetEventHandler' }], - interfaces: [org.apache.flex.core.IDocument] }; - - -/** - * @param {Object} document The MXML object. - * @param {?string=} opt_id The id. - */ -org.apache.flex.states.SetEventHandler.prototype.setDocument = function(document, opt_id) { - opt_id = typeof opt_id !== 'undefined' ? opt_id : null; - this.document = document; -}; - - -/** - * @private - * @type {Object} document The MXML object. - */ -org.apache.flex.states.SetEventHandler.prototype.document_ = null; - - -/** - * @private - * @type {string} name The event to listen for. - */ -org.apache.flex.states.SetEventHandler.prototype.name_ = ''; - - -/** - * @private - * @type {string} target The id of the object. - */ -org.apache.flex.states.SetEventHandler.prototype.target_ = ''; - - -/** - * @private - * @type {Object} handlerFunction The listener to be added. - */ -org.apache.flex.states.SetEventHandler.prototype.handlerFunction_ = null; - - -/** - * @export - * @param {Object} properties The properties for the new object. - * @return {Object} The new object. - */ -org.apache.flex.states.SetEventHandler.prototype.initializeFromObject = function(properties) { - var p; - - for (p in properties) { - this[p] = properties[p]; - } - - return this; -}; - - -Object.defineProperties(org.apache.flex.states.SetEventHandler.prototype, - /** @lends {org.apache.flex.states.SetEventHandler.prototype} */ { - /** @export */ - document: { - /** @this {org.apache.flex.states.SetEventHandler} */ - get: function() { - return this.document_; - }, - - /** @this {org.apache.flex.states.SetEventHandler} */ - set: function(value) { - if (value != this.document_) { - this.document_ = value; - } - } - }, - /** @export */ - name: { - /** @this {org.apache.flex.states.SetEventHandler} */ - get: function() { - return this.name_; - }, - - /** @this {org.apache.flex.states.SetEventHandler} */ - set: function(value) { - if (value != this.name_) { - this.name_ = value; - } - } - }, - /** @export */ - target: { - /** @this {org.apache.flex.states.SetEventHandler} */ - get: function() { - return this.target_; - }, - - /** @this {org.apache.flex.states.SetEventHandler} */ - set: function(value) { - if (value != this.target_) { - this.target_ = value; - } - } - }, - /** @export */ - handlerFunction: { - /** @this {org.apache.flex.states.SetEventHandler} */ - get: function() { - return this.handlerFunction_; - }, - - /** @this {org.apache.flex.states.SetEventHandler} */ - set: function(value) { - if (value != this.handlerFunction_) { - this.handlerFunction_ = value; - } - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/states/SetProperty.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/states/SetProperty.js b/frameworks/projects/Core/js/src/org/apache/flex/states/SetProperty.js deleted file mode 100644 index 15ebbd4..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/states/SetProperty.js +++ /dev/null @@ -1,173 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.states.SetProperty'); - -goog.require('org.apache.flex.core.IDocument'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IDocument} - */ -org.apache.flex.states.SetProperty = function() { -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.states.SetProperty.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'SetProperty', - qName: 'org.apache.flex.states.SetProperty' }], - interfaces: [org.apache.flex.core.IDocument] }; - - -/** - * @param {Object} document The MXML object. - * @param {?string=} opt_id The id. - */ -org.apache.flex.states.SetProperty.prototype.setDocument = function(document, opt_id) { - opt_id = typeof opt_id !== 'undefined' ? opt_id : null; - this.document = document; -}; - - -/** - * @private - * @type {Object} document The MXML object. - */ -org.apache.flex.states.SetProperty.prototype.document_ = null; - - -/** - * @private - * @type {string} name The target property name. - */ -org.apache.flex.states.SetProperty.prototype.name_ = ''; - - -/** - * @private - * @type {?string} target The id of the object. - */ -org.apache.flex.states.SetProperty.prototype.target_ = null; - - -/** - * @private - * @type {Object} previousValue The value to revert to. - */ -org.apache.flex.states.SetProperty.prototype.previousValue_ = null; - - -/** - * @private - * @type {Object} value The value to set. - */ -org.apache.flex.states.SetProperty.prototype.value_ = null; - - -/** - * @export - * @param {Object} properties The properties for the new object. - * @return {Object} The new object. - */ -org.apache.flex.states.SetProperty.prototype.initializeFromObject = function(properties) { - var p; - - for (p in properties) { - this[p] = properties[p]; - } - - return this; -}; - - -Object.defineProperties(org.apache.flex.states.SetProperty.prototype, - /** @lends {org.apache.flex.states.SetProperty.prototype} */ { - /** @export */ - document: { - /** @this {org.apache.flex.states.SetProperty} */ - get: function() { - return this.document_; - }, - - /** @this {org.apache.flex.states.SetProperty} */ - set: function(value) { - if (value != this.document_) { - this.document_ = value; - } - } - }, - /** @export */ - name: { - /** @this {org.apache.flex.states.SetProperty} */ - get: function() { - return this.name_; - }, - - /** @this {org.apache.flex.states.SetProperty} */ - set: function(value) { - if (value != this.name_) { - this.name_ = value; - } - } - }, - /** @export */ - target: { - /** @this {org.apache.flex.states.SetProperty} */ - get: function() { - return this.target_; - }, - - /** @this {org.apache.flex.states.SetProperty} */ - set: function(value) { - if (value != this.target_) { - this.target_ = value; - } - } - }, - /** @export */ - previousValue: { - /** @this {org.apache.flex.states.SetProperty} */ - get: function() { - return this.previousValue_; - }, - - /** @this {org.apache.flex.states.SetProperty} */ - set: function(value) { - if (value != this.previousValue_) { - this.previousValue_ = value; - } - } - }, - /** @export */ - value: { - /** @this {org.apache.flex.states.SetProperty} */ - get: function() { - return this.value_; - }, - - /** @this {org.apache.flex.states.SetProperty} */ - set: function(value) { - if (value != this.value_) { - this.value_ = value; - } - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Core/js/src/org/apache/flex/states/State.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Core/js/src/org/apache/flex/states/State.js b/frameworks/projects/Core/js/src/org/apache/flex/states/State.js deleted file mode 100644 index 3af3655..0000000 --- a/frameworks/projects/Core/js/src/org/apache/flex/states/State.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * 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. - */ - -goog.provide('org.apache.flex.states.State'); - - - -/** - * @constructor - * @param {Object=} opt_props The initial properties. - */ -org.apache.flex.states.State = function(opt_props) { - opt_props = typeof opt_props !== 'undefined' ? opt_props : null; -}; - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.states.State.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'State', - qName: 'org.apache.flex.states.State' }] }; - - -/** - * @private - * @type {string} name The state name. - */ -org.apache.flex.states.State.prototype.name_ = ''; - - -/** - * @private - * @type {Array} overrides The state data. - */ -org.apache.flex.states.State.prototype.overrides_ = null; - - -Object.defineProperties(org.apache.flex.states.State.prototype, - /** @lends {org.apache.flex.states.State.prototype} */ { - /** @export */ - name: { - /** @this {org.apache.flex.states.State} */ - get: function() { - return this.name_; - }, - - /** @this {org.apache.flex.states.State} */ - set: function(value) { - if (value != this.name_) { - this.name_ = value; - } - } - }, - /** @export */ - overrides: { - /** @this {org.apache.flex.states.State} */ - get: function() { - return this.overrides_; - }, - - /** @this {org.apache.flex.states.State} */ - set: function(value) { - if (value != this.overrides_) { - this.overrides_ = value; - } - } - } -});
