Repository: flex-asjs
Updated Branches:
  refs/heads/svg-rename 58bb15354 -> 11136dcb4


Added lineCap, lineJoin and miterLimit


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

Branch: refs/heads/svg-rename
Commit: 11136dcb4c0bd4a19a733f03c1123a360a0094b1
Parents: 58bb153
Author: Harbs <[email protected]>
Authored: Sun Jul 24 13:07:05 2016 +0300
Committer: Harbs <[email protected]>
Committed: Sun Jul 24 13:07:05 2016 +0300

----------------------------------------------------------------------
 .../flex/org/apache/flex/graphics/IStroke.as    |   7 +
 .../flex/org/apache/flex/graphics/LineStyle.as  |  59 +++++
 .../apache/flex/graphics/SolidColorStroke.as    | 231 ++++++++++++-------
 .../src/main/resources/basic-manifest.xml       |   1 +
 4 files changed, 210 insertions(+), 88 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/11136dcb/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
 
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
index 9fc7e0e..a2c647f 100644
--- 
a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
+++ 
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/IStroke.as
@@ -25,5 +25,12 @@ package org.apache.flex.graphics
         COMPILE::JS
         function addStrokeAttrib(s:IGraphicShape):String;
 
+        function get lineCap():String;
+        function set lineCap(val:String):void;
+        function get lineJoin():String;
+        function set lineJoin(val:String):void;
+        function get miterLimit():Number;
+        function set miterLimit(val:Number):void;
+
        }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/11136dcb/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/LineStyle.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/LineStyle.as
 
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/LineStyle.as
new file mode 100644
index 0000000..e0cd7dd
--- /dev/null
+++ 
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/LineStyle.as
@@ -0,0 +1,59 @@
+/**
+ * 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.
+ */
+package org.apache.flex.graphics
+{
+    public class LineStyle
+    {
+        /**
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static const MITER:String = "miter";
+        /**
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static const ROUND:String = "round";
+        /**
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static const BEVEL:String = "bevel";
+        /**
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static const BUTT:String = "butt";
+        /**
+         *  
+         *  @langversion 3.0
+         *  @playerversion Flash 10.2
+         *  @playerversion AIR 2.6
+         *  @productversion FlexJS 0.0
+         */
+        public static const SQUARE:String = "square";
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/11136dcb/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
----------------------------------------------------------------------
diff --git 
a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
 
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
index 6cb6963..e301250 100644
--- 
a/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
+++ 
b/frameworks/projects/Graphics/src/main/flex/org/apache/flex/graphics/SolidColorStroke.as
@@ -14,7 +14,7 @@
 
 package org.apache.flex.graphics
 {
-       import org.apache.flex.utils.CSSUtils;
+    import org.apache.flex.utils.CSSUtils;
 
     COMPILE::SWF
     {
@@ -22,95 +22,106 @@ package org.apache.flex.graphics
         import flash.display.JointStyle;            
     }
 
-       public class SolidColorStroke implements IStroke
-       {
-               
-               //----------------------------------
-               //  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 class SolidColorStroke implements IStroke
+    {
+        public function SolidColorStroke()
+        {
+            COMPILE::SWF
+            {
+                _lineCap = "none";
+            }
 
-               public function get weight():Number
-               {
-                       return _weight;
-               }
+            COMPILE::JS
+            {
+                _lineCap = "butt";
+            }
+        }
+        //----------------------------------
+        //  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;
+            }
+        }
 
-               /**
-                *  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;
-               }
-               
+        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;
+        }
+        
         COMPILE::SWF
-               public function apply(s:IGraphicShape):void
-               {
-                       
s.graphics.lineStyle(weight,color,alpha,false,"normal",CapsStyle.SQUARE,JointStyle.MITER);
-               }
-               
+        public function apply(s:IGraphicShape):void
+        {
+            
s.graphics.lineStyle(weight,color,alpha,false,"normal",CapsStyle.SQUARE,JointStyle.MITER);
+        }
+        
         /**
          * addStrokeAttrib()
          * 
@@ -124,5 +135,49 @@ package org.apache.flex.graphics
                 String(weight) + ';stroke-opacity:' + String(alpha);
         };
 
-       }
+        private var _lineCap:String;
+        public function get lineCap():String
+        {
+            return _lineCap;
+        }
+        public function set lineCap(val:String):void
+        {
+            COMPILE::SWF
+            {
+                switch(val)
+                {
+                    case "butt":
+                        _lineCap = "none";
+                        break;
+                    default:
+                        _lineCap = val;
+                        break;
+                }
+            }
+            COMPILE::JS
+            {
+                _lineCap = val;
+            }
+
+        }
+        private var _lineJoin:String = "miter";
+        public function get lineJoin():String
+        {
+            return _lineJoin;
+        }
+        public function set lineJoin(val:String):void
+        {
+            _lineJoin = val;
+        }
+        private var _miterLimit:Number = 4;
+        public function get miterLimit():Number
+        {
+            return _miterLimit;
+        }
+        public function set miterLimit(val:Number):void
+        {
+            _miterLimit = val;
+        }
+
+    }
 }

http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/11136dcb/frameworks/projects/Graphics/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Graphics/src/main/resources/basic-manifest.xml 
b/frameworks/projects/Graphics/src/main/resources/basic-manifest.xml
index bea49c3..c84644e 100644
--- a/frameworks/projects/Graphics/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/Graphics/src/main/resources/basic-manifest.xml
@@ -26,6 +26,7 @@
        <component id="Path" class="org.apache.flex.svg.Path" />
        <component id="Rect" class="org.apache.flex.svg.Rect" />
        <component id="CompoundGraphic" 
class="org.apache.flex.svg.CompoundGraphic" />
+       <component id="GraphicContainer" 
class="org.apache.flex.svg.GraphicContainer" />
     <component id="GradientEntry" 
class="org.apache.flex.graphics.GradientEntry" />
     <component id="LinearGradient" class="org.apache.flex.svg.LinearGradient" 
/>
     <component id="SolidColor" class="org.apache.flex.graphics.SolidColor" />

Reply via email to