http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicShape.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicShape.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicShape.js deleted file mode 100644 index 1ba8710..0000000 --- a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicShape.js +++ /dev/null @@ -1,205 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.core.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; - - /** - * @export - * @type {Object} - */ - 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; - this.positioner.style.position = 'relative'; -}; -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, { - /** @export */ - 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 -}; - - -/** - * @export - * @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; -}; - - -/** - * @export - * @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; -}; - - -/** - * @export - * @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/d4cace4a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicsContainer.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicsContainer.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicsContainer.js deleted file mode 100644 index 2894cab..0000000 --- a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/GraphicsContainer.js +++ /dev/null @@ -1,250 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.core.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'}] }; - - -/** - * @export - */ -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, { - /** @export */ - numChildren: { - /** @this {org.apache.flex.core.graphics.GraphicsContainer} */ - get: function() { - return this.internalChildren().length; - } - }, - /** @export */ - 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'; - }, - get: function() { - return org.apache.flex.utils.Language.superGetter( - org.apache.flex.core.graphics.GraphicsContainer, this, 'width'); - } - }, - /** @export */ - 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'; - }, - get: function() { - return org.apache.flex.utils.Language.superGetter( - org.apache.flex.core.graphics.GraphicsContainer, this, 'height'); - } - }, - /** @export */ - 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; - }, - get: function() { - return org.apache.flex.utils.Language.superGetter( - org.apache.flex.core.graphics.GraphicsContainer, this, 'x'); - } - }, - /** @export */ - 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; - }, - get: function() { - return org.apache.flex.utils.Language.superGetter( - org.apache.flex.core.graphics.GraphicsContainer, this, 'y'); - } - } -}); - - -/** - * @export - * @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); -}; - - -/** - * @export - * @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); -}; - - -/** - * @export - * @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); -}; - - -/** - * @export - * @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); -}; - - -/** - * @export - * @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. - * @return {Object} The text node created to display the graphics. - */ -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); - return text; -}; - - -/** - * @export - */ -org.apache.flex.core.graphics.GraphicsContainer.prototype.drawLine = function() { -}; - - -/** - * @export - */ -org.apache.flex.core.graphics.GraphicsContainer.prototype.drawPolygon = function() { -}; - http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IFill.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IFill.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IFill.js deleted file mode 100644 index 9208fe7..0000000 --- a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IFill.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @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() - * - * @export - * @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/d4cace4a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IStroke.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IStroke.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IStroke.js deleted file mode 100644 index c9ab6f9..0000000 --- a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/IStroke.js +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * @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() - * - * @export - * @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/d4cace4a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Line.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Line.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Line.js deleted file mode 100644 index 167c060..0000000 --- a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Line.js +++ /dev/null @@ -1,79 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.core.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' }] }; - - -/** - * @export - * @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 - * @export - * @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/d4cace4a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/LinearGradient.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/LinearGradient.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/LinearGradient.js deleted file mode 100644 index e8f42e3..0000000 --- a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/LinearGradient.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * 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, { - /** @export */ - 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() - * - * @export - * @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/d4cace4a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Path.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Path.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Path.js deleted file mode 100644 index 1567ae9..0000000 --- a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Path.js +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.core.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, { - /** @export */ - 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_; - } - } -}); - - -/** - * @export - * @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/d4cace4a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Rect.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Rect.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Rect.js deleted file mode 100644 index f468c44..0000000 --- a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Rect.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.core.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' }] }; - - -/** - * @export - * @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/d4cace4a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColor.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColor.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColor.js deleted file mode 100644 index 809d37b..0000000 --- a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColor.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.core.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, { - /** @export */ - 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; - } - }, - /** @export */ - 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() - * - * @export - * @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/d4cace4a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColorStroke.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColorStroke.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColorStroke.js deleted file mode 100644 index 10423f5..0000000 --- a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/SolidColorStroke.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.core.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, { - /** @export */ - 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; - } - }, - /** @export */ - 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; - } - }, - /** @export */ - 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() - * - * @export - * @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/d4cace4a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Text.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Text.js b/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Text.js deleted file mode 100644 index 4bb77d6..0000000 --- a/frameworks/projects/Graphics/js/src/org/apache/flex/core/graphics/Text.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.core.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' }] }; - - -/** - * @export - * @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/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/Alert.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/Alert.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/Alert.js deleted file mode 100644 index 099a7b3..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/Alert.js +++ /dev/null @@ -1,193 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.Alert'); - -goog.require('org.apache.flex.core.UIBase'); -goog.require('org.apache.flex.html.Container'); -goog.require('org.apache.flex.html.Label'); -goog.require('org.apache.flex.html.TextButton'); -goog.require('org.apache.flex.html.TitleBar'); - - - -/** - * @constructor - * @extends {org.apache.flex.html.Container} - */ -org.apache.flex.html.Alert = function() { - org.apache.flex.html.Alert.base(this, 'constructor'); -}; -goog.inherits(org.apache.flex.html.Alert, - org.apache.flex.html.Container); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.Alert.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'Alert', - qName: 'org.apache.flex.html.Alert'}] }; - - -/** - * @type {number} The value for the Yes button option. - */ -org.apache.flex.html.Alert.YES = 0x000001; - - -/** - * @type {number} The value for the No button option. - */ -org.apache.flex.html.Alert.NO = 0x000002; - - -/** - * @type {number} The value for the OK button option. - */ -org.apache.flex.html.Alert.OK = 0x000004; - - -/** - * @type {number} The value for the Cancel button option. - */ -org.apache.flex.html.Alert.CANCEL = 0x000008; - - -/** - * @override - */ -org.apache.flex.html.Alert.prototype.createElement = - function() { - org.apache.flex.html.Alert.base(this, 'createElement'); - - this.element.className = 'Alert'; - - // add in a title bar - this.titleBar = new org.apache.flex.html.TitleBar(); - this.addElement(this.titleBar); - this.titleBar.element.id = 'titleBar'; - - this.message = new org.apache.flex.html.Label(); - this.addElement(this.message); - this.message.element.id = 'message'; - - // add a place for the buttons - this.buttonArea = new org.apache.flex.html.Container(); - this.addElement(this.buttonArea); - this.buttonArea.element.id = 'buttonArea'; - - return this.element; -}; - - -/** - * @param {string} message The message to be displayed. - * @param {Object} host The object to display the alert. - * @param {string} title The message to be displayed in the title bar. - * @param {number} flags The options for the buttons. - */ -org.apache.flex.html.Alert.show = - function(message, host, title, flags) { - - var a = new org.apache.flex.html.Alert(); - host.addElement(a); - a.title = title; - a.text = message; - a.flags = flags; - - a.positioner.style.position = 'relative'; - a.positioner.style.width = '200px'; - a.positioner.style.margin = 'auto'; - a.positioner.style.top = '100px'; -}; - - -Object.defineProperties(org.apache.flex.html.Alert.prototype, { - /** @export */ - title: { - /** @this {org.apache.flex.html.Alert} */ - get: function() { - return this.titleBar.title; - }, - /** @this {org.apache.flex.html.Alert} */ - set: function(value) { - this.titleBar.title = value; - } - }, - /** @export */ - text: { - /** @this {org.apache.flex.html.Alert} */ - get: function() { - return this.message.text; - }, - /** @this {org.apache.flex.html.Alert} */ - set: function(value) { - this.message.text = value; - } - }, - /** @export */ - flags: { - /** @this {org.apache.flex.html.Alert} */ - get: function() { - return this.flags; - }, - /** @this {org.apache.flex.html.Alert} */ - set: function(value) { - this.flags = value; - - // add buttons based on flags - if (this.flags & org.apache.flex.html.Alert.OK) { - var ok = new org.apache.flex.html.TextButton(); - this.buttonArea.addElement(ok); - ok.text = 'OK'; - goog.events.listen(/** @type {EventTarget} */ (ok.element), 'click', - goog.bind(this.dismissAlert, this)); - } - if (this.flags & org.apache.flex.html.Alert.CANCEL) { - var cancel = new org.apache.flex.html.TextButton(); - this.buttonArea.addElement(cancel); - cancel.text = 'Cancel'; - goog.events.listen(/** @type {EventTarget} */ (cancel.element), 'click', - goog.bind(this.dismissAlert, this)); - } - if (this.flags & org.apache.flex.html.Alert.YES) { - var yes = new org.apache.flex.html.TextButton(); - this.buttonArea.addElement(yes); - yes.text = 'YES'; - goog.events.listen(/** @type {EventTarget} */ (yes.element), 'click', - goog.bind(this.dismissAlert, this)); - } - if (this.flags & org.apache.flex.html.Alert.NO) { - var nob = new org.apache.flex.html.TextButton(); - this.buttonArea.addElement(nob); - nob.text = 'NO'; - goog.events.listen(/** @type {EventTarget} */ (nob.element), 'click', - goog.bind(this.dismissAlert, this)); - } - } - } -}); - - -/** - * @param {Object} event The event object. - */ -org.apache.flex.html.Alert.prototype.dismissAlert = - function(event) - { - this.element.parentElement.removeChild(this.element); -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/Button.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/Button.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/Button.js deleted file mode 100644 index 1917ecf..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/Button.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.Button'); - -goog.require('org.apache.flex.core.UIBase'); - - - -/** - * @constructor - * @extends {org.apache.flex.core.UIBase} - */ -org.apache.flex.html.Button = function() { - org.apache.flex.html.Button.base(this, 'constructor'); -}; -goog.inherits(org.apache.flex.html.Button, - org.apache.flex.core.UIBase); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.Button.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'Button', - qName: 'org.apache.flex.html.Button'}] }; - - -/** - * @override - */ -org.apache.flex.html.Button.prototype.createElement = - function() { - this.element = document.createElement('button'); - this.element.setAttribute('type', 'button'); - - this.positioner = this.element; - this.positioner.style.position = 'relative'; - this.element.flexjs_wrapper = this; - - if (org.apache.flex.core.ValuesManager.valuesImpl.getValue) { - var impl = org.apache.flex.core.ValuesManager.valuesImpl. - getValue(this, 'iStatesImpl'); - } - - return this.element; -}; - http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/ButtonBar.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/ButtonBar.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/ButtonBar.js deleted file mode 100644 index 82cfe9e..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/ButtonBar.js +++ /dev/null @@ -1,85 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.ButtonBar'); - -goog.require('org.apache.flex.core.ListBase'); -goog.require('org.apache.flex.html.List'); -goog.require('org.apache.flex.html.beads.DataItemRendererFactoryForArrayData'); -goog.require('org.apache.flex.html.beads.layouts.HorizontalLayout'); -goog.require('org.apache.flex.html.supportClasses.ButtonBarButtonItemRenderer'); - - - -/** - * @constructor - * @extends {org.apache.flex.html.List} - */ -org.apache.flex.html.ButtonBar = function() { - - // this.model = new - // org.apache.flex.html.beads.models.ArraySelectionModel(); - // this.addBead(this.model); - - org.apache.flex.html.ButtonBar.base(this, 'constructor'); - - // this.addBead(new - // org.apache.flex.html.beads.ListView()); - - // this.addBead(new - //org.apache.flex.html.beads.layouts.HorizontalLayout()); - - // this.itemRendererFactory = new - // org.apache.flex.html.beads. - // DataItemRendererFactoryForArrayData(); - // this.itemRendererFactory.itemRendererClass = 'org.apache.flex.html.' + - // 'supportClasses_ButtonBarButtonItemRenderer'; - // this.addBead(this.itemRendererFactory); - - // this.addBead(new - // org.apache.flex.html.beads.controllers. - // ListSingleSelectionMouseController()); -}; -goog.inherits(org.apache.flex.html.ButtonBar, - org.apache.flex.html.List); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.ButtonBar.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ButtonBar', - qName: 'org.apache.flex.html.ButtonBar'}] }; - - -/** - * @override - */ -org.apache.flex.html.ButtonBar.prototype.createElement = - function() { - //org.apache.flex.html.ButtonBar.base(this, 'createElement'); - - this.element = document.createElement('div'); - this.element.style.overflow = 'auto'; - this.positioner = this.element; - this.positioner.style.position = 'relative'; - - this.className = 'ButtonBar'; - - this.element.flexjs_wrapper = this; - - return this.element; -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js deleted file mode 100644 index 7f0d2c4..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/CheckBox.js +++ /dev/null @@ -1,91 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.CheckBox'); - -goog.require('org.apache.flex.core.UIBase'); - - - -/** - * @constructor - * @extends {org.apache.flex.core.UIBase} - */ -org.apache.flex.html.CheckBox = function() { - org.apache.flex.html.CheckBox.base(this, 'constructor'); -}; -goog.inherits(org.apache.flex.html.CheckBox, - org.apache.flex.core.UIBase); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.CheckBox.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'CheckBox', - qName: 'org.apache.flex.html.CheckBox'}] }; - - -/** - * @override - */ -org.apache.flex.html.CheckBox.prototype.createElement = - function() { - var cb; - - this.element = document.createElement('label'); - - cb = document.createElement('input'); - cb.type = 'checkbox'; - this.element.appendChild(cb); - this.element.appendChild(document.createTextNode('')); - - this.element.className = 'CheckBox'; - this.typeNames = 'CheckBox'; - - this.positioner = this.element; - this.positioner.style.position = 'relative'; - cb.flexjs_wrapper = this; - this.element.flexjs_wrapper = this; - - return this.element; -}; - - -Object.defineProperties(org.apache.flex.html.CheckBox.prototype, { - /** @export */ - text: { - /** @this {org.apache.flex.html.CheckBox} */ - get: function() { - return this.element.childNodes.item(1).nodeValue; - }, - /** @this {org.apache.flex.html.CheckBox} */ - set: function(value) { - this.element.childNodes.item(1).nodeValue = value; - } - }, - /** @export */ - selected: { - /** @this {org.apache.flex.html.CheckBox} */ - get: function() { - return this.element.childNodes.item(0).checked; - }, - /** @this {org.apache.flex.html.CheckBox} */ - set: function(value) { - this.element.childNodes.item(0).checked = value; - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/CloseButton.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/CloseButton.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/CloseButton.js deleted file mode 100644 index fc212bb..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/CloseButton.js +++ /dev/null @@ -1,55 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.CloseButton'); - -goog.require('org.apache.flex.html.Button'); - - - -/** - * @constructor - * @extends {org.apache.flex.html.Button} - */ -org.apache.flex.html.CloseButton = function() { - org.apache.flex.html.CloseButton.base(this, 'constructor'); -}; -goog.inherits(org.apache.flex.html.CloseButton, - org.apache.flex.html.Button); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.CloseButton.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'CloseButton', - qName: 'org.apache.flex.html.CloseButton'}] }; - - -/** - * @override - */ -org.apache.flex.html.CloseButton.prototype.createElement = - function() { - org.apache.flex.html.CloseButton.base(this, 'createElement'); - this.element.innerHTML = 'x'; - - this.element.style.padding = 0; - this.height = 11; - this.width = 11; - return this.element; -}; - http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/ComboBox.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/ComboBox.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/ComboBox.js deleted file mode 100644 index 483a517..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/ComboBox.js +++ /dev/null @@ -1,194 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.ComboBox'); - -goog.require('org.apache.flex.core.ListBase'); - - - -/** - * @constructor - * @extends {org.apache.flex.core.ListBase} - */ -org.apache.flex.html.ComboBox = function() { - org.apache.flex.html.ComboBox.base(this, 'constructor'); -}; -goog.inherits(org.apache.flex.html.ComboBox, - org.apache.flex.core.ListBase); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.ComboBox.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ComboBox', - qName: 'org.apache.flex.html.ComboBox'}] }; - - -/** - * @override - */ -org.apache.flex.html.ComboBox.prototype.createElement = - function() { - var button, input; - - this.element = document.createElement('div'); - - input = document.createElement('input'); - input.style.position = 'absolute'; - input.style.width = '80px'; - this.element.appendChild(input); - - button = document.createElement('div'); - button.style.position = 'absolute'; - button.style.top = '0px'; - button.style.right = '0px'; - button.style.background = '#bbb'; - button.style.width = '16px'; - button.style.height = '20px'; - button.style.margin = '0'; - button.style.border = 'solid #609 1px'; - goog.events.listen(button, 'click', goog.bind(this.buttonClicked, this)); - this.element.appendChild(button); - - this.positioner = this.element; - this.positioner.style.position = 'relative'; - - // add a click handler so that a click outside of the combo box can - // dismiss the pop-up should it be visible. - goog.events.listen(document, 'click', - goog.bind(this.dismissPopup, this)); - - input.flexjs_wrapper = this; - - return this.element; -}; - - -/** - * @export - * @param {Object} event The event. - */ -org.apache.flex.html.ComboBox.prototype.selectChanged = - function(event) { - var select; - - select = event.currentTarget; - - this.selectedItem = select.options[select.selectedIndex].value; - - this.popup.parentNode.removeChild(this.popup); - this.popup = null; - - this.dispatchEvent(event); -}; - - -/** - * @export - * @param {Object=} opt_event The event. - */ -org.apache.flex.html.ComboBox.prototype.dismissPopup = - function(opt_event) { - // remove the popup if it already exists - if (this.popup) { - this.popup.parentNode.removeChild(this.popup); - this.popup = null; - } -}; - - -/** - * @export - * @param {Object} event The event. - */ -org.apache.flex.html.ComboBox.prototype.buttonClicked = - function(event) { - /** - * @type {Array.<string>} - */ - var dp; - var i, input, left, n, opt, opts, pn, popup, select, si, top, width; - - event.stopPropagation(); - - if (this.popup) { - this.dismissPopup(); - - return; - } - - input = this.element.childNodes.item(0); - - pn = this.element; - top = pn.offsetTop + input.offsetHeight; - left = pn.offsetLeft; - width = pn.offsetWidth; - - popup = document.createElement('div'); - popup.className = 'popup'; - popup.id = 'test'; - popup.style.position = 'absolute'; - popup.style.top = top.toString() + 'px'; - popup.style.left = left.toString() + 'px'; - popup.style.width = width.toString() + 'px'; - popup.style.margin = '0px auto'; - popup.style.padding = '0px'; - popup.style.zIndex = '10000'; - - select = document.createElement('select'); - select.style.width = width.toString() + 'px'; - goog.events.listen(select, 'change', goog.bind(this.selectChanged, this)); - opts = select.options; - - dp = /** @type {Array.<string>} */ (this.dataProvider); - n = dp.length; - for (i = 0; i < n; i++) { - opt = document.createElement('option'); - opt.text = dp[i]; - opts.add(opt); - } - - select.size = n; - - si = this.selectedIndex; - if (si < 0) { - select.value = null; - } else { - select.value = dp[si]; - } - - this.popup = popup; - - popup.appendChild(select); - document.body.appendChild(popup); -}; - - -Object.defineProperties(org.apache.flex.html.ComboBox.prototype, { - /** @export */ - text: { - /** @this {org.apache.flex.html.ComboBox} */ - get: function() { - return this.element.childNodes.item(0).value; - }, - /** @this {org.apache.flex.html.ComboBox} */ - set: function(value) { - this.element.childNodes.item(0).value = value; - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/Container.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/Container.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/Container.js deleted file mode 100644 index b7d628a..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/Container.js +++ /dev/null @@ -1,123 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.Container'); - -goog.require('org.apache.flex.core.ContainerBase'); -goog.require('org.apache.flex.core.IBeadLayout'); -goog.require('org.apache.flex.core.IContainer'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IContainer} - * @extends {org.apache.flex.core.ContainerBase} - */ -org.apache.flex.html.Container = function() { - org.apache.flex.html.Container.base(this, 'constructor'); -}; -goog.inherits(org.apache.flex.html.Container, - org.apache.flex.core.ContainerBase); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.Container.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'Container', - qName: 'org.apache.flex.html.Container' }], - interfaces: [org.apache.flex.core.IContainer] }; - - -/** - * @override - */ -org.apache.flex.html.Container.prototype.createElement = - function() { - var cb; - - this.element = document.createElement('div'); - - this.positioner = this.element; - - // absolute positioned children need a non-null - // position value in the parent. It might - // get set to 'absolute' if the container is - // also absolutely positioned - this.positioner.style.position = 'relative'; - this.element.flexjs_wrapper = this; - - /*this.addEventListener('childrenAdded', - goog.bind(this.runLayoutHandler, this)); - this.addEventListener('elementRemoved', - goog.bind(this.runLayoutHandler, this));*/ - - return this.element; -}; - - -/** - * @override - * -org.apache.flex.html.Container.prototype.addElement = - function(child) { - org.apache.flex.html.Container.base(this, 'addElement', child); - this.dispatchEvent('elementAdded'); -};*/ - - -/** - * @override - * -org.apache.flex.html.Container.prototype.removeElement = - function(child) { - org.apache.flex.html.Container.base(this, 'removeElement', child); - this.dispatchEvent('elementRemoved'); -};*/ - - -/** - * @export - */ -org.apache.flex.html.Container.prototype.childrenAdded = - function() { - this.dispatchEvent('childrenAdded'); -}; - - -/** - * @export - * @param {Object} event The event invoking the layout. - * -org.apache.flex.html.Container.prototype.runLayoutHandler = - function(event) { - var layout = this.getBeadByType(org.apache.flex.core.IBeadLayout); - if (layout) { - layout.layout(); - } -};*/ - - -/** - * @export - * @return {Array} the HTML DOM element children. - */ -org.apache.flex.html.Container.prototype.internalChildren = - function() { - return this.element.children; -}; - http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/ControlBar.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/ControlBar.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/ControlBar.js deleted file mode 100644 index a0afce5..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/ControlBar.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.ControlBar'); - -goog.require('org.apache.flex.html.Container'); - - - -/** - * @constructor - * @extends {org.apache.flex.html.Container} - */ -org.apache.flex.html.ControlBar = function() { - org.apache.flex.html.ControlBar.base(this, 'constructor'); - -}; -goog.inherits(org.apache.flex.html.ControlBar, - org.apache.flex.html.Container); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.ControlBar.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ControlBar', - qName: 'org.apache.flex.html.ControlBar'}] }; - - -/** - * @override - */ -org.apache.flex.html.ControlBar.prototype.createElement = - function() { - - this.element = document.createElement('div'); - this.element.className = 'ControlBar'; - this.element.style.display = 'inline'; - this.typeNames = 'ControlBar'; - - this.positioner = this.element; - this.positioner.style.position = 'relative'; - this.element.flexjs_wrapper = this; - - return this.element; -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js deleted file mode 100644 index 3b060df..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/DropDownList.js +++ /dev/null @@ -1,142 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.DropDownList'); - -goog.require('org.apache.flex.core.ListBase'); -goog.require('org.apache.flex.html.beads.models.ArraySelectionModel'); - - - -/** - * @constructor - * @extends {org.apache.flex.core.ListBase} - */ -org.apache.flex.html.DropDownList = function() { - org.apache.flex.html.DropDownList.base(this, 'constructor'); - this.model = new org.apache.flex.html.beads.models.ArraySelectionModel(); -}; -goog.inherits(org.apache.flex.html.DropDownList, - org.apache.flex.core.ListBase); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.DropDownList.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'DropDownList', - qName: 'org.apache.flex.html.DropDownList'}] }; - - -/** - * @override - */ -org.apache.flex.html.DropDownList.prototype.createElement = - function() { - this.element = document.createElement('select'); - this.element.size = 1; - goog.events.listen(this.element, 'change', - goog.bind(this.changeHandler, this)); - - this.positioner = this.element; - this.positioner.style.position = 'relative'; - - this.element.flexjs_wrapper = this; - - return this.element; -}; - - -Object.defineProperties(org.apache.flex.html.DropDownList.prototype, { - /** @export */ - dataProvider: { - /** @this {org.apache.flex.html.DropDownList} */ - set: function(value) { - var dp, i, n, opt; - - this.model.dataProvider = value; - dp = this.element.options; - n = dp.length; - for (i = 0; i < n; i++) { - dp.remove(0); - } - - var lf = this.labelField; - n = value.length; - for (i = 0; i < n; i++) { - opt = document.createElement('option'); - if (lf) - opt.text = value[i][lf]; - else - opt.text = value[i]; - dp.add(opt); - } - } - }, - /** @export */ - labelField: { - // TODO: (aharui) copied from ListBase because you - // can't just override the setter in a defineProps - // structure. - /** @this {org.apache.flex.html.DropDownList} */ - get: function() { - return this.model.labelField; - }, - /** @this {org.apache.flex.html.DropDownList} */ - set: function(value) { - this.model.labelField = value; - } - }, - /** @export */ - selectedIndex: { - // TODO: (aharui) copied from ListBase because you - // can't just override the setter in a defineProps - // structure. - /** @this {org.apache.flex.html.DropDownList} */ - get: function() { - return this.model.selectedIndex; - }, - /** @this {org.apache.flex.html.DropDownList} */ - set: function(value) { - this.model.selectedIndex = value; - this.element.selectedIndex = value; - } - }, - /** @export */ - selectedItem: { - // TODO: (aharui) copied from ListBase because you - // can't just override the setter in a defineProps - // structure. - /** @this {org.apache.flex.html.DropDownList} */ - get: function() { - return this.model.selectedItem; - }, - /** @this {org.apache.flex.html.DropDownList} */ - set: function(value) { - this.model.selectedItem = value; - this.element.selectedIndex = this.model.selectedIndex; - } - } -}); - - -/** - * @protected - */ -org.apache.flex.html.DropDownList.prototype.changeHandler = - function() { - this.model.selectedIndex = this.element.selectedIndex; -}; \ No newline at end of file http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/HContainer.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/HContainer.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/HContainer.js deleted file mode 100644 index 13b96e3..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/HContainer.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.HContainer'); - -goog.require('org.apache.flex.core.IContainer'); -goog.require('org.apache.flex.html.Container'); - - - -/** - * @constructor - * @implements {org.apache.flex.core.IContainer} - * @extends {org.apache.flex.html.Container} - */ -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/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/HRule.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/HRule.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/HRule.js deleted file mode 100644 index 5c2cea8..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/HRule.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.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.positioner.style.position = 'relative'; - 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.HRule.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'HRule', - qName: 'org.apache.flex.html.HRule' }] }; - http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/Image.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/Image.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/Image.js deleted file mode 100644 index f535f44..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/Image.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.Image'); - -goog.require('org.apache.flex.core.UIBase'); -goog.require('org.apache.flex.html.beads.ImageView'); -goog.require('org.apache.flex.html.beads.models.ImageModel'); - - - -/** - * @constructor - * @extends {org.apache.flex.core.UIBase} - */ -org.apache.flex.html.Image = function() { - org.apache.flex.html.Image.base(this, 'constructor'); -}; -goog.inherits(org.apache.flex.html.Image, - org.apache.flex.core.UIBase); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.Image.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'Image', - qName: 'org.apache.flex.html.Image' }] }; - - -/** - * @override - * @protected - * @return {Object} The actual element to be parented. - */ -org.apache.flex.html.Image.prototype.createElement = - function() { - - this.element = document.createElement('img'); - this.element.className = 'Image'; - this.typeNames = 'Image'; - - this.positioner = this.element; - this.positioner.style.position = 'relative'; - this.element.flexjs_wrapper = this; - - this.model = new - org.apache.flex.html.beads.models.ImageModel(); - - this.addBead(new - org.apache.flex.html.beads.ImageView()); - - return this.element; -}; - - -Object.defineProperties(org.apache.flex.html.Image.prototype, { - /** @export */ - source: { - /** @this {org.apache.flex.html.Image} */ - get: function() { - return this.model.source; - }, - /** @this {org.apache.flex.html.Image} */ - set: function(value) { - this.model.source = value; - } - } -}); http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/ImageAndTextButton.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/ImageAndTextButton.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/ImageAndTextButton.js deleted file mode 100644 index de49513..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/ImageAndTextButton.js +++ /dev/null @@ -1,103 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.ImageAndTextButton'); - -goog.require('org.apache.flex.html.Button'); - - - -/** - * @constructor - * @extends {org.apache.flex.html.Button} - */ -org.apache.flex.html.ImageAndTextButton = function() { - org.apache.flex.html.ImageAndTextButton.base(this, 'constructor'); - - this._text = ''; - this._src = ''; -}; -goog.inherits(org.apache.flex.html.ImageAndTextButton, - org.apache.flex.html.Button); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.ImageAndTextButton.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'ImageAndTextButton', - qName: 'org.apache.flex.html.ImageAndTextButton'}] }; - - -/** - * @override - */ -org.apache.flex.html.ImageAndTextButton.prototype.createElement = - function() { - this.element = document.createElement('button'); - this.element.setAttribute('type', 'button'); - - this.positioner = this.element; - this.positioner.style.position = 'relative'; - this.element.flexjs_wrapper = this; - - if (org.apache.flex.core.ValuesManager.valuesImpl.getValue) { - var impl = org.apache.flex.core.ValuesManager.valuesImpl. - getValue(this, 'iStatesImpl'); - } - - return this.element; -}; - - -Object.defineProperties(org.apache.flex.html.ImageAndTextButton.prototype, { - /** @export */ - text: { - /** @this {org.apache.flex.html.ImageAndTextButton} */ - get: function() { - return this._text; - }, - /** @this {org.apache.flex.html.ImageAndTextButton} */ - set: function(value) { - this._text = value; - this.setInnerHTML(); - } - }, - /** @export */ - image: { - /** @this {org.apache.flex.html.ImageAndTextButton} */ - get: function() { - return this._src; - }, - /** @this {org.apache.flex.html.ImageAndTextButton} */ - set: function(value) { - this._src = value; - this.setInnerHTML(); - } - } -}); - - -/** - */ -org.apache.flex.html.ImageAndTextButton.prototype.setInnerHTML = function() { - var inner = ''; - if (this._src != null) - inner += '<img src=\'' + this._src + '\'/>'; - inner += ' '; - inner += this._text; - this.element.innerHTML = inner; -}; http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/d4cace4a/frameworks/projects/HTML/js/src/org/apache/flex/html/Label.js ---------------------------------------------------------------------- diff --git a/frameworks/projects/HTML/js/src/org/apache/flex/html/Label.js b/frameworks/projects/HTML/js/src/org/apache/flex/html/Label.js deleted file mode 100644 index 82a35c5..0000000 --- a/frameworks/projects/HTML/js/src/org/apache/flex/html/Label.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Licensed under the Apache License, Version 2.0 (the 'License'); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an 'AS IS' BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -goog.provide('org.apache.flex.html.Label'); - -goog.require('org.apache.flex.core.UIBase'); - - - -/** - * @constructor - * @extends {org.apache.flex.core.UIBase} - */ -org.apache.flex.html.Label = function() { - org.apache.flex.html.Label.base(this, 'constructor'); - - this.element = document.createElement('span'); - this.positioner = this.element; - this.element.flexjs_wrapper = this; -}; -goog.inherits(org.apache.flex.html.Label, - org.apache.flex.core.UIBase); - - -/** - * Metadata - * - * @type {Object.<string, Array.<Object>>} - */ -org.apache.flex.html.Label.prototype.FLEXJS_CLASS_INFO = - { names: [{ name: 'Label', - qName: 'org.apache.flex.html.Label' }] }; - - -Object.defineProperties(org.apache.flex.html.Label.prototype, { - /** @export */ - text: { - /** @this {org.apache.flex.html.Label} */ - get: function() { - return this.element.innerHTML; - }, - /** @this {org.apache.flex.html.Label} */ - set: function(value) { - this.element.innerHTML = value; - this.dispatchEvent('textChange'); - } - }, - /** @export */ - html: { - /** @this {org.apache.flex.html.Label} */ - get: function() { - return this.element.innerHTML; - }, - /** @this {org.apache.flex.html.Label} */ - set: function(value) { - this.element.innerHTML = value; - this.dispatchEvent('htmlChange'); - } - } -});
