flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [23/55] [abbrv] git commit: [flex-asjs] [refs/heads/develop] - move handwritten JS code to final home. Build scripts still need fixing up
Date Wed, 15 Apr 2015 21:43:28 GMT
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBaseDataBinding.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBaseDataBinding.js b/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBaseDataBinding.js
new file mode 100644
index 0000000..6271c0f
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/ViewBaseDataBinding.js
@@ -0,0 +1,345 @@
+/**
+ * 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_ViewBaseDataBinding');
+
+goog.require('org_apache_flex_binding_ConstantBinding');
+goog.require('org_apache_flex_binding_GenericBinding');
+goog.require('org_apache_flex_binding_PropertyWatcher');
+goog.require('org_apache_flex_binding_SimpleBinding');
+goog.require('org_apache_flex_events_Event');
+goog.require('org_apache_flex_events_ValueChangeEvent');
+
+
+
+/**
+ * @constructor
+ */
+org_apache_flex_core_ViewBaseDataBinding = function() {
+
+  /**
+   * @private
+   * @type {Object}
+   */
+  this.strand_ = null;
+
+  /**
+   * @protected
+   * @type {Object}
+   */
+  this.deferredBindings = {};
+
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_ViewBaseDataBinding.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'ViewBaseDataBinding',
+                qName: 'org_apache_flex_core_ViewBaseDataBinding'}] };
+
+
+Object.defineProperties(org_apache_flex_core_ViewBaseDataBinding.prototype, {
+    /** @expose */
+    strand: {
+        /** @this {org_apache_flex_core_ViewBaseDataBinding} */
+        set: function(value) {
+            if (this.strand_ !== value) {
+              this.strand_ = value;
+              this.strand_.addEventListener('initComplete',
+              goog.bind(this.initCompleteHandler, this));
+            }
+        }
+    }
+});
+
+
+/**
+ * @protected
+ * @param {Object} event The event.
+ */
+org_apache_flex_core_ViewBaseDataBinding.prototype.initCompleteHandler =
+    function(event) {
+
+  var prop;
+  var fieldWatcher;
+  var sb;
+  var bindingData = this.strand_._bindings;
+  var n = bindingData[0];
+  var bindings = [];
+  var i;
+  var binding;
+  var destination;
+  var index = 1;
+  for (i = 0; i < n; i++)
+  {
+    binding = {};
+    binding.source = bindingData[index++];
+    binding.destFunc = bindingData[index++];
+    binding.destination = bindingData[index++];
+    bindings.push(binding);
+  }
+  var watchers = this.decodeWatcher(bindingData.slice(index));
+  for (i = 0; i < n; i++)
+  {
+    binding = bindings[i];
+    // try to determine if it is an array
+    if (typeof(binding.source) == 'object' &&
+            typeof(binding.source.slice) == 'function')
+    {
+      if (binding.source[0] == 'applicationModel')
+      {
+        if (binding.source.length == 2 &&
+            binding.destination.length == 2)
+        {
+          // can be simplebinding or constantbinding
+          var modelWatcher =
+              watchers.watcherMap.applicationModel;
+          var childMap = modelWatcher.children.watcherMap;
+          fieldWatcher = childMap[binding.source[1]];
+          if (typeof(fieldWatcher.eventNames) == 'string')
+          {
+            sb = new org_apache_flex_binding_SimpleBinding();
+            sb.destinationPropertyName =
+                binding.destination[1];
+            sb.eventName = fieldWatcher.eventNames;
+            sb.sourceID = binding.source[0];
+            sb.sourcePropertyName = binding.source[1];
+            sb.setDocument(this.strand_);
+            prop = binding.destination[0];
+
+            destination = this.strand_[prop];
+
+            if (destination)
+              destination.addBead(sb);
+            else
+            {
+              this.deferredBindings[prop] =
+                  sb;
+              this.strand_.addEventListener('valueChange',
+                  goog.bind(this.deferredBindingsHandler, this));
+            }
+          }
+          else if (fieldWatcher.eventNames == null)
+          {
+            var cb;
+            cb = org_apache_flex_binding_ConstantBinding;
+            cb = new cb();
+            cb.destinationPropertyName =
+                binding.destination[1];
+            cb.sourceID = binding.source[0];
+            cb.sourcePropertyName = binding.source[1];
+            cb.setDocument(this.strand_);
+            prop = binding.destination[0];
+            destination = this.strand_[prop];
+
+            if (destination)
+              destination.addBead(cb);
+            else
+            {
+              this.deferredBindings[prop] =
+                  cb;
+              this.strand_.addEventListener('valueChange',
+                  this.deferredBindingsHandler);
+            }
+          }
+        }
+      }
+    }
+    else if (typeof(binding.source) == 'string')
+    {
+      fieldWatcher = watchers.watcherMap[binding.source];
+      if (typeof(fieldWatcher.eventNames) == 'string')
+      {
+        sb = new org_apache_flex_binding_SimpleBinding();
+        sb.destinationPropertyName = binding.destination[1];
+        sb.eventName = fieldWatcher.eventNames;
+        sb.sourcePropertyName = binding.source;
+        sb.setDocument(this.strand_);
+        prop = binding.destination[0];
+        destination = this.strand_[prop];
+
+        if (destination)
+          destination.addBead(sb);
+        else
+        {
+          this.deferredBindings[prop] = sb;
+          this.strand_.addEventListener('valueChange',
+              this.deferredBindingsHandler);
+        }
+      }
+    }
+    else
+    {
+      this.makeGenericBinding(binding, i, watchers);
+    }
+  }
+};
+
+
+/**
+ * @protected
+ * @param {Object} binding The binding object.
+ * @param {number} index The offset in the Binding database.
+ * @param {Object} watchers The database of Watchers.
+ */
+org_apache_flex_core_ViewBaseDataBinding.prototype.makeGenericBinding =
+    function(binding, index, watchers) {
+  var gb = new org_apache_flex_binding_GenericBinding();
+  gb.setDocument(this.strand_);
+  gb.destinationData = binding.destination;
+  gb.destinationFunction = binding.destFunc;
+  gb.source = binding.source;
+  this.setupWatchers(gb, index, watchers.watchers, null);
+};
+
+
+/**
+ * @protected
+ * @param {Object} gb The generic binding object.
+ * @param {number} index The offset in the Binding database.
+ * @param {Object} watchers The array of Watchers.
+ * @param {Object} parentWatcher The parent Watcher or null if top.
+ */
+org_apache_flex_core_ViewBaseDataBinding.prototype.setupWatchers =
+    function(gb, index, watchers, parentWatcher) {
+  var i, n;
+  n = watchers.length;
+  for (i = 0; i < n; i++)
+  {
+    var watcher = watchers[i];
+    if (watcher.bindings.indexOf(index) != -1)
+    {
+      var type = watcher.type;
+      switch (type)
+      {
+        case 'property':
+          {
+            var pw = new org_apache_flex_binding_PropertyWatcher(
+                this,
+                watcher.propertyName,
+                watcher.eventNames,
+                watcher.getterFunction);
+            watcher.watcher = pw;
+            if (parentWatcher)
+              pw.parentChanged(parentWatcher.value);
+            else
+              pw.parentChanged(this.strand_);
+            if (parentWatcher)
+              parentWatcher.addChild(pw);
+            if (watcher.children == null)
+              pw.addBinding(gb);
+            break;
+          }
+      }
+      if (watcher.children)
+      {
+        this.setupWatchers(gb, index, watcher.children,
+            watcher.watcher);
+      }
+    }
+  }
+};
+
+
+/**
+ * @protected
+ * @param {Object} bindingData The watcher data to decode.
+ * @return {Object} The watcher tree structure.
+ */
+org_apache_flex_core_ViewBaseDataBinding.prototype.decodeWatcher =
+    function(bindingData) {
+  var watcherMap = {};
+  var watchers = [];
+  var n = bindingData.length - 1; // there is an extra null because
+  // it is easier for the compiler
+  var index = 0;
+  var watcherData;
+  while (index < n)
+  {
+    var watcherIndex = bindingData[index++];
+    var type = bindingData[index++];
+    switch (type)
+    {
+      case 0:
+        {
+          watcherData = { type: 'function' };
+          watcherData.functionName = bindingData[index++];
+          watcherData.paramFunction = bindingData[index++];
+          watcherData.eventNames = bindingData[index++];
+          watcherData.bindings = bindingData[index++];
+          break;
+        }
+      case 1:
+        {
+          watcherData = { type: 'static' };
+          watcherData.propertyName = bindingData[index++];
+          watcherData.eventNames = bindingData[index++];
+          watcherData.bindings = bindingData[index++];
+          watcherData.getterFunction = bindingData[index++];
+          watcherData.parentObj = bindingData[index++];
+          watcherMap[watcherData.propertyName] = watcherData;
+          break;
+        }
+      case 2:
+        {
+          watcherData = { type: 'property' };
+          watcherData.propertyName = bindingData[index++];
+          watcherData.eventNames = bindingData[index++];
+          watcherData.bindings = bindingData[index++];
+          watcherData.getterFunction = bindingData[index++];
+          watcherMap[watcherData.propertyName] = watcherData;
+          break;
+        }
+      case 3:
+        {
+          watcherData = { type: 'xml' };
+          watcherData.propertyName = bindingData[index++];
+          watcherData.bindings = bindingData[index++];
+          watcherMap[watcherData.propertyName] = watcherData;
+          break;
+        }
+    }
+    watcherData.children = bindingData[index++];
+    if (watcherData.children != null)
+    {
+      watcherData.children = this.decodeWatcher(watcherData.children);
+    }
+    watcherData.index = watcherIndex;
+    watchers.push(watcherData);
+  }
+  return { watchers: watchers, watcherMap: watcherMap };
+};
+
+
+/**
+ * @protected
+ * @param {org_apache_flex_events_ValueChangeEvent} event The event.
+ */
+org_apache_flex_core_ViewBaseDataBinding.prototype.deferredBindingsHandler =
+    function(event) {
+  var p;
+  var destination;
+  for (p in this.deferredBindings)
+  {
+    if (p != event.propertyName) continue;
+    destination = this.strand_[p];
+    destination.addBead(this.deferredBindings[p]);
+    delete this.deferredBindings[p];
+  }
+};
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Circle.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Circle.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Circle.js
new file mode 100644
index 0000000..9dba559
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Circle.js
@@ -0,0 +1,101 @@
+/**
+ * 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_graphics_Circle');
+
+goog.require('org_apache_flex_core_graphics_GraphicShape');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GraphicShape}
+ */
+org_apache_flex_core_graphics_Circle = function() {
+  org_apache_flex_core_graphics_Circle.base(this, 'constructor');
+
+   /**
+   * @private
+   * @type {number}
+   */
+  this.radius_ = 0;
+};
+goog.inherits(org_apache_flex_core_graphics_Circle,
+    org_apache_flex_core_graphics_GraphicShape);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_Circle.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'Circle',
+                qName: 'org_apache_flex_core_graphics_Circle' }] };
+
+
+
+Object.defineProperties(org_apache_flex_core_graphics_Circle.prototype, {
+    /** @expose */
+    radius: {
+        /** @this {org_apache_flex_core_graphics_Circle} */
+        set: function(v) {
+            this.radius_ = v;
+        },
+        /** @this {org_apache_flex_core_graphics_Circle} */
+        get: function() {
+            return this.radius_;
+        }
+    }
+});
+
+
+/**
+ * @expose
+ * @param {number} x The x location of the center of the circle.
+ * @param {number} y The y location of the center of the circle.
+ * @param {number} radius The radius of the circle.
+ */
+org_apache_flex_core_graphics_Circle.prototype.drawCircle = function(x, y, radius) {
+    var style = this.getStyleStr();
+    var circle = document.createElementNS('http://www.w3.org/2000/svg', 'ellipse');
+    circle.flexjs_wrapper = this;
+    circle.setAttribute('style', style);
+    if (this.stroke)
+    {
+      circle.setAttribute('cx', String(radius + this.stroke.weight));
+      circle.setAttribute('cy', String(radius + this.stroke.weight));
+      this.setPosition(x - radius, y - radius, this.stroke.weight, this.stroke.weight);
+    }
+    else
+    {
+      circle.setAttribute('cx', String(radius));
+      circle.setAttribute('cy', String(radius));
+      this.setPosition(x - radius, y - radius, 0, 0);
+    }
+
+    circle.setAttribute('rx', String(radius));
+    circle.setAttribute('ry', String(radius));
+    this.element.appendChild(circle);
+
+    this.resize(x, y, circle.getBBox());
+  };
+
+
+/**
+ * @override
+ */
+org_apache_flex_core_graphics_Circle.prototype.draw = function() {
+    this.drawCircle(this.x, this.y, this.radius);
+  };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Ellipse.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Ellipse.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Ellipse.js
new file mode 100644
index 0000000..65469bb
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Ellipse.js
@@ -0,0 +1,80 @@
+/**
+ * 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_graphics_Ellipse');
+
+goog.require('org_apache_flex_core_graphics_GraphicShape');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GraphicShape}
+ */
+org_apache_flex_core_graphics_Ellipse = function() {
+  org_apache_flex_core_graphics_Ellipse.base(this, 'constructor');
+
+};
+goog.inherits(org_apache_flex_core_graphics_Ellipse,
+    org_apache_flex_core_graphics_GraphicShape);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_Ellipse.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'Ellipse',
+                qName: 'org_apache_flex_core_graphics_Ellipse' }] };
+
+
+/**
+ * @expose
+ * @param {number} x The x position of the top-left corner of the bounding box of the ellipse.
+ * @param {number} y The y position of the top-left corner of the bounding box of the ellipse.
+ * @param {number} width The width of the ellipse.
+ * @param {number} height The height of the ellipse.
+ */
+org_apache_flex_core_graphics_Ellipse.prototype.drawEllipse = function(x, y, width, height) {
+    var style = this.getStyleStr();
+    var ellipse = document.createElementNS('http://www.w3.org/2000/svg', 'ellipse');
+    ellipse.flexjs_wrapper = this;
+    ellipse.setAttribute('style', style);
+    if (this.stroke)
+    {
+      ellipse.setAttribute('cx', String(width / 2 + this.stroke.weight));
+      ellipse.setAttribute('cy', String(height / 2 + this.stroke.weight));
+      this.setPosition(x, y, this.stroke.weight * 2, this.stroke.weight * 2);
+    }
+    else
+    {
+      ellipse.setAttribute('cx', String(width / 2));
+      ellipse.setAttribute('cy', String(height / 2));
+      this.setPosition(x, y, 0, 0);
+    }
+    ellipse.setAttribute('rx', String(width / 2));
+    ellipse.setAttribute('ry', String(height / 2));
+    this.element.appendChild(ellipse);
+
+    this.resize(x, y, ellipse.getBBox());
+  };
+
+
+/**
+ * @override
+*/
+org_apache_flex_core_graphics_Ellipse.prototype.draw = function() {
+    this.drawEllipse(this.x, this.y, this.width, this.height);
+  };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GradientBase.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GradientBase.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GradientBase.js
new file mode 100644
index 0000000..3d66aaf
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GradientBase.js
@@ -0,0 +1,141 @@
+/**
+ * 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.
+ */
+
+/**
+ * org_apache_flex_core_graphics_GradientBase
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('org_apache_flex_core_graphics_GradientBase');
+
+
+
+/**
+ * @constructor
+ */
+org_apache_flex_core_graphics_GradientBase = function() {
+};
+
+
+/**
+ * @protected
+ * @type {Array}
+ */
+org_apache_flex_core_graphics_GradientBase.prototype.colors = [];
+
+
+/**
+ * @protected
+ * @type {Array}
+ */
+org_apache_flex_core_graphics_GradientBase.prototype.ratios = [];
+
+
+/**
+ * @protected
+ * @type {Array}
+ */
+org_apache_flex_core_graphics_GradientBase.prototype.alphas = [];
+
+
+/**
+ * @type {Array}
+ */
+org_apache_flex_core_graphics_GradientBase.prototype._entries = [];
+
+
+/**
+ * @type {number}
+ */
+org_apache_flex_core_graphics_GradientBase.prototype._rotation = 0.0;
+
+
+Object.defineProperties(org_apache_flex_core_graphics_GradientBase.prototype, {
+    /** @expose */
+    entries: {
+        /** @this {org_apache_flex_core_graphics_GradientBase} */
+        get: function() {
+            return this._entries;
+        },
+        /** @this {org_apache_flex_core_graphics_GradientBase} */
+        set: function(value) {
+            this._entries = value;
+        }
+    },
+    /** @expose */
+    rotation: {
+        /** @this {org_apache_flex_core_graphics_GradientBase} */
+        get: function() {
+            return this._rotation;
+        },
+        /** @this {org_apache_flex_core_graphics_GradientBase} */
+        set: function(value) {
+            this._rotation = value;
+        }
+    },
+    /** @expose */
+    x: {
+        /** @this {org_apache_flex_core_graphics_GradientBase} */
+        get: function() {
+            return this._x;
+        },
+        /** @this {org_apache_flex_core_graphics_GradientBase} */
+        set: function(value) {
+            this._x = value;
+        }
+    },
+    /** @expose */
+    y: {
+        /** @this {org_apache_flex_core_graphics_GradientBase} */
+        set: function(value) {
+            this._y = value;
+        },
+        /** @this {org_apache_flex_core_graphics_GradientBase} */
+        get: function() {
+            return this._y;
+        }
+    },
+    /** @expose */
+    newId: {
+        /** @this {org_apache_flex_core_graphics_GradientBase} */
+        get: function() {
+            return 'gradient' + String(Math.floor((Math.random() * 100000) + 1));
+        }
+    }
+});
+
+
+/**
+ * @type {number}
+ */
+org_apache_flex_core_graphics_GradientBase.prototype._x = 0;
+
+
+/**
+ * @type {number}
+ */
+org_apache_flex_core_graphics_GradientBase.prototype._y = 0;
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_GradientBase.prototype.FLEXJS_CLASS_INFO = {
+    names: [{ name: 'GradientBase', qName: 'org_apache_flex_core_graphics_GradientBase'}]
+  };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GradientEntry.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GradientEntry.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GradientEntry.js
new file mode 100644
index 0000000..632a4ed
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GradientEntry.js
@@ -0,0 +1,126 @@
+/**
+ * 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.
+ */
+
+/**
+ * org_apache_flex_core_graphics_GradientEntry
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('org_apache_flex_core_graphics_GradientEntry');
+
+
+
+/**
+ * @constructor
+ * @param {number} alpha
+ * @param {number} color
+ * @param {number} ratio
+ */
+org_apache_flex_core_graphics_GradientEntry = function(alpha, color, ratio) {
+  this._alpha = alpha;
+  this._color = color;
+  this._ratio = ratio;
+};
+
+
+/**
+ * @type {number}
+ */
+org_apache_flex_core_graphics_GradientEntry.prototype._alpha = 1.0;
+
+
+/**
+ * @type {number}
+ */
+org_apache_flex_core_graphics_GradientEntry.prototype._color = 0x000000;
+
+
+/**
+ * @type {number}
+ */
+org_apache_flex_core_graphics_GradientEntry.prototype._ratio = 0x000000;
+
+
+Object.defineProperties(org_apache_flex_core_graphics_GradientEntry.prototype, {
+    /** @expose */
+    alpha: {
+        /** @this {org_apache_flex_core_graphics_GradientEntry} */
+        get: function() {
+            return this._alpha;
+        },
+        /** @this {org_apache_flex_core_graphics_GradientEntry} */
+        set: function(value) {
+            var /** @type {number} */ oldValue = this._alpha;
+            if (value != oldValue) {
+                this._alpha = value;
+            }
+        }
+    },
+    /** @expose */
+    color: {
+        /** @this {org_apache_flex_core_graphics_GradientEntry} */
+        get: function() {
+            return this._color;
+        },
+        /** @this {org_apache_flex_core_graphics_GradientEntry} */
+        set: function(value) {
+            var /** @type {number} */ oldValue = this._color;
+            if (value != oldValue) {
+              this._color = value;
+            }
+        }
+    },
+    /** @expose */
+    ratio: {
+        /** @this {org_apache_flex_core_graphics_GradientEntry} */
+        get: function() {
+            return this._ratio;
+        },
+        /** @this {org_apache_flex_core_graphics_GradientEntry} */
+        set: function(value) {
+            this._ratio = value;
+        }
+    }
+});
+
+
+/**
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} s
+ */
+org_apache_flex_core_graphics_GradientEntry.prototype.begin = function(s) {
+  s.graphics.beginFill(this.color, this.alpha);
+};
+
+
+/**
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} s
+ */
+org_apache_flex_core_graphics_GradientEntry.prototype.end = function(s) {
+  s.graphics.endFill();
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_GradientEntry.prototype.FLEXJS_CLASS_INFO = {
+    names: [{ name: 'GradientEntry', qName: 'org_apache_flex_core_graphics_GradientEntry'}]
+  };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GraphicShape.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GraphicShape.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GraphicShape.js
new file mode 100644
index 0000000..4f6851c
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GraphicShape.js
@@ -0,0 +1,204 @@
+/**
+ * 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_graphics_GraphicShape');
+goog.require('org_apache_flex_core_UIBase');
+goog.require('org_apache_flex_core_graphics_SolidColor');
+goog.require('org_apache_flex_core_graphics_SolidColorStroke');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_UIBase}
+ */
+org_apache_flex_core_graphics_GraphicShape = function() {
+
+  org_apache_flex_core_graphics_GraphicShape.base(this, 'constructor');
+
+  /**
+   * @private
+   * @type {org_apache_flex_core_graphics_IFill}
+   */
+  this.fill_ = null;
+
+  /**
+   * @private
+   * @type {org_apache_flex_core_graphics_IStroke}
+   */
+  this.stroke_ = null;
+
+   /**
+   * @private
+   * @type {number}
+   */
+  this.x_ = 0;
+
+  /**
+   * @private
+   * @type {number}
+   */
+  this.y_ = 0;
+
+  /**
+   * @private
+   * @type {number}
+   */
+  this.xOffset_ = 0;
+
+  /**
+   * @private
+   * @type {number}
+   */
+  this.yOffset_ = 0;
+
+    /**
+   * @expose
+   * @type {SVGElement}
+   */
+  this.element = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
+  this.element.flexjs_wrapper = this;
+  this.element.offsetLeft = 0;
+  this.element.offsetTop = 0;
+  this.element.offsetParent = null;
+  this.positioner = this.element;
+};
+goog.inherits(org_apache_flex_core_graphics_GraphicShape,
+    org_apache_flex_core_UIBase);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_GraphicShape.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'GraphicShape',
+                qName: 'org_apache_flex_core_graphics_GraphicShape' }] };
+
+
+Object.defineProperties(org_apache_flex_core_graphics_GraphicShape.prototype, {
+    /** @expose */
+    fill: {
+        /** @this {org_apache_flex_core_graphics_GraphicShape} */
+        get: function() {
+            return this.fill_;
+        },
+        /** @this {org_apache_flex_core_graphics_GraphicShape} */
+        set: function(value) {
+            this.fill_ = value;
+        }
+    },
+    stroke: {
+        /** @this {org_apache_flex_core_graphics_GraphicShape} */
+        get: function() {
+            return this.stroke_;
+        },
+        /** @this {org_apache_flex_core_graphics_GraphicShape} */
+        set: function(value) {
+            this.stroke_ = value;
+        }
+    }
+});
+
+
+/**
+ *
+ */
+org_apache_flex_core_graphics_GraphicShape.prototype.addedToParent = function() {
+  this.draw();
+  this.element.style.overflow = 'visible';
+  /*
+   * not sure this is valuable any longer
+  var bbox = this.element.getBBox();
+  if (bbox.width === 0 && !isNaN(this.width)) bbox.width = this.width;
+  if (bbox.height === 0 && !isNaN(this.height)) bbox.height = this.height;
+  this.resize(this.x, this.y, bbox);*/
+};
+
+
+/**
+ * This is where the drawing methods get called from.
+ */
+org_apache_flex_core_graphics_GraphicShape.prototype.draw = function() {
+  //Overwrite in subclass
+};
+
+
+/**
+ * @expose
+ * @return {string} The style attribute.
+ */
+org_apache_flex_core_graphics_GraphicShape.prototype.getStyleStr = function() {
+  var fillStr;
+  if (this.fill)
+  {
+    fillStr = this.fill.addFillAttrib(this);
+  }
+  else
+  {
+    fillStr = 'fill:none';
+  }
+
+  var strokeStr;
+  if (this.stroke)
+  {
+    strokeStr = this.stroke.addStrokeAttrib(this);
+  }
+  else
+  {
+    strokeStr = 'stroke:none';
+  }
+
+
+  return fillStr + ';' + strokeStr;
+};
+
+
+/**
+ * @expose
+ * @param {number} x X position.
+ * @param {number} y Y position.
+ * @param {Object} bbox The bounding box of the svg element.
+ */
+org_apache_flex_core_graphics_GraphicShape.prototype.resize = function(x, y, bbox) {
+  var width = Math.max(this.width, bbox.width);
+  var height = Math.max(this.height, bbox.height);
+
+  this.element.style.position = 'absolute';
+  if (!isNaN(x)) this.element.style.top = String(x) + 'px';
+  if (!isNaN(y)) this.element.style.left = String(y) + 'px';
+  this.element.style.width = String(width) + 'px';
+  this.element.style.height = String(height) + 'px';
+  this.element.offsetLeft = x;
+  this.element.offsetTop = y;
+};
+
+
+/**
+ * @expose
+ * @param {number} x X position.
+ * @param {number} y Y position.
+ * @param {number} xOffset offset from x position.
+ * @param {number} yOffset offset from y position.
+ */
+org_apache_flex_core_graphics_GraphicShape.prototype.setPosition = function(x, y, xOffset, yOffset) {
+  this.x_ = x;
+  this.y_ = y;
+  this.xOffset_ = xOffset;
+  this.yOffset_ = yOffset;
+  this.element.offsetLeft = xOffset;
+  this.element.offsetTop = yOffset;
+};
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GraphicsContainer.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GraphicsContainer.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GraphicsContainer.js
new file mode 100644
index 0000000..b5ec97f
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/GraphicsContainer.js
@@ -0,0 +1,232 @@
+/**
+ * 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_graphics_GraphicsContainer');
+
+goog.require('org_apache_flex_core_graphics_GraphicShape');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GraphicShape}
+ */
+org_apache_flex_core_graphics_GraphicsContainer = function() {
+  org_apache_flex_core_graphics_GraphicsContainer.base(this, 'constructor');
+};
+goog.inherits(org_apache_flex_core_graphics_GraphicsContainer, org_apache_flex_core_graphics_GraphicShape);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'GraphicsContainer',
+      qName: 'org_apache_flex_core_graphics_GraphicsContainer'}] };
+
+
+/**
+ * @expose
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.removeAllElements = function() {
+  var svg = this.element;
+  while (svg.lastChild) {
+    svg.removeChild(svg.lastChild);
+  }
+};
+
+
+Object.defineProperties(org_apache_flex_core_graphics_GraphicsContainer.prototype, {
+    /** @expose */
+    numChildren: {
+        /** @this {org_apache_flex_core_graphics_GraphicsContainer} */
+        get: function() {
+            return this.internalChildren().length;
+        }
+    },
+    /** @expose */
+    width: {
+        /** @this {org_apache_flex_core_graphics_GraphicsContainer} */
+        set: function(value) {
+            org_apache_flex_utils_Language.superSetter(
+                org_apache_flex_core_graphics_GraphicsContainer, this, 'width', value);
+            this.element.setAttribute('width', String(value) + 'px');
+            this.element.style.width = String(value) + 'px';
+        }
+    },
+    /** @expose */
+    height: {
+        /** @this {org_apache_flex_core_graphics_GraphicsContainer} */
+        set: function(value) {
+            org_apache_flex_utils_Language.superSetter(
+                org_apache_flex_core_graphics_GraphicsContainer, this, 'height', value);
+            this.element.setAttribute('height', String(value) + 'px');
+            this.element.style.height = String(value) + 'px';
+        }
+    },
+    /** @expose */
+    x: {
+        /** @this {org_apache_flex_core_graphics_GraphicsContainer} */
+        set: function(value) {
+            org_apache_flex_utils_Language.superSetter(
+                org_apache_flex_core_graphics_GraphicsContainer, this, 'x', value);
+            this.element.setAttribute('x', String(value) + 'px');
+            this.element.style.position = 'absolute';
+            this.element.style.left = String(value) + 'px';
+            this.element.offsetLeft = value;
+        }
+    },
+    /** @expose */
+    y: {
+        /** @this {org_apache_flex_core_graphics_GraphicsContainer} */
+        set: function(value) {
+            org_apache_flex_utils_Language.superSetter(
+                org_apache_flex_core_graphics_GraphicsContainer, this, 'y', value);
+            this.element.setAttribute('y', String(value) + 'px');
+            this.element.style.position = 'absolute';
+            this.element.style.top = String(value) + 'px';
+            this.element.offsetTop = value;
+        }
+    }
+});
+
+
+/**
+ * @expose
+ * @param {number} x The x position of the top-left corner of the rectangle.
+ * @param {number} y The y position of the top-left corner.
+ * @param {number} width The width of the rectangle.
+ * @param {number} height The height of the rectangle.
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.drawRect = function(x, y, width, height) {
+  var style = this.getStyleStr();
+  var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
+  rect.flexjs_wrapper = this;
+  rect.offsetLeft = x;
+  rect.offsetTop = y;
+  rect.offsetParent = this;
+  rect.setAttribute('style', style);
+  rect.setAttribute('x', String(x) + 'px');
+  rect.setAttribute('y', String(y) + 'px');
+  rect.setAttribute('width', String(width) + 'px');
+  rect.setAttribute('height', String(height) + 'px');
+  this.element.appendChild(rect);
+};
+
+
+/**
+ * @expose
+ * @param {number} x The x position of the top-left corner of the bounding box of the ellipse.
+ * @param {number} y The y position of the top-left corner of the bounding box of the ellipse.
+ * @param {number} width The width of the ellipse.
+ * @param {number} height The height of the ellipse.
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.drawEllipse = function(x, y, width, height) {
+  var style = this.getStyleStr();
+  var ellipse = document.createElementNS('http://www.w3.org/2000/svg', 'ellipse');
+  ellipse.flexjs_wrapper = this;
+  ellipse.offsetLeft = x;
+  ellipse.offsetTop = y;
+  ellipse.offsetParent = this;
+  ellipse.setAttribute('style', style);
+  ellipse.setAttribute('cx', String(x + width / 2));
+  ellipse.setAttribute('cy', String(y + height / 2));
+  ellipse.setAttribute('rx', String(width / 2));
+  ellipse.setAttribute('ry', String(height / 2));
+  this.element.appendChild(ellipse);
+};
+
+
+/**
+ * @expose
+ * @param {number} x The x location of the center of the circle.
+ * @param {number} y The y location of the center of the circle.
+ * @param {number} radius The radius of the circle.
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.drawCircle = function(x, y, radius) {
+  var style = this.getStyleStr();
+  var circle = document.createElementNS('http://www.w3.org/2000/svg', 'ellipse');
+  circle.flexjs_wrapper = this;
+  circle.offsetLeft = x;
+  circle.offsetTop = y;
+  circle.offsetParent = this;
+  circle.setAttribute('style', style);
+  circle.setAttribute('cx', String(x));
+  circle.setAttribute('cy', String(y));
+  circle.setAttribute('rx', String(radius));
+  circle.setAttribute('ry', String(radius));
+  this.element.appendChild(circle);
+};
+
+
+/**
+ * @expose
+ * @param {string} data A string containing a compact represention of the path segments.
+ *  The value is a space-delimited string describing each path segment. Each
+ *  segment entry has a single character which denotes the segment type and
+ *  two or more segment parameters.
+ *
+ *  If the segment command is upper-case, the parameters are absolute values.
+ *  If the segment command is lower-case, the parameters are relative values.
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.drawPath = function(data) {
+  var style = this.getStyleStr();
+  var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+  path.flexjs_wrapper = this;
+  path.offsetLeft = 0;
+  path.offsetTop = 0;
+  path.offsetParent = this;
+  path.setAttribute('style', style);
+  path.setAttribute('d', data);
+  this.element.appendChild(path);
+};
+
+
+/**
+ * @expose
+ * @param {string} value The text string to draw.
+ * @param {number} x The x position of the text.
+ * @param {number} y The y position of the text.
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.drawText = function(value, x, y) {
+  var style = this.getStyleStr();
+  var text = document.createElementNS('http://www.w3.org/2000/svg', 'text');
+  text.flexjs_wrapper = this;
+  text.offsetLeft = x;
+  text.offsetTop = y;
+  text.offsetParent = this;
+  text.setAttribute('style', style);
+  text.setAttribute('x', String(x) + 'px');
+  text.setAttribute('y', String(y + 15) + 'px');
+  var textNode = document.createTextNode(value);
+  text.appendChild(textNode);
+  this.element.appendChild(text);
+};
+
+
+/**
+ * @expose
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.drawLine = function() {
+};
+
+
+/**
+ * @expose
+ */
+org_apache_flex_core_graphics_GraphicsContainer.prototype.drawPolygon = function() {
+};
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/IFill.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/IFill.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/IFill.js
new file mode 100644
index 0000000..ac572d7
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/IFill.js
@@ -0,0 +1,52 @@
+/**
+ * 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_core_graphics_IFill');
+
+
+
+/**
+ * IFill
+ *
+ * @interface
+ */
+org_apache_flex_core_graphics_IFill = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_IFill.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'IFill',
+                qName: 'org_apache_flex_core_graphics_IFill' }] };
+
+
+/**
+ * addFillAttrib()
+ *
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} value The GraphicShape object on which the fill must be added.
+ * @return {string} The fill style attribute.
+ */
+org_apache_flex_core_graphics_IFill.prototype.addFillAttrib =
+    function(value) {};
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/IStroke.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/IStroke.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/IStroke.js
new file mode 100644
index 0000000..398b4e6
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/IStroke.js
@@ -0,0 +1,52 @@
+/**
+ * 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_core_graphics_IStroke');
+
+
+
+/**
+ * IStroke
+ *
+ * @interface
+ */
+org_apache_flex_core_graphics_IStroke = function() {
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_IStroke.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'IStroke',
+                qName: 'org_apache_flex_core_graphics_IStroke' }] };
+
+
+/**
+ * addStrokeAttrib()
+ *
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} value The GraphicShape object on which the stroke must be added.
+ * @return {string} The stroke style attribute.
+ */
+org_apache_flex_core_graphics_IStroke.prototype.addStrokeAttrib =
+    function(value) {};
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Line.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Line.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Line.js
new file mode 100644
index 0000000..b45f8d7
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Line.js
@@ -0,0 +1,79 @@
+/**
+ * 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_graphics_Line');
+
+goog.require('org_apache_flex_core_graphics_GraphicShape');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GraphicShape}
+ */
+org_apache_flex_core_graphics_Line = function() {
+  org_apache_flex_core_graphics_Line.base(this, 'constructor');
+
+};
+goog.inherits(org_apache_flex_core_graphics_Line,
+    org_apache_flex_core_graphics_GraphicShape);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_Line.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'Line',
+                qName: 'org_apache_flex_core_graphics_Line' }] };
+
+
+/**
+ * @expose
+ *  @param {number} x1 The x1 attribute defines the start of the line on the x-axis.
+ *  @param {number} y1 The y1 attribute defines the start of the line on the y-axis.
+ *  @param {number} x2 The x2 attribute defines the end of the line on the x-axis.
+ *  @param {number} y2 The y2 attribute defines the end of the line on the y-axis.
+ */
+org_apache_flex_core_graphics_Line.prototype.drawLine = function(x1, y1, x2, y2) {
+    var style = this.getStyleStr();
+    var line = document.createElementNS('http://www.w3.org/2000/svg', 'line');
+    line.flexjs_wrapper = this;
+    line.setAttribute('style', style);
+    line.setAttribute('x1', 0);
+    line.setAttribute('y1', y1);
+    line.setAttribute('x2', x2 - x1);
+    line.setAttribute('y2', y2);
+    this.setPosition(x1, y2, this.stroke.weight, this.stroke.weight);
+    this.element.appendChild(line);
+
+    this.resize(x, y, line.getBBox());
+  };
+
+
+/**
+ * @override
+ * @expose
+ * @param {number} x X position.
+ * @param {number} y Y position.
+ * @param {Object} bbox The bounding box of the svg element.
+ */
+org_apache_flex_core_graphics_Line.prototype.resize = function(x, y, bbox) {
+  this.element.setAttribute('width', String(bbox.width) + 'px');
+  this.element.setAttribute('height', String(bbox.height) + 'px');
+
+  this.element.setAttribute('style', 'position:absolute; left:' + String(x + bbox.x - this.xOffset_) +
+      'px; top:' + String(bbox.y - this.yOffset_) + 'px;');
+};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/LinearGradient.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/LinearGradient.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/LinearGradient.js
new file mode 100644
index 0000000..5711ffc
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/LinearGradient.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.
+ */
+
+/**
+ * org_apache_flex_core_graphics_LinearGradient
+ *
+ * @fileoverview
+ *
+ * @suppress {checkTypes}
+ */
+
+goog.provide('org_apache_flex_core_graphics_LinearGradient');
+goog.require('org_apache_flex_core_graphics_GradientBase');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GradientBase}
+ * @implements {org_apache_flex_core_graphics_IFill}
+ */
+org_apache_flex_core_graphics_LinearGradient = function() {
+  org_apache_flex_core_graphics_LinearGradient.base(this, 'constructor');
+};
+goog.inherits(org_apache_flex_core_graphics_LinearGradient, org_apache_flex_core_graphics_GradientBase);
+
+
+/**
+ * @type {number}
+ */
+org_apache_flex_core_graphics_LinearGradient.prototype._scaleX = 1.0;
+
+
+Object.defineProperties(org_apache_flex_core_graphics_LinearGradient.prototype, {
+    /** @expose */
+    scaleX: {
+        /** @this {org_apache_flex_core_graphics_LinearGradient} */
+        get: function() {
+            return this._scaleX;
+        },
+        /** @this {org_apache_flex_core_graphics_LinearGradient} */
+        set: function(value) {
+            this._scaleX = value;
+        }
+    }
+});
+
+
+/**
+ * addFillAttrib()
+ *
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} value The GraphicShape object on which the fill must be added.
+ * @return {string}
+ */
+org_apache_flex_core_graphics_LinearGradient.prototype.addFillAttrib = function(value) {
+  //Create and add a linear gradient def
+  var svgNS = value.element.namespaceURI;
+  var grad = document.createElementNS(svgNS, 'linearGradient');
+  var gradientId = this.newId;
+  grad.setAttribute('id', gradientId);
+
+  //Set x1, y1, x2, y2 of gradient
+  grad.setAttribute('x1', '0%');
+  grad.setAttribute('y1', '0%');
+  grad.setAttribute('x2', '100%');
+  grad.setAttribute('y2', '0%');
+
+  //Apply rotation to the gradient if rotation is a number
+  if (this.rotation)
+  {
+    grad.setAttribute('gradientTransform', 'rotate(' + this.rotation + ' 0.5 0.5)');
+  }
+
+  //Process gradient entries and create a stop for each entry
+  var entries = this.entries;
+  for (var i = 0; i < entries.length; i++)
+  {
+    var gradientEntry = entries[i];
+    var stop = document.createElementNS(svgNS, 'stop');
+    //Set Offset
+    stop.setAttribute('offset', String(gradientEntry.ratio * 100) + '%');
+    //Set Color
+    var color = Number(gradientEntry.color).toString(16);
+    if (color.length == 1) color = '00' + color;
+    if (color.length == 2) color = '00' + color;
+    if (color.length == 4) color = '00' + color;
+    stop.setAttribute('stop-color', '#' + String(color));
+    //Set Alpha
+    stop.setAttribute('stop-opacity', String(gradientEntry.alpha));
+
+    grad.appendChild(stop);
+  }
+
+  //Add defs element if not available already
+  //Add newly created gradient to defs element
+  var defs = value.element.querySelector('defs') ||
+      value.element.insertBefore(document.createElementNS(svgNS, 'defs'), value.element.firstChild);
+  defs.appendChild(grad);
+
+  //Return the fill attribute
+  return 'fill:url(#' + gradientId + ')';
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_LinearGradient.prototype.FLEXJS_CLASS_INFO = {
+    names: [{ name: 'LinearGradient', qName: 'org_apache_flex_core_graphics_LinearGradient'}],
+    interfaces: [org_apache_flex_core_graphics_IFill]
+  };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Path.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Path.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Path.js
new file mode 100644
index 0000000..1a8c04c
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Path.js
@@ -0,0 +1,101 @@
+/**
+ * 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_graphics_Path');
+
+goog.require('org_apache_flex_core_graphics_GraphicShape');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GraphicShape}
+ */
+org_apache_flex_core_graphics_Path = function() {
+  org_apache_flex_core_graphics_Path.base(this, 'constructor');
+
+   /**
+   * @private
+   * @type {string}
+   */
+  this.data_ = '';
+};
+goog.inherits(org_apache_flex_core_graphics_Path,
+    org_apache_flex_core_graphics_GraphicShape);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_Path.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'Path',
+                qName: 'org_apache_flex_core_graphics_Path' }] };
+
+
+Object.defineProperties(org_apache_flex_core_graphics_Path.prototype, {
+    /** @expose */
+    data: {
+        /** @this {org_apache_flex_core_graphics_Path} */
+        set: function(v) {
+            this.data_ = v;
+        },
+        /** @this {org_apache_flex_core_graphics_Path} */
+        get: function() {
+            return this.data_;
+        }
+    }
+});
+
+
+/**
+ * @expose
+ * @param {number} x The x location of the Path.
+ * @param {number} y The y location of the Path.
+ * @param {string} data A string containing a compact represention of the path segments.
+ *  The value is a space-delimited string describing each path segment. Each
+ *  segment entry has a single character which denotes the segment type and
+ *  two or more segment parameters.
+ *
+ *  If the segment command is upper-case, the parameters are absolute values.
+ *  If the segment command is lower-case, the parameters are relative values.
+ */
+org_apache_flex_core_graphics_Path.prototype.drawPath = function(x, y, data) {
+    if (data == null || data.length === 0) return;
+    var style = this.getStyleStr();
+    var path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
+    path.flexjs_wrapper = this;
+    path.setAttribute('style', style);
+    path.setAttribute('d', data);
+    this.element.appendChild(path);
+    if (this.stroke)
+    {
+      this.setPosition(x, y, this.stroke.weight, this.stroke.weight);
+    }
+    else
+    {
+      this.setPosition(x, y, 0, 0);
+    }
+
+    this.resize(x, y, path.getBBox());
+  };
+
+
+ /**
+  * @override
+  */
+org_apache_flex_core_graphics_Path.prototype.draw = function() {
+    this.drawPath(this.x, this.y, this.data);
+  };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Rect.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Rect.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Rect.js
new file mode 100644
index 0000000..2a3c849
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Rect.js
@@ -0,0 +1,80 @@
+/**
+ * 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_graphics_Rect');
+
+goog.require('org_apache_flex_core_graphics_GraphicShape');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GraphicShape}
+ */
+org_apache_flex_core_graphics_Rect = function() {
+  org_apache_flex_core_graphics_Rect.base(this, 'constructor');
+
+};
+goog.inherits(org_apache_flex_core_graphics_Rect,
+    org_apache_flex_core_graphics_GraphicShape);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_Rect.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'Rect',
+                qName: 'org_apache_flex_core_graphics_Rect' }] };
+
+
+/**
+ * @expose
+ * @param {number} x The x position of the top-left corner of the rectangle.
+ * @param {number} y The y position of the top-left corner.
+ * @param {number} width The width of the rectangle.
+ * @param {number} height The height of the rectangle.
+ */
+org_apache_flex_core_graphics_Rect.prototype.drawRect = function(x, y, width, height) {
+    var style = this.getStyleStr();
+    var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
+    rect.flexjs_wrapper = this;
+    rect.setAttribute('style', style);
+    if (this.stroke)
+    {
+      rect.setAttribute('x', String(this.stroke.weight / 2) + 'px');
+      rect.setAttribute('y', String(this.stroke.weight / 2) + 'px');
+      this.setPosition(x, y, this.stroke.weight, this.stroke.weight);
+    }
+    else
+    {
+      rect.setAttribute('x', '0' + 'px');
+      rect.setAttribute('y', '0' + 'px');
+      this.setPosition(x, y, 0, 0);
+    }
+    rect.setAttribute('width', String(width) + 'px');
+    rect.setAttribute('height', String(height) + 'px');
+    this.element.appendChild(rect);
+
+    this.resize(x, y, rect.getBBox());
+  };
+
+
+/**
+ * @override
+*/
+org_apache_flex_core_graphics_Rect.prototype.draw = function() {
+    this.drawRect(this.x, this.y, this.width, this.height);
+  };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/SolidColor.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/SolidColor.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/SolidColor.js
new file mode 100644
index 0000000..d534260
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/SolidColor.js
@@ -0,0 +1,92 @@
+/**
+ * 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_graphics_SolidColor');
+goog.require('org_apache_flex_core_graphics_IFill');
+
+
+
+/**
+ * @constructor
+ * @implements {org_apache_flex_core_graphics_IFill}
+ */
+org_apache_flex_core_graphics_SolidColor = function() {
+
+  /**
+   * @private
+   * @type {number}
+   */
+  this.alpha_ = 1.0;
+
+    /**
+   * @private
+   * @type {number}
+   */
+  this.color_ = 1.0;
+
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_SolidColor.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'SolidColor',
+                qName: 'org_apache_flex_core_graphics_SolidColor' }],
+                interfaces: [org_apache_flex_core_graphics_IFill] };
+
+
+Object.defineProperties(org_apache_flex_core_graphics_SolidColor.prototype, {
+    /** @expose */
+    color: {
+        /** @this {org_apache_flex_core_graphics_SolidColor} */
+        get: function() {
+            return this.color_;
+        },
+        /** @this {org_apache_flex_core_graphics_SolidColor} */
+        set: function(value) {
+            this.color_ = value;
+        }
+    },
+    /** @expose */
+    alpha: {
+        /** @this {org_apache_flex_core_graphics_SolidColor} */
+        get: function() {
+            return this.alpha_;
+        },
+        /** @this {org_apache_flex_core_graphics_SolidColor} */
+        set: function(value) {
+            this.alpha_ = value;
+        }
+    }
+});
+
+
+/**
+ * addFillAttrib()
+ *
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} value The GraphicShape object on which the fill must be added.
+ * @return {string}
+ */
+org_apache_flex_core_graphics_SolidColor.prototype.addFillAttrib = function(value) {
+  var color = Number(this.color).toString(16);
+  if (color.length == 1) color = '00' + color;
+  if (color.length == 2) color = '00' + color;
+  if (color.length == 4) color = '00' + color;
+  return 'fill:#' + String(color) + ';fill-opacity:' + String(this.alpha);
+};
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/SolidColorStroke.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/SolidColorStroke.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/SolidColorStroke.js
new file mode 100644
index 0000000..1ce52f6
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/SolidColorStroke.js
@@ -0,0 +1,109 @@
+/**
+ * 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_graphics_SolidColorStroke');
+goog.require('org_apache_flex_core_graphics_IStroke');
+
+
+
+/**
+ * @constructor
+ * @implements {org_apache_flex_core_graphics_IStroke}
+ *
+ */
+org_apache_flex_core_graphics_SolidColorStroke = function() {
+
+  /**
+   * @private
+   * @type {number}
+   */
+  this.alpha_ = 1.0;
+
+  /**
+   * @private
+   * @type {number}
+   */
+  this.color_ = 1.0;
+
+  /**
+   * @private
+   * @type {number}
+   */
+  this.weight_ = 1.0;
+
+};
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_SolidColorStroke.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'SolidColorStroke',
+                qName: 'org_apache_flex_core_graphics_SolidColorStroke' }] };
+
+
+Object.defineProperties(org_apache_flex_core_graphics_SolidColorStroke.prototype, {
+    /** @expose */
+    color: {
+        /** @this {org_apache_flex_core_graphics_SolidColorStroke} */
+        get: function() {
+            return this.color_;
+        },
+        /** @this {org_apache_flex_core_graphics_SolidColorStroke} */
+        set: function(value) {
+            this.color_ = value;
+        }
+    },
+    /** @expose */
+    alpha: {
+        /** @this {org_apache_flex_core_graphics_SolidColorStroke} */
+        get: function() {
+            return this.alpha_;
+        },
+        /** @this {org_apache_flex_core_graphics_SolidColorStroke} */
+        set: function(value) {
+            this.alpha_ = value;
+        }
+    },
+    /** @expose */
+    weight: {
+        /** @this {org_apache_flex_core_graphics_SolidColorStroke} */
+        get: function() {
+            return this.weight_;
+        },
+        /** @this {org_apache_flex_core_graphics_SolidColorStroke} */
+        set: function(value) {
+            this.weight_ = value;
+        }
+    }
+});
+
+
+/**
+ * addStrokeAttrib()
+ *
+ * @expose
+ * @param {org_apache_flex_core_graphics_GraphicShape} value The GraphicShape object on which the stroke must be added.
+ * @return {string}
+ */
+org_apache_flex_core_graphics_SolidColorStroke.prototype.addStrokeAttrib = function(value) {
+    var strokeColor = Number(this.color).toString(16);
+    if (strokeColor.length == 1) strokeColor = '00' + strokeColor;
+    if (strokeColor.length == 2) strokeColor = '00' + strokeColor;
+    if (strokeColor.length == 4) strokeColor = '00' + strokeColor;
+    return 'stroke:#' + String(strokeColor) + ';stroke-width:' +
+         String(this.weight) + ';stroke-opacity:' + String(this.alpha);
+  };

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Text.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Text.js b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Text.js
new file mode 100644
index 0000000..80afbda
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/core/graphics/Text.js
@@ -0,0 +1,70 @@
+/**
+ * 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_graphics_Text');
+
+goog.require('org_apache_flex_core_graphics_GraphicShape');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_core_graphics_GraphicShape}
+ */
+org_apache_flex_core_graphics_Text = function() {
+  org_apache_flex_core_graphics_Text.base(this, 'constructor');
+
+};
+goog.inherits(org_apache_flex_core_graphics_Text,
+    org_apache_flex_core_graphics_GraphicShape);
+
+
+/**
+ * Metadata
+ *
+ * @type {Object.<string, Array.<Object>>}
+ */
+org_apache_flex_core_graphics_Text.prototype.FLEXJS_CLASS_INFO =
+    { names: [{ name: 'Rect',
+                qName: 'org_apache_flex_core_graphics_Text' }] };
+
+
+/**
+ * @expose
+ * @param {string} value The text to be drawn.
+ * @param {number} x The x position of the top-left corner of the rectangle.
+ * @param {number} y The y position of the top-left corner.
+ */
+org_apache_flex_core_graphics_Text.prototype.drawText = function(value, x, y) {
+    var style = this.getStyleStr();
+    var text = document.createElementNS('http://www.w3.org/2000/svg', 'text');
+    text.flexjs_wrapper = this;
+    text.setAttribute('style', style);
+    text.setAttribute('x', String(x) + 'px');
+    text.setAttribute('y', String(y) + 'px');
+    this.setPosition(x, y, 0, 0);
+    var textNode = document.createTextNode(value);
+    text.appendChild(textNode);
+    this.element.appendChild(text);
+
+    this.resize(x, y, text.getBBox());
+  };
+
+
+/**
+ * @override
+*/
+org_apache_flex_core_graphics_Text.prototype.draw = function() {
+
+};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/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
new file mode 100644
index 0000000..7f80b0a
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/events/BrowserEvent.js
@@ -0,0 +1,152 @@
+/**
+ * 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');
+//goog.require('org_apache_flex_events_Event');
+
+
+
+/**
+ * @constructor
+ * @extends {org_apache_flex_events_Event}
+ */
+org_apache_flex_events_BrowserEvent = function() {
+//  org_apache_flex_events_BrowserEvent.base(this, 'constructor');
+
+};
+//goog.inherits(org_apache_flex_events_BrowserEvent,
+//    org_apache_flex_events_Event);
+
+
+/**
+ * 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();
+};
+
+
+Object.defineProperties(org_apache_flex_events_BrowserEvent.prototype, {
+    /** @expose */
+    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;
+        }
+    },
+    /** @expose */
+    button: {
+        /** @this {org_apache_flex_events_BrowserEvent} */
+        get: function() {
+            return this.wrappedEvent.button;
+        }
+    },
+    /** @expose */
+    charCode: {
+        /** @this {org_apache_flex_events_BrowserEvent} */
+        get: function() {
+            return this.wrappedEvent.charCode;
+        }
+    },
+    /** @expose */
+    clientX: {
+        /** @this {org_apache_flex_events_BrowserEvent} */
+        get: function() {
+            return this.wrappedEvent.clientX;
+        }
+    },
+    /** @expose */
+    clientY: {
+        /** @this {org_apache_flex_events_BrowserEvent} */
+        get: function() {
+            return this.wrappedEvent.clientY;
+        }
+    },
+    /** @expose */
+    keyCode: {
+        /** @this {org_apache_flex_events_BrowserEvent} */
+        get: function() {
+            return this.wrappedEvent.keyCode;
+        }
+    },
+    /** @expose */
+    offsetX: {
+        /** @this {org_apache_flex_events_BrowserEvent} */
+        get: function() {
+            return this.wrappedEvent.offsetX;
+        }
+    },
+    /** @expose */
+    offsetY: {
+        /** @this {org_apache_flex_events_BrowserEvent} */
+        get: function() {
+            return this.wrappedEvent.offsetY;
+        }
+    },
+    /** @expose */
+    screenX: {
+        /** @this {org_apache_flex_events_BrowserEvent} */
+        get: function() {
+            return this.wrappedEvent.screenX;
+        }
+    },
+    /** @expose */
+    screenY: {
+        /** @this {org_apache_flex_events_BrowserEvent} */
+        get: function() {
+            return this.wrappedEvent.screenY;
+        }
+    },
+    /** @expose */
+    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;
+        }
+    },
+    /** @expose */
+    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/b677c658/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
new file mode 100644
index 0000000..9c5608c
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/events/CustomEvent.js
@@ -0,0 +1,58 @@
+/**
+ * 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'}] };
+
+
+/**
+ * @expose
+ * @param {string} type The event type.
+ */
+org_apache_flex_events_CustomEvent.prototype.init = function(type) {
+  this.type = type;
+};
+
+
+/**
+ * @expose
+ * @type {string} type The event type.
+ */
+org_apache_flex_events_CustomEvent.prototype.type = '';

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/frameworks/projects/Core/js/src/org/apache/flex/events/DragEvent.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/js/src/org/apache/flex/events/DragEvent.js b/frameworks/projects/Core/js/src/org/apache/flex/events/DragEvent.js
new file mode 100644
index 0000000..3212ebe
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/events/DragEvent.js
@@ -0,0 +1,146 @@
+/**
+ * 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');
+
+goog.require('goog.events.BrowserEvent');
+goog.require('org_apache_flex_events_ElementEvents');
+goog.require('org_apache_flex_events_EventDispatcher');
+
+
+
+/**
+ * @constructor
+ * This is a shim class.  A native MouseEvent is actually
+ * sent with additional properties like dragInitiator and
+ * dragSource tacked on.
+ *
+ * @extends {goog.events.BrowserEvent}
+ * @param {string} type The event type.
+ */
+org_apache_flex_events_DragEvent = function(type) {
+  org_apache_flex_events_DragEvent.base(this, 'constructor');
+
+  this.type = type;
+};
+goog.inherits(org_apache_flex_events_DragEvent,
+    goog.events.BrowserEvent);
+
+
+/**
+ * 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.
+ * @param {Event} e The mouse event to base the DragEvent on.
+ * @return {MouseEvent} The new event.
+ */
+org_apache_flex_events_DragEvent.createDragEvent =
+    function(type, e) {
+  var out = new MouseEvent(type);
+  out.initMouseEvent(type, true, true,
+    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;
+};
+
+
+/**
+ * @expose
+ * @param {Event} event The drag event.
+ * @param {Object} target The target for the event.
+ */
+org_apache_flex_events_DragEvent.dispatchDragEvent =
+    function(event, target) {
+  target.element.dispatchEvent(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';
+
+
+/**
+ * @return {boolean}
+ */
+org_apache_flex_events_DragEvent.installDragEventMixin = function() {
+  var o = org_apache_flex_events_ElementEvents.elementEvents;
+  o['dragEnd'] = 1;
+  o['dragMove'] = 1;
+  return true;
+};
+
+
+/**
+ * Add some other events to listen from the element
+ */
+/**
+ * @type {boolean}
+ */
+org_apache_flex_events_DragEvent.dragEventMixin =
+    org_apache_flex_events_DragEvent.installDragEventMixin();

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/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
new file mode 100644
index 0000000..315b105
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/events/ElementEvents.js
@@ -0,0 +1,47 @@
+/**
+ * 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 = {
+  '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/b677c658/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
new file mode 100644
index 0000000..73ecdd0
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/events/Event.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.
+ */
+// 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'
+  };
+
+
+/**
+ * @expose
+ * @type {string} type The event type.
+ */
+org_apache_flex_events_Event.prototype.type = '';
+
+
+/**
+ * @expose
+ * @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/b677c658/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
new file mode 100644
index 0000000..9f66ef7
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/events/EventDispatcher.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_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] };
+
+
+/**
+ * @override
+ */
+org_apache_flex_events_EventDispatcher.prototype.addEventListener =
+    function(type, handler, opt_capture, opt_handlerScope) {
+  var source;
+
+  /**
+   *  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.
+   */
+  source = this;
+  if (this.element && this.element.nodeName &&
+      this.element.nodeName.toLowerCase() !== 'div' &&
+      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;
+  }
+
+  goog.events.listen(source, type, handler);
+};
+
+

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/b677c658/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
new file mode 100644
index 0000000..10e04ad
--- /dev/null
+++ b/frameworks/projects/Core/js/src/org/apache/flex/events/IEventDispatcher.js
@@ -0,0 +1,40 @@
+/**
+ * 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'}] };


Mime
View raw message