You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/11/11 23:08:30 UTC
[14/28] git commit: [flex-asjs] [refs/heads/develop] - add JS
versions of AS classes
add JS versions of AS classes
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/eb5eac53
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/eb5eac53
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/eb5eac53
Branch: refs/heads/develop
Commit: eb5eac533f958cbd7d65ed6b5fad9a5340e52b99
Parents: 8649231
Author: Alex Harui <ah...@apache.org>
Authored: Thu Nov 6 23:12:46 2014 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Nov 11 14:07:58 2014 -0800
----------------------------------------------------------------------
.../src/org/apache/flex/core/CallLaterBead.js | 93 ++++++++++++
.../org/apache/flex/effects/PlatformWiper.js | 71 +++++++++
.../src/org/apache/flex/events/DragEvent.js | 125 ++++++++++++++++
.../src/org/apache/flex/events/MouseEvent.js | 42 ++++++
.../js/FlexJS/src/org/apache/flex/geom/Point.js | 90 +++++++++++
.../src/org/apache/flex/geom/Rectangle.js | 148 +++++++++++++++++++
.../src/org/apache/flex/html/HContainer.js | 42 ++++++
.../js/FlexJS/src/org/apache/flex/html/HRule.js | 44 ++++++
.../FlexJS/src/org/apache/flex/html/Spacer.js | 44 ++++++
.../src/org/apache/flex/html/VContainer.js | 42 ++++++
.../src/org/apache/flex/utils/PointUtils.js | 77 ++++++++++
11 files changed, 818 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb5eac53/frameworks/js/FlexJS/src/org/apache/flex/core/CallLaterBead.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/CallLaterBead.js b/frameworks/js/FlexJS/src/org/apache/flex/core/CallLaterBead.js
new file mode 100644
index 0000000..c36af25
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/CallLaterBead.js
@@ -0,0 +1,93 @@
+/**
+ * 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.CallLaterBead');
+
+
+
+/**
+ * @constructor
+ */
+org.apache.flex.core.CallLaterBead = function() {
+
+ /**
+ * @private
+ * @type {Object}
+ */
+ this.strand_ = null;
+
+ /**
+ * @protected
+ * @type {Array}
+ */
+ this.calls_ = null;
+
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.core.CallLaterBead.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'CallLaterBead.js',
+ qName: 'org.apache.flex.core.CallLaterBead'}] };
+
+
+/**
+ * @expose
+ * @param {Object} value The new host.
+ */
+org.apache.flex.core.CallLaterBead.prototype.set_strand =
+ function(value) {
+ if (this.strand_ !== value) {
+ this.strand_ = value;
+ }
+};
+
+
+/**
+ * @protected
+ * @param {Function} fn The fucntion to call later.
+ * @param {Array=} args The optional array of arguments.
+ * @param {Object} thisArg The optional 'this' object.
+ */
+org.apache.flex.core.CallLaterBead.prototype.callLater =
+ function(fn, args, thisArg) {
+
+ if (this.calls_ == null)
+ this.calls_ = [ {thisArg: thisArg, fn: fn, args: args } ];
+ else
+ this.calls_.push({thisArg: thisArg, fn: fn, args: args });
+
+ window.setTimeout(callback, 0);
+};
+
+
+/**
+ * @protected
+ */
+org.apache.flex.core.CallLaterBead.prototype.callback =
+ function() {
+ var list = this.calls_;
+ var n = list.length;
+ for (var i = 0; i < n; i++)
+ {
+ var call = list.shift();
+ var fn = call.fn;
+ fn.apply(call.thisArg, call.args);
+ }
+};
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb5eac53/frameworks/js/FlexJS/src/org/apache/flex/effects/PlatformWiper.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/effects/PlatformWiper.js b/frameworks/js/FlexJS/src/org/apache/flex/effects/PlatformWiper.js
new file mode 100644
index 0000000..369f2e4
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/effects/PlatformWiper.js
@@ -0,0 +1,71 @@
+/**
+ * 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.effects.PlatformWiper');
+
+goog.require('org.apache.flex.geom.Rectangle');
+
+
+
+/**
+ * @constructor
+ */
+org.apache.flex.effects.PlatformWiper = function(delay, opt_repeatCount) {
+
+ /**
+ * @protected
+ * @type {Object}
+ */
+ this.target_;
+
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.effects.PlatformWiper.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'PlatformWiper',
+ qName: 'org.apache.flex.effects.PlatformWiper'}] };
+
+
+/**
+ * @expose
+ * Sets the target for the Wipe.
+ * @param {Object} target The target for the Wipe effect.
+ */
+org.apache.flex.effects.PlatformWiper.prototype.set_target =
+ function(target) {
+ if (target == null)
+ delete this.target_.style.clip;
+ this.target_ = target;
+};
+
+
+/**
+ * @expose
+ * Clips the Object.
+ * @param {org.apache.flex.geom.Rectangle} rect The visible area.
+ */
+org.apache.flex.effects.PlatformWiper.prototype.set_visibleRect =
+ function(rect) {
+ var styleString = 'rect(';
+ styleString += rect.top.toString() + 'px,';
+ styleString += rect.width.toString() + 'px,';
+ styleString += rect.height.toString() + 'px,';
+ styleString += rect.left.toString() + 'px,)';
+ this.target_.style.clip = styleString;
+};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb5eac53/frameworks/js/FlexJS/src/org/apache/flex/events/DragEvent.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/events/DragEvent.js b/frameworks/js/FlexJS/src/org/apache/flex/events/DragEvent.js
new file mode 100644
index 0000000..705b531
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/events/DragEvent.js
@@ -0,0 +1,125 @@
+/**
+ * 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.DragEvent');
+
+
+
+/**
+ * @constructor
+ * This is a shim class. A native MouseEvent is actually
+ * sent with additional properties like dragInitiator and
+ * dragSource tacked on.
+ *
+ * @extends {MouseEvent}
+ * @param {string} type The event type.
+ */
+org.apache.flex.events.DragEvent = function(type) {
+ window.MouseEvent.base(this, 'constructor', type);
+
+ this.type = type;
+};
+goog.inherits(org.apache.flex.events.DragEvent,
+ window.MouseEvent);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.events.DragEvent.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'DragEvent',
+ qName: 'org.apache.flex.events.DragEvent'}] };
+
+
+/**
+ * @expose
+ * @param {string} type The event type.
+ */
+org.apache.flex.events.DragEvent.prototype.init = function(type) {
+ this.type = type;
+};
+
+
+/**
+ * @expose
+ * @type {Object} dragInitiator The object that started the drag.
+ */
+org.apache.flex.events.DragEvent.prototype.dragInitiator = null;
+
+
+/**
+ * @expose
+ * @type {Object} dragSource The data being dragged.
+ */
+org.apache.flex.events.DragEvent.prototype.dragSource = null;
+
+
+/**
+ * @expose
+ * @param {MouseEvent} event The mouse event to copy.
+ */
+org.apache.flex.events.DragEvent.prototype.copyMouseEventProperties =
+ function(event) {
+}
+
+
+/**
+ * @expose
+ * @type {string} DRAG_START The event type for starting drag-drop.
+ */
+org.apache.flex.events.DragEvent.DRAG_START = 'dragStart';
+
+
+/**
+ * @expose
+ * @type {string} DRAG_MOVE The event type when moving mouse during drag-drop.
+ */
+org.apache.flex.events.DragEvent.DRAG_MOVE = 'dragMove';
+
+
+/**
+ * @expose
+ * @type {string} DRAG_END The event type for ending drag-drop.
+ */
+org.apache.flex.events.DragEvent.DRAG_END = 'dragEnd';
+
+
+/**
+ * @expose
+ * @type {string} DRAG_ENTER The event type for entering a potential drop target.
+ */
+org.apache.flex.events.DragEvent.DRAG_ENTER = 'dragEnter';
+
+
+/**
+ * @expose
+ * @type {string} DRAG_OVER The event type for moving over a potential drop target.
+ */
+org.apache.flex.events.DragEvent.DRAG_OVER = 'dragOver';
+
+
+/**
+ * @expose
+ * @type {string} DRAG_EXIT The event type for leaving a potential drop target.
+ */
+org.apache.flex.events.DragEvent.DRAG_EXIT = 'dragExit';
+
+
+/**
+ * @expose
+ * @type {string} DRAG_DROP The event type for dropping on a target.
+ */
+org.apache.flex.events.DragEvent.DRAG_DROP = 'dragDrop';
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb5eac53/frameworks/js/FlexJS/src/org/apache/flex/events/MouseEvent.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/events/MouseEvent.js b/frameworks/js/FlexJS/src/org/apache/flex/events/MouseEvent.js
new file mode 100644
index 0000000..88025e6
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/events/MouseEvent.js
@@ -0,0 +1,42 @@
+/**
+ * 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');
+
+
+
+/**
+ * @constructor
+ * @extends {MouseEvent}
+ * 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() {
+ window.MouseEvent.base(this, 'constructor');
+};
+goog.inherits(org.apache.flex.events.MouseEvent,
+ window.MouseEvent);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.events.MouseEvent.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'MouseEvent',
+ qName: 'org.apache.flex.events.MouseEvent' }] };
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb5eac53/frameworks/js/FlexJS/src/org/apache/flex/geom/Point.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/geom/Point.js b/frameworks/js/FlexJS/src/org/apache/flex/geom/Point.js
new file mode 100644
index 0000000..c6e183c
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/geom/Point.js
@@ -0,0 +1,90 @@
+/**
+ * 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
+ */
+org.apache.flex.geom.Point = function(x, y) {
+
+ /**
+ * @protected
+ * @type {number}
+ */
+ this.x = x;
+
+ /**
+ * @protected
+ * @type {number}
+ */
+ 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'}] };
+
+
+/**
+ * @expose
+ * The x coordinate.
+ * @return {number} value The x coordinate.
+ */
+org.apache.flex.geom.Point.prototype.get_x =
+ function() {
+ return this.x;
+};
+
+
+/**
+ * @expose
+ * The x coordinate.
+ * @param {number} value The x coordinate.
+ */
+org.apache.flex.geom.Point.prototype.set_x =
+ function(value) {
+ this.x = value;
+};
+
+
+/**
+ * @expose
+ * The y coordinate.
+ * @return {number} value The y coordinate.
+ */
+org.apache.flex.geom.Point.prototype.get_y =
+ function() {
+ return this.y;
+};
+
+
+/**
+ * @expose
+ * The y coordinate.
+ * @param {number} value The y coordinate.
+ */
+org.apache.flex.geom.Point.prototype.set_y =
+ function(value) {
+ this.y = value;
+};
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb5eac53/frameworks/js/FlexJS/src/org/apache/flex/geom/Rectangle.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/geom/Rectangle.js b/frameworks/js/FlexJS/src/org/apache/flex/geom/Rectangle.js
new file mode 100644
index 0000000..9bd82a8
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/geom/Rectangle.js
@@ -0,0 +1,148 @@
+/**
+ * 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
+ */
+org.apache.flex.geom.Rectangle = function(left, top, width, height) {
+
+ /**
+ * @protected
+ * @type {number}
+ */
+ this.left = left;
+
+ /**
+ * @protected
+ * @type {number}
+ */
+ this.top = top;
+
+ /**
+ * @protected
+ * @type {number}
+ */
+ this.width = width;
+
+ /**
+ * @protected
+ * @type {number}
+ */
+ 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'}] };
+
+
+/**
+ * @expose
+ * The left coordinate.
+ * @return {number} value The left coordinate.
+ */
+org.apache.flex.geom.Rectangle.prototype.get_left =
+ function() {
+ return this.left;
+};
+
+
+/**
+ * @expose
+ * The left coordinate.
+ * @param {number} value The left coordinate.
+ */
+org.apache.flex.geom.Rectangle.prototype.set_left =
+ function(value) {
+ this.left = value;
+};
+
+
+/**
+ * @expose
+ * The top coordinate.
+ * @return {number} value The top coordinate.
+ */
+org.apache.flex.geom.Rectangle.prototype.get_top =
+ function() {
+ return this.top;
+};
+
+
+/**
+ * @expose
+ * The top coordinate.
+ * @param {number} value The top coordinate.
+ */
+org.apache.flex.geom.Rectangle.prototype.set_top =
+ function(value) {
+ this.top = value;
+};
+
+
+/**
+ * @expose
+ * The width coordinate.
+ * @return {number} value The width coordinate.
+ */
+org.apache.flex.geom.Rectangle.prototype.get_width =
+ function() {
+ return this.width;
+};
+
+
+/**
+ * @expose
+ * The width coordinate.
+ * @param {number} value The width coordinate.
+ */
+org.apache.flex.geom.Rectangle.prototype.set_width =
+ function(value) {
+ this.width = value;
+};
+
+
+/**
+ * @expose
+ * The height coordinate.
+ * @return {number} value The height coordinate.
+ */
+org.apache.flex.geom.Rectangle.prototype.get_height =
+ function() {
+ return this.height;
+};
+
+
+/**
+ * @expose
+ * The height coordinate.
+ * @param {number} value The height coordinate.
+ */
+org.apache.flex.geom.Rectangle.prototype.set_height =
+ function(value) {
+ this.height = value;
+};
+
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb5eac53/frameworks/js/FlexJS/src/org/apache/flex/html/HContainer.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/HContainer.js b/frameworks/js/FlexJS/src/org/apache/flex/html/HContainer.js
new file mode 100644
index 0000000..4e24093
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/HContainer.js
@@ -0,0 +1,42 @@
+/**
+ * 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.html.HContainer');
+
+goog.require('org.apache.flex.html.Container');
+goog.require('org.apache.flex.core.IContainer');
+
+
+
+/**
+ * @constructor
+ * @implements {org.apache.flex.core.IContainer}
+ * @extends {org.apache.flex.core.HContainerBase}
+ */
+org.apache.flex.html.HContainer = function() {
+ org.apache.flex.html.HContainer.base(this, 'constructor');
+};
+goog.inherits(org.apache.flex.html.HContainer,
+ org.apache.flex.html.Container);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.html.HContainer.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'HContainer',
+ qName: 'org.apache.flex.html.HContainer' }],
+ interfaces: [org.apache.flex.core.IContainer] };
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb5eac53/frameworks/js/FlexJS/src/org/apache/flex/html/HRule.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/HRule.js b/frameworks/js/FlexJS/src/org/apache/flex/html/HRule.js
new file mode 100644
index 0000000..9c81982
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/HRule.js
@@ -0,0 +1,44 @@
+/**
+ * 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.html.HRule');
+
+goog.require('org.apache.flex.core.UIBase');
+
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.UIBase}
+ */
+org.apache.flex.html.HRule = function() {
+ org.apache.flex.html.HRule.base(this, 'constructor');
+
+ this.element = document.createElement('hr');
+ this.positioner = this.element;
+ this.element.flexjs_wrapper = this;
+};
+goog.inherits(org.apache.flex.html.HRule,
+ org.apache.flex.core.UIBase);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.html.Label.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'HRule',
+ qName: 'org.apache.flex.html.HRule' }] };
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb5eac53/frameworks/js/FlexJS/src/org/apache/flex/html/Spacer.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/Spacer.js b/frameworks/js/FlexJS/src/org/apache/flex/html/Spacer.js
new file mode 100644
index 0000000..96e2dcd
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/Spacer.js
@@ -0,0 +1,44 @@
+/**
+ * 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.html.Spacer');
+
+goog.require('org.apache.flex.core.UIBase');
+
+
+
+/**
+ * @constructor
+ * @extends {org.apache.flex.core.UIBase}
+ */
+org.apache.flex.html.Spacer = function() {
+ org.apache.flex.html.Spacer.base(this, 'constructor');
+
+ this.element = document.createElement('div');
+ this.positioner = this.element;
+ this.element.flexjs_wrapper = this;
+};
+goog.inherits(org.apache.flex.html.Spacer,
+ org.apache.flex.core.UIBase);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.html.Label.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'Spacer',
+ qName: 'org.apache.flex.html.Spacer' }] };
+
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb5eac53/frameworks/js/FlexJS/src/org/apache/flex/html/VContainer.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/VContainer.js b/frameworks/js/FlexJS/src/org/apache/flex/html/VContainer.js
new file mode 100644
index 0000000..bedd53b
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/VContainer.js
@@ -0,0 +1,42 @@
+/**
+ * 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.html.VContainer');
+
+goog.require('org.apache.flex.html.Container');
+goog.require('org.apache.flex.core.IContainer');
+
+
+
+/**
+ * @constructor
+ * @implements {org.apache.flex.core.IContainer}
+ * @extends {org.apache.flex.core.HContainerBase}
+ */
+org.apache.flex.html.VContainer = function() {
+ org.apache.flex.html.VContainer.base(this, 'constructor');
+};
+goog.inherits(org.apache.flex.html.VContainer,
+ org.apache.flex.html.Container);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.html.VContainer.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'VContainer',
+ qName: 'org.apache.flex.html.VContainer' }],
+ interfaces: [org.apache.flex.core.IContainer] };
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/eb5eac53/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js b/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js
new file mode 100644
index 0000000..a5a8f8c
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/PointUtils.js
@@ -0,0 +1,77 @@
+/**
+ * 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.utils.PointUtils');
+
+goog.require('org.apache.flex.geom.Point');
+
+
+
+/**
+ * @constructor
+ */
+org.apache.flex.utils.PointUtils = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org.apache.flex.utils.PointUtils.prototype.FLEXJS_CLASS_INFO =
+ { names: [{ name: 'PointUtils',
+ qName: 'org.apache.flex.utils.PointUtils' }] };
+
+
+/**
+ * @expose
+ * @param {org.apache.flex.geom.Point} point The Point to be converted.
+ * @param {Object} local The object used as reference.
+ * @return {org.apache.flex.geom.Point} The converted Point.
+ */
+org.apache.flex.utils.PointUtils.globalToLocal =
+ function(point, local) {
+ var x = point.x, y = point.y;
+ var element = local.element;
+
+ do {
+ x -= element.offsetLeft;
+ y -= element.offsetTop;
+ element = element.offsetParent;
+ }
+ while (element);
+ return new Point(x,y);
+};
+
+
+/**
+ * @expose
+ * @param {org.apache.flex.geom.Point} point The Point to be converted.
+ * @param {Object} local The object used as reference.
+ * @return {org.apache.flex.geom.Point} The converted Point.
+ */
+org.apache.flex.utils.PointUtils.localToGlobal =
+ function(point, local) {
+ var x = point.x, y = point.y;
+ var element = local.element;
+
+ do {
+ x += element.offsetLeft;
+ y += element.offsetTop;
+ element = element.offsetParent;
+ }
+ while (element);
+ return new Point(x,y);
+};