You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by bi...@apache.org on 2014/09/04 10:25:07 UTC

[1/2] git commit: [flex-asjs] [refs/heads/develop] - Added the first set of vector graphic drawing classes.

Repository: flex-asjs
Updated Branches:
  refs/heads/develop 0eee0aebb -> 5ae077b66


Added the first set of vector graphic drawing classes.


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/f2d159b6
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/f2d159b6
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/f2d159b6

Branch: refs/heads/develop
Commit: f2d159b67ecb97dfa643a43ff575b7aa81039ad6
Parents: 0eee0ae
Author: Om <bi...@gmail.com>
Authored: Thu Sep 4 01:07:18 2014 -0700
Committer: Om <bi...@gmail.com>
Committed: Thu Sep 4 01:23:21 2014 -0700

----------------------------------------------------------------------
 examples/FlexJSTest_SVG/src/FlexJSTest_SVG.mxml |   2 +-
 examples/FlexJSTest_SVG/src/GraphicsView.mxml   |  54 ++++++++++
 .../apache/flex/core/graphics/GraphicShape.as   |  47 +++++++++
 .../src/org/apache/flex/core/graphics/Rect.as   |  45 +++++++++
 .../org/apache/flex/core/graphics/SolidColor.as |  65 ++++++++++++
 .../flex/core/graphics/SolidColorStroke.as      |  88 ++++++++++++++++
 .../as/projects/FlexJSUI/svg-manifest.xml       |   1 +
 .../apache/flex/core/graphics/GraphicShape.js   | 101 +++++++++++++++++++
 .../src/org/apache/flex/core/graphics/Rect.js   |  73 ++++++++++++++
 .../org/apache/flex/core/graphics/SolidColor.js |  78 ++++++++++++++
 .../flex/core/graphics/SolidColorStroke.js      | 100 ++++++++++++++++++
 11 files changed, 653 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2d159b6/examples/FlexJSTest_SVG/src/FlexJSTest_SVG.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSTest_SVG/src/FlexJSTest_SVG.mxml b/examples/FlexJSTest_SVG/src/FlexJSTest_SVG.mxml
index 21961f9..4a9ec56 100644
--- a/examples/FlexJSTest_SVG/src/FlexJSTest_SVG.mxml
+++ b/examples/FlexJSTest_SVG/src/FlexJSTest_SVG.mxml
@@ -28,7 +28,7 @@ limitations under the License.
 		<basic:SimpleCSSValuesImpl />
 	</basic:valuesImpl>
 	<basic:initialView>
-		<local:MyInitialView />
+		<local:GraphicsView />
 	</basic:initialView>
 	<basic:model>
 		<models:MyModel />

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2d159b6/examples/FlexJSTest_SVG/src/GraphicsView.mxml
----------------------------------------------------------------------
diff --git a/examples/FlexJSTest_SVG/src/GraphicsView.mxml b/examples/FlexJSTest_SVG/src/GraphicsView.mxml
new file mode 100644
index 0000000..4aaa9be
--- /dev/null
+++ b/examples/FlexJSTest_SVG/src/GraphicsView.mxml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+-->
+<basic:ViewBase xmlns:fx="http://ns.adobe.com/mxml/2009"
+				xmlns:basic="library://ns.apache.org/flexjs/basic"
+				xmlns:svg="library://ns.apache.org/flexjs/svg"
+				initComplete="viewbase1_initCompleteHandler(event)"
+			   >
+    <fx:Script>
+        <![CDATA[            
+			import org.apache.flex.core.graphics.Rect;
+			import org.apache.flex.core.graphics.SolidColor;
+			import org.apache.flex.core.graphics.SolidColorStroke;
+			import org.apache.flex.events.Event;
+
+			protected function viewbase1_initCompleteHandler(event:org.apache.flex.events.Event):void
+			{
+				var fill:SolidColor = new SolidColor();
+				fill.color = 0xFF0000;
+				fill.alpha = 0.5;
+				
+				var stroke:SolidColorStroke = new SolidColorStroke();
+				stroke.weight = 2;
+				stroke.color = 0x00FF00;
+				stroke.alpha = 0.9;
+				
+				var rect:Rect = new Rect();
+				rect.fill = fill;
+				rect.stroke = stroke;
+				rect.drawRect(200,200,200,200);
+				
+				this.addChild(rect);
+			}
+			
+		]]>
+    </fx:Script>
+	
+</basic:ViewBase>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2d159b6/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/GraphicShape.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/GraphicShape.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/GraphicShape.as
new file mode 100644
index 0000000..717bdab
--- /dev/null
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/GraphicShape.as
@@ -0,0 +1,47 @@
+package org.apache.flex.core.graphics
+{
+	
+	import org.apache.flex.core.UIBase;
+	
+	public class GraphicShape extends UIBase
+	{
+		private var _fill:SolidColor;
+		private var _stroke:SolidColorStroke;
+		
+		public function get stroke():SolidColorStroke
+		{
+			return _stroke;
+		}
+		
+		/**
+		 *  A solid color fill. 
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion FlexJS 0.0
+		 */
+		public function set stroke(value:SolidColorStroke):void
+		{
+			_stroke = value;
+		}
+		
+		public function get fill():SolidColor
+		{
+			return _fill;
+		}
+		/**
+		 *  A solid color fill. 
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion FlexJS 0.0
+		 */
+		public function set fill(value:SolidColor):void
+		{
+			_fill = value;
+		}
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2d159b6/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/Rect.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/Rect.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/Rect.as
new file mode 100644
index 0000000..a580e0f
--- /dev/null
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/Rect.as
@@ -0,0 +1,45 @@
+package org.apache.flex.core.graphics
+{
+
+	public class Rect extends GraphicShape
+	{
+		
+		private var _x:Number;
+		private var _y:Number;
+		private var _width:Number;
+		private var _height:Number;
+		
+		public function Rect()
+		{
+			super();
+		}
+		
+		/**
+		 *  Draw the rectangle.
+		 *  @param x The x position of the top-left corner of the rectangle.
+		 *  @param y The y position of the top-left corner.
+		 *  @param width The width of the rectangle.
+		 *  @param height The height of the rectangle.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion FlexJS 0.0
+		 */
+		public function drawRect(x:Number, y:Number, width:Number, height:Number):void
+		{
+			graphics.clear();
+			if(stroke)
+			{
+				graphics.lineStyle(stroke.weight,stroke.color,stroke.alpha);
+			}
+			if(fill)
+			{
+				graphics.beginFill(fill.color,fill.alpha);
+			}
+			graphics.drawRect(x, y, width, height);
+			graphics.endFill();
+		}
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2d159b6/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/SolidColor.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/SolidColor.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/SolidColor.as
new file mode 100644
index 0000000..2cb5b5e
--- /dev/null
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/SolidColor.as
@@ -0,0 +1,65 @@
+package org.apache.flex.core.graphics
+{
+	public class SolidColor
+	{
+		
+		//----------------------------------
+		//  alpha
+		//----------------------------------
+		
+		private var _alpha:Number = 1.0;
+		//----------------------------------
+		//  color
+		//----------------------------------
+		
+		private var _color:uint = 0x000000;
+		
+		/**
+		 *  The transparency of a color.
+		 *  Possible values are 0.0 (invisible) through 1.0 (opaque). 
+		 *  
+		 *  @default 1.0
+		 *  
+	     *  @langversion 3.0
+	     *  @playerversion Flash 10.2
+	     *  @playerversion AIR 2.6
+	     *  @productversion FlexJS 0.3
+		 */
+		public function get alpha():Number
+		{
+			return _alpha;
+		}
+		
+		public function set alpha(value:Number):void
+		{
+			var oldValue:Number = _alpha;
+			if (value != oldValue)
+			{
+				_alpha = value;
+			}
+		}
+		
+		/**
+		 *  A color value. 
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+	     *  @productversion FlexJS 0.3
+		 */
+		public function get color():uint
+		{
+			return _color;
+		}
+		
+		public function set color(value:uint):void
+		{
+			var oldValue:uint = _color;
+			if (value != oldValue)
+			{
+				_color = value;
+			}
+		}
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2d159b6/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/SolidColorStroke.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/SolidColorStroke.as b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/SolidColorStroke.as
new file mode 100644
index 0000000..8102922
--- /dev/null
+++ b/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics/SolidColorStroke.as
@@ -0,0 +1,88 @@
+package org.apache.flex.core.graphics
+{
+	public class SolidColorStroke
+	{
+		
+		//----------------------------------
+		//  alpha
+		//----------------------------------
+		private var _alpha:Number = 1.0;
+		
+		//----------------------------------
+		//  color
+		//----------------------------------
+		private var _color:uint = 0x000000;
+		
+		//----------------------------------
+		//  weight
+		//----------------------------------
+		private var _weight:Number = 1;
+		
+		/**
+		 *  The transparency of a color.
+		 *  Possible values are 0.0 (invisible) through 1.0 (opaque). 
+		 *  
+		 *  @default 1.0
+		 *  
+	     *  @langversion 3.0
+	     *  @playerversion Flash 10.2
+	     *  @playerversion AIR 2.6
+	     *  @productversion FlexJS 0.3
+		 */
+		public function get alpha():Number
+		{
+			return _alpha;
+		}
+		
+		public function set alpha(value:Number):void
+		{
+			var oldValue:Number = _alpha;
+			if (value != oldValue)
+			{
+				_alpha = value;
+			}
+		}
+		
+		/**
+		 *  A color value. 
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+	     *  @productversion FlexJS 0.3
+		 */
+		public function get color():uint
+		{
+			return _color;
+		}
+		
+		public function set color(value:uint):void
+		{
+			var oldValue:uint = _color;
+			if (value != oldValue)
+			{
+				_color = value;
+			}
+		}
+
+		public function get weight():Number
+		{
+			return _weight;
+		}
+
+		/**
+		 *  A color value. 
+		 *  
+		 *  @langversion 3.0
+		 *  @playerversion Flash 9
+		 *  @playerversion AIR 1.1
+		 *  @productversion FlexJS 0.3
+		 */
+		public function set weight(value:Number):void
+		{
+			_weight = value;
+		}
+
+		
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2d159b6/frameworks/as/projects/FlexJSUI/svg-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/svg-manifest.xml b/frameworks/as/projects/FlexJSUI/svg-manifest.xml
index 4bdaba1..998b54c 100644
--- a/frameworks/as/projects/FlexJSUI/svg-manifest.xml
+++ b/frameworks/as/projects/FlexJSUI/svg-manifest.xml
@@ -22,5 +22,6 @@
 <componentPackage>
 
     <component id="TextButton" class="org.apache.flex.svg.TextButton"/>
+	<component id="Rect" class="org.apache.flex.core.graphics.Rect" />
 
 </componentPackage>

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2d159b6/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicShape.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicShape.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicShape.js
new file mode 100644
index 0000000..beb0bf5
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/GraphicShape.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.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.SolidColor}
+   */
+  this.fill_ = null;
+  
+  /**
+   * @private
+   * @type {org.apache.flex.core.graphics.SolidColorStroke}
+   */
+  this.stroke_ = null;
+  
+};
+goog.inherits(org.apache.flex.core.graphics.GraphicShape,
+    org.apache.flex.core.UIBase);
+
+/**
+ * @override
+ */
+org.apache.flex.core.graphics.GraphicShape.prototype.createElement =
+    function() {
+
+  this.element = document.createElementNS("http://www.w3.org/2000/svg","svg");
+  this.element.setAttribute('width',1000);
+  this.element.setAttribute('height',1000);
+
+  this.positioner = this.element;
+
+  return this.element;
+};
+
+/**
+ * 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' }] };
+
+
+
+/**
+ * @expose
+ * @return {org.apache.flex.core.graphics.SolidColor} The fill object.
+ */
+org.apache.flex.core.graphics.GraphicShape.prototype.get_fill = function() {
+  return this.fill_;
+};
+
+/**
+ * @param {org.apache.flex.core.graphics.SolidColor} value The fill object.
+ */
+org.apache.flex.core.graphics.GraphicShape.prototype.set_fill = function(value) {
+  this.fill_ = value;
+};
+
+/**
+ * @expose
+ * @return {org.apache.flex.core.graphics.SolidColorStroke} The stroke object.
+ */
+org.apache.flex.core.graphics.GraphicShape.prototype.get_stroke = function() {
+  return this.stroke_;
+};
+
+
+/**
+ * @param {org.apache.flex.core.graphics.SolidColorStroke} value The stroke object.
+ */
+org.apache.flex.core.graphics.GraphicShape.prototype.set_stroke = function(value) {
+  this.stroke_ = value;
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2d159b6/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Rect.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Rect.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Rect.js
new file mode 100644
index 0000000..f8e464e
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/Rect.js
@@ -0,0 +1,73 @@
+/**
+ * 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');
+
+  /**
+   * @private
+   * @type {number}
+   */
+  this.fillColor_ = 0;
+};
+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 color = Number(this.get_fill().get_color()).toString(16);
+	if (color.length == 2) color = '00' + color;
+	if (color.length == 4) color = '00' + color;
+	
+	var strokeColor = Number(this.get_stroke().get_color()).toString(16);
+	if (strokeColor.length == 2) strokeColor = '00' + strokeColor;
+	if (strokeColor.length == 4) strokeColor = '00' + strokeColor;
+
+	var style = 'fill:#' + String(color) + ';stroke:'+ String(strokeColor) + ';stroke-width:' + String(this.get_stroke().get_weight());
+
+	var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect');
+	rect.setAttribute('style', style);
+	rect.setAttribute('x', String(x));
+	rect.setAttribute('y', String(y));
+	rect.setAttribute('width', String(width));
+	rect.setAttribute('height', String(height));
+	this.element.appendChild(rect);
+};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2d159b6/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColor.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColor.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColor.js
new file mode 100644
index 0000000..e15a95e
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColor.js
@@ -0,0 +1,78 @@
+/**
+ * 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');
+
+
+/**
+ * @constructor
+ */
+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' }] };
+
+
+/**
+ * @expose
+ * @return {number} color
+ */
+org.apache.flex.core.graphics.SolidColor.prototype.get_color = function() {
+  return this.color_;
+};
+
+
+/**
+ * @param {number} value color
+ */
+org.apache.flex.core.graphics.SolidColor.prototype.set_color = function(value) {
+  this.color_ = value;
+};
+
+
+/**
+ * @expose
+ * @return {number} alpha
+ */
+org.apache.flex.core.graphics.SolidColor.prototype.get_alpha = function() {
+  return this.alpha_;
+};
+
+
+/**
+ * @param {number} value alpha
+ */
+org.apache.flex.core.graphics.SolidColor.prototype.set_alpha = function(value) {
+  this.alpha_ = value;
+};

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/f2d159b6/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColorStroke.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColorStroke.js b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColorStroke.js
new file mode 100644
index 0000000..8785016
--- /dev/null
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/graphics/SolidColorStroke.js
@@ -0,0 +1,100 @@
+/**
+ * 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');
+
+
+/**
+ * @constructor
+ */
+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' }] };
+
+
+/**
+ * @expose
+ * @return {number} color
+ */
+org.apache.flex.core.graphics.SolidColorStroke.prototype.get_color = function() {
+  return this.color_;
+};
+
+
+/**
+ * @param {number} value color
+ */
+org.apache.flex.core.graphics.SolidColorStroke.prototype.set_color = function(value) {
+  this.color_ = value;
+};
+
+
+/**
+ * @expose
+ * @return {number} alpha
+ */
+org.apache.flex.core.graphics.SolidColorStroke.prototype.get_alpha = function() {
+  return this.alpha_;
+};
+
+
+/**
+ * @param {number} value alpha
+ */
+org.apache.flex.core.graphics.SolidColorStroke.prototype.set_alpha = function(value) {
+  this.alpha_ = value;
+};
+
+/**
+ * @expose
+ * @return {number} weight
+ */
+org.apache.flex.core.graphics.SolidColorStroke.prototype.get_weight = function() {
+  return this.weight_;
+};
+
+
+/**
+ * @param {number} value weight
+ */
+org.apache.flex.core.graphics.SolidColorStroke.prototype.set_weight = function(value) {
+  this.weight_ = value;
+};


[2/2] git commit: [flex-asjs] [refs/heads/develop] - Added the new classes to FlexJSUIClasses.as

Posted by bi...@apache.org.
Added the new classes to FlexJSUIClasses.as


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/5ae077b6
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/5ae077b6
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/5ae077b6

Branch: refs/heads/develop
Commit: 5ae077b662259bb64ddabd7e699613f1904a2fa4
Parents: f2d159b
Author: Om <bi...@gmail.com>
Authored: Thu Sep 4 01:22:27 2014 -0700
Committer: Om <bi...@gmail.com>
Committed: Thu Sep 4 01:23:22 2014 -0700

----------------------------------------------------------------------
 frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/5ae077b6/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as
----------------------------------------------------------------------
diff --git a/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as b/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as
index 5dbb3a0..e6c8c62 100644
--- a/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as
+++ b/frameworks/as/projects/FlexJSUI/src/FlexJSUIClasses.as
@@ -117,6 +117,10 @@ internal class FlexJSUIClasses
 	import org.apache.flex.utils.Timer; Timer;
 	import org.apache.flex.utils.UIUtils; UIUtils;
     import org.apache.flex.core.SimpleStatesImpl; SimpleStatesImpl;
+	import org.apache.flex.core.graphics.GraphicShape; GraphicShape;
+	import org.apache.flex.core.graphics.Rect; Rect;
+	import org.apache.flex.core.graphics.SolidColor; SolidColor;
+	import org.apache.flex.core.graphics.SolidColorStroke; SolidColorStroke;
     
 	import mx.core.ClassFactory; ClassFactory;
     import mx.states.AddItems; AddItems;