Drawing poly lines with Path API (Was: Re: [FlexJS] Drawing API)
On Mon, Sep 8, 2014 at 1:59 PM, Peter Ent p...@adobe.com wrote: Which brings me to the next issue. When drawing a series of connected lines (for the LineChart), the first and last points are getting connected, which I do not want. My loop to build the path looks like this, below. point[0] != point[last] so they should not be connected. I tried z and Z thinking one meant leave the path closed and one closed the path, but that didn't make any difference. var pathString:String = ; for (var i:int=0; i points.length; i++) { var point:Object = points[i]; if (i == 0) pathString += M +point.x+ +point.y+ ; else pathString += L +point.x+ +point.y+ ; } pathString += Z; path.drawPath(0, 0, pathString); I just tried it. The loop gets closed only if there is a fill element. If we set only the stroke, the lines draw and end correctly. I had a bug in GraphicShape where it would not handle null fill or stroke values. Now it is fixed. For example: var path1:Path = new Path(); stroke.color = 0x00; stroke.weight = 1; path1.stroke = stroke; path1.drawPath(50,50,M50,50L50,100L100,25L45,60L34,23L56,90L50,50Z); this.addElement(path1); draws a series of connected lines; the first and last points are not connected. Please let me know if this works for you. Thanks, Om
Flash freeze for 60 seconds in Chrome
Hi Guys, I am working on some Adobe Flex (v. 4.5.0) application (it using a lot of javascript also through ExternalInterface) and from some time we are noticing freeze of these application for 60 seconds in Google Chrome with default Flash Player plugin. I spend some time to optimize some logic in the application, but it didn't help. I'm wondering whether this could be problem with default Chrome flash player. If you guys had any similar problems - some information on that would be precious. Piotr - Apache Flex Committer piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/Flash-freeze-for-60-seconds-in-Chrome-tp40638.html Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: Flash freeze for 60 seconds in Chrome
For my day to day browsing, I try to use the debug player in chrome, because I find it's performance is much better. There seems to be some restrictions with the Pepper Flash api on what resources it can access vs NPAPI. It's worth the time to isolate if it's a flash player version problem or a code problem on your side. brought to you by the letters A, V, and I and the number 47 On Wed, Sep 10, 2014 at 10:50 AM, piotrz piotrzarzyck...@gmail.com wrote: Hi Guys, I am working on some Adobe Flex (v. 4.5.0) application (it using a lot of javascript also through ExternalInterface) and from some time we are noticing freeze of these application for 60 seconds in Google Chrome with default Flash Player plugin. I spend some time to optimize some logic in the application, but it didn't help. I'm wondering whether this could be problem with default Chrome flash player. If you guys had any similar problems - some information on that would be precious. Piotr - Apache Flex Committer piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/Flash-freeze-for-60-seconds-in-Chrome-tp40638.html Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: Flash freeze for 60 seconds in Chrome
You could try to install the regular flash player (non debug) in chrome and disable the default bundled with it. On 10 September 2014 09:59, Avi Kessner akess...@gmail.com wrote: For my day to day browsing, I try to use the debug player in chrome, because I find it's performance is much better. There seems to be some restrictions with the Pepper Flash api on what resources it can access vs NPAPI. It's worth the time to isolate if it's a flash player version problem or a code problem on your side. brought to you by the letters A, V, and I and the number 47 On Wed, Sep 10, 2014 at 10:50 AM, piotrz piotrzarzyck...@gmail.com wrote: Hi Guys, I am working on some Adobe Flex (v. 4.5.0) application (it using a lot of javascript also through ExternalInterface) and from some time we are noticing freeze of these application for 60 seconds in Google Chrome with default Flash Player plugin. I spend some time to optimize some logic in the application, but it didn't help. I'm wondering whether this could be problem with default Chrome flash player. If you guys had any similar problems - some information on that would be precious. Piotr - Apache Flex Committer piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/Flash-freeze-for-60-seconds-in-Chrome-tp40638.html Sent from the Apache Flex Development mailing list archive at Nabble.com. -- João Fernandes
Re: Flash freeze for 60 seconds in Chrome
@João you mean just use regular flash player ? - This doesn't occur so far in the regular flash player. @Avi that's why I wrote on the dev list, because from that point where I'm now I'm still not sure whether this is Flash Player problem. Piotr - Apache Flex Committer piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/Flash-freeze-for-60-seconds-in-Chrome-tp40638p40642.html Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: Flash freeze for 60 seconds in Chrome
If it happens in one player but not the other it's a player problem :) On Sep 10, 2014 1:11 PM, piotrz piotrzarzyck...@gmail.com wrote: @João you mean just use regular flash player ? - This doesn't occur so far in the regular flash player. @Avi that's why I wrote on the dev list, because from that point where I'm now I'm still not sure whether this is Flash Player problem. Piotr - Apache Flex Committer piotrzarzyck...@gmail.com -- View this message in context: http://apache-flex-development.247.n4.nabble.com/Flash-freeze-for-60-seconds-in-Chrome-tp40638p40642.html Sent from the Apache Flex Development mailing list archive at Nabble.com.
Re: [FlexJS] Path API bug (Was Re: [FlexJS] Drawing API)
I ran FlexJSTest_SVG without any issues from Flash Builder. I will look to see how each of these graphics elements are being used. Thanks, Peter Ent Adobe Systems On 9/9/14 8:47 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 2:26 PM, Peter Ent p...@adobe.com wrote: I tried that and it did not work (because the fill and stroke were not set), so I changed my itemRenderer to create the Rect at the point of use: protected function drawBar():void { if (this.width 0 this.height 0) { if (filledRect == null) filledRect = new Rect(); var solidColor:SolidColor = new SolidColor(); solidColor.color = fillColor; var solidStroke:SolidColorStroke = new SolidColorStroke(); solidStroke.color = fillColor; solidStroke.weight = 1; filledRect.fill = solidColor; filledRect.stroke = solidStroke; filledRect.drawRect(0,0,this.width,this.height); if (needsAdd) { addElement(filledRect); needsAdd = false; } } } That's the AS code, but the x-compiled JS code is identical (except for all of the Language.as things Falcon adds). I'm getting the same exception when the filledRect element is added. I stepped through using Firebug and all of the code is being executed, so the Rect's fill and stroke are now set and the width and height of the itemRenderer have non-zero values. So this should draw a filled rectangle. It's possible that I have not checked in something. Are you able to compile and run the examples\FlexJSTest_SVG without any issues? Perhaps you can check in your code so I can see what's happening? Thanks, Om Thanks, Om Peter Ent Adobe Systems On 9/9/14 4:53 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: Ah, I see what's happening. My code expects the drawXXX() [drawRect, drawPath, etc.] to be called before adding it as an element to the parent. Try switching this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); to this.filledRect = new org.apache.flex.core.graphics.Rect(); this.filledRect.drawRect(x,y,width,height); this.addElement(this.filledRect); I can change how this works, but I don't see an invalidation mechanism that I can use. How do you suggest we approach this? Thanks, Om On Tue, Sep 9, 2014 at 1:40 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 1:15 PM, Peter Ent p...@adobe.com wrote: I created a temporary item renderer to see how the x-compile would work. Here is the code in my temporary item renderer that creates the Rect: org.apache.flex.charts.supportClasses.TempBoxRenderer.prototype.set_da ta = function(value) { org.apache.flex.charts.supportClasses.TempBoxRenderer.base(this, 'set_data', value); if (this.filledRect == null) { this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); } }; this.addElement() is called which leads to the addedToParent function where the crash happens. I see that GraphicShape.js doesn't extends UIBase.js, which it probably should, given how the AS side works. Peter Are you sure you have the latest code? I remember fixing this exact issue a few commits ago. If you can check in the example, it will be easier for me to chase the issue down. I contemplated if I should extend GraphicShape off of a relatively heavy UIBase or if I can just implement IUIBase. As a temporary workaround, I do have an addedToParent() method in GraphicShape, where the element should already be on the DOM, so that getBBox() should work. Have you tried it in any other browser, maybe it is a browser specific issue? Are there any other errors in the console? Thanks, Om On 9/9/14 2:22 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 8:19 AM, Peter Ent p...@adobe.com wrote: Have run into a problem on the JS side. Firebox is telling me that in this code from GraphicShape.js: org.apache.flex.core.graphics.GraphicShape.prototype.addedToParent = function() { var bbox = this.element.getBBox(); this.resize(this.x_, this.y_, bbox.width + this.x_ * 2, bbox.height + this.y_ * 2); }; Peter, Can you please attach the html code for the svg element that is throwing an error? I will try to repro it on my side. Did you try Chrome or other browsers? Thanks, Om this.element.getBBox() is returning undefined. I know that this.element is set with an SVG element. I'm using Firefox 31.0 on Mac OS X. Peter Ent Adobe Systems On 9/9/14 10:37 AM, Peter Ent p...@adobe.com wrote: The update to handle 'A' and 'a' works great! Thanks. Peter Ent Adobe Systems On 9/9/14 3:42 AM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Mon, Sep 8,
Re: [FlexJS] Path API bug (Was Re: [FlexJS] Drawing API)
I made a small modification to FlexJSTest_SVG: var path2:Path = new Path(); fill.color = 0x00FF00; fill.alpha = 0.5; // path2.fill = fill; stroke.color = 0xFF00FF; stroke.weight = 3; path2.stroke = stroke; path2.drawPath(250,500,M150 0 L75 200 L225 200 Z); this.addElement(path2); I removed the fill for the Path. This should have drawn 2 lines starting at (150,0) with a line to (75,200) and another to (225,200). Which it did. But it also closed the figure by drawing a third line from (225,200) back to (150,0). For the LineChart, the first and last points cannot be closed. Thanks, Peter Ent Adobe Systems On 9/10/14 9:26 AM, Peter Ent p...@adobe.com wrote: I ran FlexJSTest_SVG without any issues from Flash Builder. I will look to see how each of these graphics elements are being used. Thanks, Peter Ent Adobe Systems On 9/9/14 8:47 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 2:26 PM, Peter Ent p...@adobe.com wrote: I tried that and it did not work (because the fill and stroke were not set), so I changed my itemRenderer to create the Rect at the point of use: protected function drawBar():void { if (this.width 0 this.height 0) { if (filledRect == null) filledRect = new Rect(); var solidColor:SolidColor = new SolidColor(); solidColor.color = fillColor; var solidStroke:SolidColorStroke = new SolidColorStroke(); solidStroke.color = fillColor; solidStroke.weight = 1; filledRect.fill = solidColor; filledRect.stroke = solidStroke; filledRect.drawRect(0,0,this.width,this.height); if (needsAdd) { addElement(filledRect); needsAdd = false; } } } That's the AS code, but the x-compiled JS code is identical (except for all of the Language.as things Falcon adds). I'm getting the same exception when the filledRect element is added. I stepped through using Firebug and all of the code is being executed, so the Rect's fill and stroke are now set and the width and height of the itemRenderer have non-zero values. So this should draw a filled rectangle. It's possible that I have not checked in something. Are you able to compile and run the examples\FlexJSTest_SVG without any issues? Perhaps you can check in your code so I can see what's happening? Thanks, Om Thanks, Om Peter Ent Adobe Systems On 9/9/14 4:53 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: Ah, I see what's happening. My code expects the drawXXX() [drawRect, drawPath, etc.] to be called before adding it as an element to the parent. Try switching this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); to this.filledRect = new org.apache.flex.core.graphics.Rect(); this.filledRect.drawRect(x,y,width,height); this.addElement(this.filledRect); I can change how this works, but I don't see an invalidation mechanism that I can use. How do you suggest we approach this? Thanks, Om On Tue, Sep 9, 2014 at 1:40 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 1:15 PM, Peter Ent p...@adobe.com wrote: I created a temporary item renderer to see how the x-compile would work. Here is the code in my temporary item renderer that creates the Rect: org.apache.flex.charts.supportClasses.TempBoxRenderer.prototype.set_d a ta = function(value) { org.apache.flex.charts.supportClasses.TempBoxRenderer.base(this, 'set_data', value); if (this.filledRect == null) { this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); } }; this.addElement() is called which leads to the addedToParent function where the crash happens. I see that GraphicShape.js doesn't extends UIBase.js, which it probably should, given how the AS side works. Peter Are you sure you have the latest code? I remember fixing this exact issue a few commits ago. If you can check in the example, it will be easier for me to chase the issue down. I contemplated if I should extend GraphicShape off of a relatively heavy UIBase or if I can just implement IUIBase. As a temporary workaround, I do have an addedToParent() method in GraphicShape, where the element should already be on the DOM, so that getBBox() should work. Have you tried it in any other browser, maybe it is a browser specific issue? Are there any other errors in the console? Thanks, Om On 9/9/14 2:22 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 8:19 AM, Peter Ent p...@adobe.com wrote: Have run into a problem on the JS side. Firebox is
Re: [FlexJS] Path API bug (Was Re: [FlexJS] Drawing API)
That last message was for the ActionScript side. When I build the sample in JavaScript - with my change to remove the fill on path2, I get this runtime error: TypeError: this.get_fill(...) is null var color = Number(this.get_fill().get_color()).toString(16); Here is the code from GraphicShape.js: org.apache.flex.core.graphics.GraphicShape.prototype.getStyleStr = function() { 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; return 'fill:#' + String(color) + ';stroke:#' + String(strokeColor) + ';stroke-width:' + String(this.get_stroke().get_weight()) + ';fill-opacity:' + String(this.get_fill().get_alpha()); }; Since the Path does not have a fill set, this.get_fill() is returning null. I'm really looking forward to having the chart package's itemRenderers x-compiled and using this graphics package. I hope we can get these issues and licensing issues resolved. Thanks, Peter Ent Adobe Systems On 9/10/14 10:06 AM, Peter Ent p...@adobe.com wrote: I made a small modification to FlexJSTest_SVG: var path2:Path = new Path(); fill.color = 0x00FF00; fill.alpha = 0.5; // path2.fill = fill; stroke.color = 0xFF00FF; stroke.weight = 3; path2.stroke = stroke; path2.drawPath(250,500,M150 0 L75 200 L225 200 Z); this.addElement(path2); I removed the fill for the Path. This should have drawn 2 lines starting at (150,0) with a line to (75,200) and another to (225,200). Which it did. But it also closed the figure by drawing a third line from (225,200) back to (150,0). For the LineChart, the first and last points cannot be closed. Thanks, Peter Ent Adobe Systems On 9/10/14 9:26 AM, Peter Ent p...@adobe.com wrote: I ran FlexJSTest_SVG without any issues from Flash Builder. I will look to see how each of these graphics elements are being used. Thanks, Peter Ent Adobe Systems On 9/9/14 8:47 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 2:26 PM, Peter Ent p...@adobe.com wrote: I tried that and it did not work (because the fill and stroke were not set), so I changed my itemRenderer to create the Rect at the point of use: protected function drawBar():void { if (this.width 0 this.height 0) { if (filledRect == null) filledRect = new Rect(); var solidColor:SolidColor = new SolidColor(); solidColor.color = fillColor; var solidStroke:SolidColorStroke = new SolidColorStroke(); solidStroke.color = fillColor; solidStroke.weight = 1; filledRect.fill = solidColor; filledRect.stroke = solidStroke; filledRect.drawRect(0,0,this.width,this.height); if (needsAdd) { addElement(filledRect); needsAdd = false; } } } That's the AS code, but the x-compiled JS code is identical (except for all of the Language.as things Falcon adds). I'm getting the same exception when the filledRect element is added. I stepped through using Firebug and all of the code is being executed, so the Rect's fill and stroke are now set and the width and height of the itemRenderer have non-zero values. So this should draw a filled rectangle. It's possible that I have not checked in something. Are you able to compile and run the examples\FlexJSTest_SVG without any issues? Perhaps you can check in your code so I can see what's happening? Thanks, Om Thanks, Om Peter Ent Adobe Systems On 9/9/14 4:53 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: Ah, I see what's happening. My code expects the drawXXX() [drawRect, drawPath, etc.] to be called before adding it as an element to the parent. Try switching this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); to this.filledRect = new org.apache.flex.core.graphics.Rect(); this.filledRect.drawRect(x,y,width,height); this.addElement(this.filledRect); I can change how this works, but I don't see an invalidation mechanism that I can use. How do you suggest we approach this? Thanks, Om On Tue, Sep 9, 2014 at 1:40 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 1:15 PM, Peter Ent p...@adobe.com wrote: I created a temporary item renderer to see how the x-compile would work. Here is the code in my temporary item renderer that creates the Rect: org.apache.flex.charts.supportClasses.TempBoxRenderer.prototype.set_ d a ta = function(value) {
Re: [FlexJS] Path API bug (Was Re: [FlexJS] Drawing API)
On Sep 10, 2014 7:12 AM, Peter Ent p...@adobe.com wrote: That last message was for the ActionScript side. When I build the sample in JavaScript - with my change to remove the fill on path2, I get this runtime error: TypeError: this.get_fill(...) is null var color = Number(this.get_fill().get_color()).toString(16); Here is the code from GraphicShape.js: org.apache.flex.core.graphics.GraphicShape.prototype.getStyleStr = function() { 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; return 'fill:#' + String(color) + ';stroke:#' + String(strokeColor) + ';stroke-width:' + String(this.get_stroke().get_weight()) + ';fill-opacity:' + String(this.get_fill().get_alpha()); }; This looks like stale code. I checked in a fix for this issue last night. Can you get the latest and try out? Since the Path does not have a fill set, this.get_fill() is returning null. I'm really looking forward to having the chart package's itemRenderers x-compiled and using this graphics package. I hope we can get these issues and licensing issues resolved. Likewise! I plan to work with you and fix any and all issues that crop up :-) Thanks, Om Thanks, Peter Ent Adobe Systems On 9/10/14 10:06 AM, Peter Ent p...@adobe.com wrote: I made a small modification to FlexJSTest_SVG: var path2:Path = new Path(); fill.color = 0x00FF00; fill.alpha = 0.5; // path2.fill = fill; stroke.color = 0xFF00FF; stroke.weight = 3; path2.stroke = stroke; path2.drawPath(250,500,M150 0 L75 200 L225 200 Z); this.addElement(path2); I removed the fill for the Path. This should have drawn 2 lines starting at (150,0) with a line to (75,200) and another to (225,200). Which it did. But it also closed the figure by drawing a third line from (225,200) back to (150,0). For the LineChart, the first and last points cannot be closed. Thanks, Peter Ent Adobe Systems On 9/10/14 9:26 AM, Peter Ent p...@adobe.com wrote: I ran FlexJSTest_SVG without any issues from Flash Builder. I will look to see how each of these graphics elements are being used. Thanks, Peter Ent Adobe Systems On 9/9/14 8:47 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 2:26 PM, Peter Ent p...@adobe.com wrote: I tried that and it did not work (because the fill and stroke were not set), so I changed my itemRenderer to create the Rect at the point of use: protected function drawBar():void { if (this.width 0 this.height 0) { if (filledRect == null) filledRect = new Rect(); var solidColor:SolidColor = new SolidColor(); solidColor.color = fillColor; var solidStroke:SolidColorStroke = new SolidColorStroke(); solidStroke.color = fillColor; solidStroke.weight = 1; filledRect.fill = solidColor; filledRect.stroke = solidStroke; filledRect.drawRect(0,0,this.width,this.height); if (needsAdd) { addElement(filledRect); needsAdd = false; } } } That's the AS code, but the x-compiled JS code is identical (except for all of the Language.as things Falcon adds). I'm getting the same exception when the filledRect element is added. I stepped through using Firebug and all of the code is being executed, so the Rect's fill and stroke are now set and the width and height of the itemRenderer have non-zero values. So this should draw a filled rectangle. It's possible that I have not checked in something. Are you able to compile and run the examples\FlexJSTest_SVG without any issues? Perhaps you can check in your code so I can see what's happening? Thanks, Om Thanks, Om Peter Ent Adobe Systems On 9/9/14 4:53 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: Ah, I see what's happening. My code expects the drawXXX() [drawRect, drawPath, etc.] to be called before adding it as an element to the parent. Try switching this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); to this.filledRect = new org.apache.flex.core.graphics.Rect(); this.filledRect.drawRect(x,y,width,height); this.addElement(this.filledRect); I can change how this works, but I don't see an invalidation mechanism that I can use. How do you suggest we approach this? Thanks, Om On Tue, Sep 9, 2014 at 1:40
Re: [FlexJS] Path API bug (Was Re: [FlexJS] Drawing API)
On Sep 10, 2014 7:07 AM, Peter Ent p...@adobe.com wrote: I made a small modification to FlexJSTest_SVG: var path2:Path = new Path(); fill.color = 0x00FF00; fill.alpha = 0.5; // path2.fill = fill; stroke.color = 0xFF00FF; stroke.weight = 3; path2.stroke = stroke; path2.drawPath(250,500,M150 0 L75 200 L225 200 Z); this.addElement(path2); I removed the fill for the Path. This should have drawn 2 lines starting at (150,0) with a line to (75,200) and another to (225,200). Which it did. But it also closed the figure by drawing a third line from (225,200) back to (150,0). That is so weird. It did not do that when I tested it. Will try it out again in some time and see what's going on. For the LineChart, the first and last points cannot be closed. Thanks, Peter Ent Adobe Systems On 9/10/14 9:26 AM, Peter Ent p...@adobe.com wrote: I ran FlexJSTest_SVG without any issues from Flash Builder. I will look to see how each of these graphics elements are being used. Thanks, Peter Ent Adobe Systems On 9/9/14 8:47 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 2:26 PM, Peter Ent p...@adobe.com wrote: I tried that and it did not work (because the fill and stroke were not set), so I changed my itemRenderer to create the Rect at the point of use: protected function drawBar():void { if (this.width 0 this.height 0) { if (filledRect == null) filledRect = new Rect(); var solidColor:SolidColor = new SolidColor(); solidColor.color = fillColor; var solidStroke:SolidColorStroke = new SolidColorStroke(); solidStroke.color = fillColor; solidStroke.weight = 1; filledRect.fill = solidColor; filledRect.stroke = solidStroke; filledRect.drawRect(0,0,this.width,this.height); if (needsAdd) { addElement(filledRect); needsAdd = false; } } } That's the AS code, but the x-compiled JS code is identical (except for all of the Language.as things Falcon adds). I'm getting the same exception when the filledRect element is added. I stepped through using Firebug and all of the code is being executed, so the Rect's fill and stroke are now set and the width and height of the itemRenderer have non-zero values. So this should draw a filled rectangle. It's possible that I have not checked in something. Are you able to compile and run the examples\FlexJSTest_SVG without any issues? Perhaps you can check in your code so I can see what's happening? Thanks, Om Thanks, Om Peter Ent Adobe Systems On 9/9/14 4:53 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: Ah, I see what's happening. My code expects the drawXXX() [drawRect, drawPath, etc.] to be called before adding it as an element to the parent. Try switching this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); to this.filledRect = new org.apache.flex.core.graphics.Rect(); this.filledRect.drawRect(x,y,width,height); this.addElement(this.filledRect); I can change how this works, but I don't see an invalidation mechanism that I can use. How do you suggest we approach this? Thanks, Om On Tue, Sep 9, 2014 at 1:40 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 1:15 PM, Peter Ent p...@adobe.com wrote: I created a temporary item renderer to see how the x-compile would work. Here is the code in my temporary item renderer that creates the Rect: org.apache.flex.charts.supportClasses.TempBoxRenderer.prototype.set_d a ta = function(value) { org.apache.flex.charts.supportClasses.TempBoxRenderer.base(this, 'set_data', value); if (this.filledRect == null) { this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); } }; this.addElement() is called which leads to the addedToParent function where the crash happens. I see that GraphicShape.js doesn't extends UIBase.js, which it probably should, given how the AS side works. Peter Are you sure you have the latest code? I remember fixing this exact issue a few commits ago. If you can check in the example, it will be easier for me to chase the issue down. I contemplated if I should extend GraphicShape off of a relatively heavy UIBase or if I can just implement IUIBase. As a temporary workaround, I do have an addedToParent() method in GraphicShape, where the element should already be on the DOM, so that getBBox() should work. Have you tried
Alex's Legal Mental Model (was Re: [FlexJS] Drawing API)
Apologies for not changing the subject sooner. I want to try to clear up some things in case someone actually does try to create a wiki page from these emails. Comments in-line... On 9/9/14 2:53 PM, Justin Mclean jus...@classsoftware.com wrote: Hi, -Every line of code was written by somebody, and therefore copyrighted by that somebody (or their employer). Depends on the actually LICENSE. If you look at [1] you see that it states: 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. Again, I am not an authority, but I believe in the paragraph you quote the term Copyright License is referencing the permission to make copies. I don't what the legal term I was addressing is, but I would call it Copyright Ownership. I would doubt that the AL would give any person the right to claim copyright ownership for lines of code they did not write. IOW, I doubt this paragraph gives you authority to add your name to the NOTICE file claiming to be one of the original developers of the Flex SDK, or change the copyright notice in the 3rd party file Om wants to use. And it is just a mental model, not a legal reference, and only applies to works under AL since in the broader sense there is code placed in the public domain or defaulting to public domain after copyright protection runs out, but my statement that every line of code is copyrighted by somebody has held up well for me. Also I did not reach this conclusion just by my own reading. This mental model is influenced from various conversations with Adobe lawyers. -There is an unwritten policy that says that Apache projects do not take code. It must be donated. In this case IMO there's no need to, but it certainly doesn't hurt to ask the owner of the code for permission, even though it is already given by the license (see above). I should probably be more clear what take means because it confused me when I first joined Apache. From various mailing lists, there seems to be a distinction between AL code that is contributed to the ASF vs 3rd-party code that uses an AL. Roy Fielding, one of the Apache Founders, wants all contributions to be voluntary. There is a thread on board@ (which most of you can't see) titled Voluntary Contributions where that claim is made. That's why I said it is unwritten, but it looks from that thread that it is accepted practice at the ASF. I used to think the distinction had to do with whether a source file was in an ASF repo or not, but after learning more about 3rd-party header policy and the desire to list non-ASF components somewhere like LICENSE, I now think the distinction is whether the source file has been voluntarily contributed is not easily visible, which is why folks are now pushing for documentation of what files are 3rd-party. For Om's case, we are a bit lucky that the source file's header is not the same as the standard ASF header, but in many other cases it could be. And even for this file, the differences are subtle, so the LICENSE or somewhere should provide a heads up to the consumer. So take means grabbing a source file and making it look like it was contributed by changing the header if needed. Grabbing a copy of a source file intact, which is what Om wants to do, is ok, as long as it is documented and treated as 3rd-party and permission does not need to be sought if the source is going to be given third-party treatment. So what can/can't you do to an AL, 3rd party file that you can/can't do to an ASF file? IOW, why is there a distinction at all? AFAICT, there is no difference to us committers. You can modify the code either way. But I would offer these thoughts: 1) If you are just fixing a bug in 3rd-party code, we should probably contribute that fix to the original community. 2) Often, the original community committers do not have ICLA's on file to contribute to our copy. And there may be some legal indemnification aspect to source in a release that is ASF AL vs 3rd-party AL. -Alex
Re: [FlexJS] Path API bug (Was Re: [FlexJS] Drawing API)
I have the latest code; I didn't install it into my Apache FlexJS deployment. That last step always gets me. I did more research on Path and discovered that the presence of the Z is making the path closed (I thought a path string MUST end with a Z), so I believe I can proceed with converting the chart package over to core/graphics. Thanks, Om, for your help and patience. --peter On 9/10/14 10:45 AM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Sep 10, 2014 7:07 AM, Peter Ent p...@adobe.com wrote: I made a small modification to FlexJSTest_SVG: var path2:Path = new Path(); fill.color = 0x00FF00; fill.alpha = 0.5; // path2.fill = fill; stroke.color = 0xFF00FF; stroke.weight = 3; path2.stroke = stroke; path2.drawPath(250,500,M150 0 L75 200 L225 200 Z); this.addElement(path2); I removed the fill for the Path. This should have drawn 2 lines starting at (150,0) with a line to (75,200) and another to (225,200). Which it did. But it also closed the figure by drawing a third line from (225,200) back to (150,0). That is so weird. It did not do that when I tested it. Will try it out again in some time and see what's going on. For the LineChart, the first and last points cannot be closed. Thanks, Peter Ent Adobe Systems On 9/10/14 9:26 AM, Peter Ent p...@adobe.com wrote: I ran FlexJSTest_SVG without any issues from Flash Builder. I will look to see how each of these graphics elements are being used. Thanks, Peter Ent Adobe Systems On 9/9/14 8:47 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 2:26 PM, Peter Ent p...@adobe.com wrote: I tried that and it did not work (because the fill and stroke were not set), so I changed my itemRenderer to create the Rect at the point of use: protected function drawBar():void { if (this.width 0 this.height 0) { if (filledRect == null) filledRect = new Rect(); var solidColor:SolidColor = new SolidColor(); solidColor.color = fillColor; var solidStroke:SolidColorStroke = new SolidColorStroke(); solidStroke.color = fillColor; solidStroke.weight = 1; filledRect.fill = solidColor; filledRect.stroke = solidStroke; filledRect.drawRect(0,0,this.width,this.height); if (needsAdd) { addElement(filledRect); needsAdd = false; } } } That's the AS code, but the x-compiled JS code is identical (except for all of the Language.as things Falcon adds). I'm getting the same exception when the filledRect element is added. I stepped through using Firebug and all of the code is being executed, so the Rect's fill and stroke are now set and the width and height of the itemRenderer have non-zero values. So this should draw a filled rectangle. It's possible that I have not checked in something. Are you able to compile and run the examples\FlexJSTest_SVG without any issues? Perhaps you can check in your code so I can see what's happening? Thanks, Om Thanks, Om Peter Ent Adobe Systems On 9/9/14 4:53 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: Ah, I see what's happening. My code expects the drawXXX() [drawRect, drawPath, etc.] to be called before adding it as an element to the parent. Try switching this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); to this.filledRect = new org.apache.flex.core.graphics.Rect(); this.filledRect.drawRect(x,y,width,height); this.addElement(this.filledRect); I can change how this works, but I don't see an invalidation mechanism that I can use. How do you suggest we approach this? Thanks, Om On Tue, Sep 9, 2014 at 1:40 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 1:15 PM, Peter Ent p...@adobe.com wrote: I created a temporary item renderer to see how the x-compile would work. Here is the code in my temporary item renderer that creates the Rect: org.apache.flex.charts.supportClasses.TempBoxRenderer.prototype.set_ d a ta = function(value) { org.apache.flex.charts.supportClasses.TempBoxRenderer.base(this, 'set_data', value); if (this.filledRect == null) { this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); } }; this.addElement() is called which leads to the addedToParent function where the crash happens. I see that GraphicShape.js doesn't extends UIBase.js, which it probably should, given how the AS side works. Peter Are you sure you have the latest code? I remember
Re: [FlexJS] Drawing API
FYI according to the article I linked to here [1] it is possible to improve the rendering quality of vectors on the stage. I thought the article I linked to was a different article posted by Thimbault about drawWithQuality(). That means that documentation here [2] appears to be incorrect or out of date. Om, can you set the stage quality to high 16x16 or high 16x16 linear in your Flash example and check for changes? Example code is in the article [1]. You may need to set the player version to greater than 15. It may be possible to change the quality at runtime. [1] http://blog.kaourantin.net/?p=152 [2] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageQuality.html On Monday, September 8, 2014, jude flexcapaci...@gmail.com wrote: Way to go! Looks great. At one point browsers couldn't do graphics at all. One thing I want to note is that the rendering in the browsers is getting better than that of Flash. I've attached a screen shot. In the graphic (if it came through) Flash is on the left and HTML (Firefox Mac) on the right. In issue 1 the box is blurry. This may be a subpixel rendering issue but if you compare both in a big picture way the Flash version is slightly more blurry all around. This might be caused by the level of anti-alias the FP is using. In issue 2 the curve of the ellipsis has less fidelity than the HTML5 version. You can see this when you look at them side by side. You may not be able to tell but I've seen other examples and it is more noticeable. In fact, at one point, Tinic Uro, one of the FP engineers said they can do higher quality graphics if we do not care about performance (or we need quality over speed). He wrote about it here, http://blog.kaourantin.net/?p=152 --read this. This is for the drawWithQuality() method that was added at the time of the post but this does not give us the option to upgrade the rendering of the stage. The drawWithQuality method uses the parameters here, http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageQuality.html. These include, BEST, HIGH, HIGH_16X16, HIGH_16X16_LINEAR, HIGH_8X8, HIGH_8X8_LINEAR, LOW, and MEDIUM. In the desktop profile of Adobe AIR, quality can be set to StageQuality.BEST or StageQuality.HIGH (and the default value is StageQuality.HIGH). Attempting to set it to another value has no effect (and the property remains unchanged). I'd say we need to be able to set the stage quality to higher values if we can especially if the browsers are starting to provide higher quality rendering than Flash. Sorry to hijack this thread, this response is really a rally or FYI to be able to inform or convince the FP team that now is the time to enable higher rendering quality on the stage. On Mon, Sep 8, 2014 at 2:48 AM, OmPrakash Muppirala bigosma...@gmail.com javascript:_e(%7B%7D,'cvml','bigosma...@gmail.com'); wrote: FlexJS now supports a basic drawing API (Rect, Ellipse, Circle, Path, SolidColor, SolidColorStroke) Here are the AS3 [1] and JS [2] versions So far, the rendering fidelity between the Flash and SVG/HTML5 version is very very close. For sure, there are some pretty major things to be worked out, but generally so far, the results have been very encouraging. You can see a quick and dirty example here: Flash version: http://people.apache.org/~bigosmallm/flexjs/drawing/flash/ HTML5 http://people.apache.org/~bigosmallm/flexjs/drawing/flash/HTML5 version: http://people.apache.org/~bigosmallm/flexjs/drawing/html5/ HTML5 version has been tested to work fine on Chrome, Firefox, IE11, Android browser and iPad Safari. Next up, i will be working on the following items: Polygons, Linear gradients, Radial gradients, filters and drop shadows. These should bring us very close to our current FXG based drawing APIs. After that, I plan on programmatically recreating a few FXG based skins in FlexJS and see how we can apply it skins on UI components. Feedback welcome! [1] https://github.com/apache/flex-asjs/tree/develop/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics [2] https://github.com/apache/flex-asjs/tree/develop/frameworks/js/FlexJS/src/org/apache/flex/core/graphics
Re: [FlexJS] Path API bug (Was Re: [FlexJS] Drawing API)
More details emerged: On the JS side, I had created ChartDataGroup to hold the chart graphics. Since this was going to be SVG, I had ChartDataGroup create an SVG element. All of the itemRenderers I created simply added SVG graphics to this svg element. Switching to Om's core/graphics library caused a problem as it was trying to add an svg to an svg. Once I changed ChartDataGroup to use div, I began seeing the chart elements appearing. I have some other things to sort out, but it is looking good. Peter Ent Adobe Systems On 9/10/14 12:51 PM, Peter Ent p...@adobe.com wrote: I have the latest code; I didn't install it into my Apache FlexJS deployment. That last step always gets me. I did more research on Path and discovered that the presence of the Z is making the path closed (I thought a path string MUST end with a Z), so I believe I can proceed with converting the chart package over to core/graphics. Thanks, Om, for your help and patience. --peter On 9/10/14 10:45 AM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Sep 10, 2014 7:07 AM, Peter Ent p...@adobe.com wrote: I made a small modification to FlexJSTest_SVG: var path2:Path = new Path(); fill.color = 0x00FF00; fill.alpha = 0.5; // path2.fill = fill; stroke.color = 0xFF00FF; stroke.weight = 3; path2.stroke = stroke; path2.drawPath(250,500,M150 0 L75 200 L225 200 Z); this.addElement(path2); I removed the fill for the Path. This should have drawn 2 lines starting at (150,0) with a line to (75,200) and another to (225,200). Which it did. But it also closed the figure by drawing a third line from (225,200) back to (150,0). That is so weird. It did not do that when I tested it. Will try it out again in some time and see what's going on. For the LineChart, the first and last points cannot be closed. Thanks, Peter Ent Adobe Systems On 9/10/14 9:26 AM, Peter Ent p...@adobe.com wrote: I ran FlexJSTest_SVG without any issues from Flash Builder. I will look to see how each of these graphics elements are being used. Thanks, Peter Ent Adobe Systems On 9/9/14 8:47 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 2:26 PM, Peter Ent p...@adobe.com wrote: I tried that and it did not work (because the fill and stroke were not set), so I changed my itemRenderer to create the Rect at the point of use: protected function drawBar():void { if (this.width 0 this.height 0) { if (filledRect == null) filledRect = new Rect(); var solidColor:SolidColor = new SolidColor(); solidColor.color = fillColor; var solidStroke:SolidColorStroke = new SolidColorStroke(); solidStroke.color = fillColor; solidStroke.weight = 1; filledRect.fill = solidColor; filledRect.stroke = solidStroke; filledRect.drawRect(0,0,this.width,this.height); if (needsAdd) { addElement(filledRect); needsAdd = false; } } } That's the AS code, but the x-compiled JS code is identical (except for all of the Language.as things Falcon adds). I'm getting the same exception when the filledRect element is added. I stepped through using Firebug and all of the code is being executed, so the Rect's fill and stroke are now set and the width and height of the itemRenderer have non-zero values. So this should draw a filled rectangle. It's possible that I have not checked in something. Are you able to compile and run the examples\FlexJSTest_SVG without any issues? Perhaps you can check in your code so I can see what's happening? Thanks, Om Thanks, Om Peter Ent Adobe Systems On 9/9/14 4:53 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: Ah, I see what's happening. My code expects the drawXXX() [drawRect, drawPath, etc.] to be called before adding it as an element to the parent. Try switching this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); to this.filledRect = new org.apache.flex.core.graphics.Rect(); this.filledRect.drawRect(x,y,width,height); this.addElement(this.filledRect); I can change how this works, but I don't see an invalidation mechanism that I can use. How do you suggest we approach this? Thanks, Om On Tue, Sep 9, 2014 at 1:40 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 1:15 PM, Peter Ent p...@adobe.com wrote: I created a temporary item renderer to see how the x-compile would work. Here is the code in my temporary item renderer that creates the Rect: org.apache.flex.charts.supportClasses.TempBoxRenderer.prototype.set _ d a
Re: [FlexJS] Path API bug (Was Re: [FlexJS] Drawing API)
On Wed, Sep 10, 2014 at 1:21 PM, Peter Ent p...@adobe.com wrote: More details emerged: On the JS side, I had created ChartDataGroup to hold the chart graphics. Since this was going to be SVG, I had ChartDataGroup create an SVG element. All of the itemRenderers I created simply added SVG graphics to this svg element. Switching to Om's core/graphics library caused a problem as it was trying to add an svg to an svg. Once I changed ChartDataGroup to use div, I began seeing the chart elements appearing. Ah, thanks for figuring that out. I was breaking my head trying to repro and debug this issue on my side. Good to know! I have some other things to sort out, but it is looking good. Awesome! Looking forward to seeing some working apps. Thanks, Om Peter Ent Adobe Systems On 9/10/14 12:51 PM, Peter Ent p...@adobe.com wrote: I have the latest code; I didn't install it into my Apache FlexJS deployment. That last step always gets me. I did more research on Path and discovered that the presence of the Z is making the path closed (I thought a path string MUST end with a Z), so I believe I can proceed with converting the chart package over to core/graphics. Thanks, Om, for your help and patience. --peter On 9/10/14 10:45 AM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Sep 10, 2014 7:07 AM, Peter Ent p...@adobe.com wrote: I made a small modification to FlexJSTest_SVG: var path2:Path = new Path(); fill.color = 0x00FF00; fill.alpha = 0.5; // path2.fill = fill; stroke.color = 0xFF00FF; stroke.weight = 3; path2.stroke = stroke; path2.drawPath(250,500,M150 0 L75 200 L225 200 Z); this.addElement(path2); I removed the fill for the Path. This should have drawn 2 lines starting at (150,0) with a line to (75,200) and another to (225,200). Which it did. But it also closed the figure by drawing a third line from (225,200) back to (150,0). That is so weird. It did not do that when I tested it. Will try it out again in some time and see what's going on. For the LineChart, the first and last points cannot be closed. Thanks, Peter Ent Adobe Systems On 9/10/14 9:26 AM, Peter Ent p...@adobe.com wrote: I ran FlexJSTest_SVG without any issues from Flash Builder. I will look to see how each of these graphics elements are being used. Thanks, Peter Ent Adobe Systems On 9/9/14 8:47 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 2:26 PM, Peter Ent p...@adobe.com wrote: I tried that and it did not work (because the fill and stroke were not set), so I changed my itemRenderer to create the Rect at the point of use: protected function drawBar():void { if (this.width 0 this.height 0) { if (filledRect == null) filledRect = new Rect(); var solidColor:SolidColor = new SolidColor(); solidColor.color = fillColor; var solidStroke:SolidColorStroke = new SolidColorStroke(); solidStroke.color = fillColor; solidStroke.weight = 1; filledRect.fill = solidColor; filledRect.stroke = solidStroke; filledRect.drawRect(0,0,this.width,this.height); if (needsAdd) { addElement(filledRect); needsAdd = false; } } } That's the AS code, but the x-compiled JS code is identical (except for all of the Language.as things Falcon adds). I'm getting the same exception when the filledRect element is added. I stepped through using Firebug and all of the code is being executed, so the Rect's fill and stroke are now set and the width and height of the itemRenderer have non-zero values. So this should draw a filled rectangle. It's possible that I have not checked in something. Are you able to compile and run the examples\FlexJSTest_SVG without any issues? Perhaps you can check in your code so I can see what's happening? Thanks, Om Thanks, Om Peter Ent Adobe Systems On 9/9/14 4:53 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: Ah, I see what's happening. My code expects the drawXXX() [drawRect, drawPath, etc.] to be called before adding it as an element to the parent. Try switching this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); to this.filledRect = new org.apache.flex.core.graphics.Rect(); this.filledRect.drawRect(x,y,width,height); this.addElement(this.filledRect); I can change how this works, but I don't see an invalidation mechanism that I can use. How do you suggest we approach
Re: [FlexJS] Path API bug (Was Re: [FlexJS] Drawing API)
The one major change I had to make (aside from removing the Z from my LineChart path) was when the core/graphics element was added to its parent. I was creating the element (e.g., Rect), setting its properties, and then adding it as an element to the ChartDataGroup. This was fine on AS, but on the JS side I was getting an error in GraphicShape.js when it tried to get the SVG bounding box. I switched things around to add the graphic element to the ChartDataGroup immediately after creating it. Then everything worked. Peter Ent Adobe Systems On 9/10/14 4:27 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Wed, Sep 10, 2014 at 1:21 PM, Peter Ent p...@adobe.com wrote: More details emerged: On the JS side, I had created ChartDataGroup to hold the chart graphics. Since this was going to be SVG, I had ChartDataGroup create an SVG element. All of the itemRenderers I created simply added SVG graphics to this svg element. Switching to Om's core/graphics library caused a problem as it was trying to add an svg to an svg. Once I changed ChartDataGroup to use div, I began seeing the chart elements appearing. Ah, thanks for figuring that out. I was breaking my head trying to repro and debug this issue on my side. Good to know! I have some other things to sort out, but it is looking good. Awesome! Looking forward to seeing some working apps. Thanks, Om Peter Ent Adobe Systems On 9/10/14 12:51 PM, Peter Ent p...@adobe.com wrote: I have the latest code; I didn't install it into my Apache FlexJS deployment. That last step always gets me. I did more research on Path and discovered that the presence of the Z is making the path closed (I thought a path string MUST end with a Z), so I believe I can proceed with converting the chart package over to core/graphics. Thanks, Om, for your help and patience. --peter On 9/10/14 10:45 AM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Sep 10, 2014 7:07 AM, Peter Ent p...@adobe.com wrote: I made a small modification to FlexJSTest_SVG: var path2:Path = new Path(); fill.color = 0x00FF00; fill.alpha = 0.5; // path2.fill = fill; stroke.color = 0xFF00FF; stroke.weight = 3; path2.stroke = stroke; path2.drawPath(250,500,M150 0 L75 200 L225 200 Z); this.addElement(path2); I removed the fill for the Path. This should have drawn 2 lines starting at (150,0) with a line to (75,200) and another to (225,200). Which it did. But it also closed the figure by drawing a third line from (225,200) back to (150,0). That is so weird. It did not do that when I tested it. Will try it out again in some time and see what's going on. For the LineChart, the first and last points cannot be closed. Thanks, Peter Ent Adobe Systems On 9/10/14 9:26 AM, Peter Ent p...@adobe.com wrote: I ran FlexJSTest_SVG without any issues from Flash Builder. I will look to see how each of these graphics elements are being used. Thanks, Peter Ent Adobe Systems On 9/9/14 8:47 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 2:26 PM, Peter Ent p...@adobe.com wrote: I tried that and it did not work (because the fill and stroke were not set), so I changed my itemRenderer to create the Rect at the point of use: protected function drawBar():void { if (this.width 0 this.height 0) { if (filledRect == null) filledRect = new Rect(); var solidColor:SolidColor = new SolidColor(); solidColor.color = fillColor; var solidStroke:SolidColorStroke = new SolidColorStroke(); solidStroke.color = fillColor; solidStroke.weight = 1; filledRect.fill = solidColor; filledRect.stroke = solidStroke; filledRect.drawRect(0,0,this.width,this.height); if (needsAdd) { addElement(filledRect); needsAdd = false; } } } That's the AS code, but the x-compiled JS code is identical (except for all of the Language.as things Falcon adds). I'm getting the same exception when the filledRect element is added. I stepped through using Firebug and all of the code is being executed, so the Rect's fill and stroke are now set and the width and height of the itemRenderer have non-zero values. So this should draw a filled rectangle. It's possible that I have not checked in something. Are you able to compile and run the examples\FlexJSTest_SVG without any issues? Perhaps you can check in your code so I can see what's happening? Thanks, Om Thanks, Om Peter Ent Adobe Systems On 9/9/14 4:53 PM,
Re: [FlexJS] Path API bug (Was Re: [FlexJS] Drawing API)
On Wed, Sep 10, 2014 at 7:45 AM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Sep 10, 2014 7:07 AM, Peter Ent p...@adobe.com wrote: I made a small modification to FlexJSTest_SVG: var path2:Path = new Path(); fill.color = 0x00FF00; fill.alpha = 0.5; // path2.fill = fill; stroke.color = 0xFF00FF; stroke.weight = 3; path2.stroke = stroke; path2.drawPath(250,500,M150 0 L75 200 L225 200 Z); this.addElement(path2); I removed the fill for the Path. This should have drawn 2 lines starting at (150,0) with a line to (75,200) and another to (225,200). Which it did. But it also closed the figure by drawing a third line from (225,200) back to (150,0). That is so weird. It did not do that when I tested it. Will try it out again in some time and see what's going on. You are right. Adding a Z at the end does indeed close the line loop. Without the Z should work as you expect. Sorry for the confusion. Thanks, Om For the LineChart, the first and last points cannot be closed. Thanks, Peter Ent Adobe Systems On 9/10/14 9:26 AM, Peter Ent p...@adobe.com wrote: I ran FlexJSTest_SVG without any issues from Flash Builder. I will look to see how each of these graphics elements are being used. Thanks, Peter Ent Adobe Systems On 9/9/14 8:47 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 2:26 PM, Peter Ent p...@adobe.com wrote: I tried that and it did not work (because the fill and stroke were not set), so I changed my itemRenderer to create the Rect at the point of use: protected function drawBar():void { if (this.width 0 this.height 0) { if (filledRect == null) filledRect = new Rect(); var solidColor:SolidColor = new SolidColor(); solidColor.color = fillColor; var solidStroke:SolidColorStroke = new SolidColorStroke(); solidStroke.color = fillColor; solidStroke.weight = 1; filledRect.fill = solidColor; filledRect.stroke = solidStroke; filledRect.drawRect(0,0,this.width,this.height); if (needsAdd) { addElement(filledRect); needsAdd = false; } } } That's the AS code, but the x-compiled JS code is identical (except for all of the Language.as things Falcon adds). I'm getting the same exception when the filledRect element is added. I stepped through using Firebug and all of the code is being executed, so the Rect's fill and stroke are now set and the width and height of the itemRenderer have non-zero values. So this should draw a filled rectangle. It's possible that I have not checked in something. Are you able to compile and run the examples\FlexJSTest_SVG without any issues? Perhaps you can check in your code so I can see what's happening? Thanks, Om Thanks, Om Peter Ent Adobe Systems On 9/9/14 4:53 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: Ah, I see what's happening. My code expects the drawXXX() [drawRect, drawPath, etc.] to be called before adding it as an element to the parent. Try switching this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); to this.filledRect = new org.apache.flex.core.graphics.Rect(); this.filledRect.drawRect(x,y,width,height); this.addElement(this.filledRect); I can change how this works, but I don't see an invalidation mechanism that I can use. How do you suggest we approach this? Thanks, Om On Tue, Sep 9, 2014 at 1:40 PM, OmPrakash Muppirala bigosma...@gmail.com wrote: On Tue, Sep 9, 2014 at 1:15 PM, Peter Ent p...@adobe.com wrote: I created a temporary item renderer to see how the x-compile would work. Here is the code in my temporary item renderer that creates the Rect: org.apache.flex.charts.supportClasses.TempBoxRenderer.prototype.set_d a ta = function(value) { org.apache.flex.charts.supportClasses.TempBoxRenderer.base(this, 'set_data', value); if (this.filledRect == null) { this.filledRect = new org.apache.flex.core.graphics.Rect(); this.addElement(this.filledRect); } }; this.addElement() is called which leads to the addedToParent function where the crash happens. I see that GraphicShape.js doesn't extends UIBase.js, which it probably should, given how the AS side works. Peter Are you sure you have the latest code? I remember fixing this exact issue a few
Re: [FlexJS] Drawing API
On Wed, Sep 10, 2014 at 12:54 PM, jude flexcapaci...@gmail.com wrote: FYI according to the article I linked to here [1] it is possible to improve the rendering quality of vectors on the stage. I thought the article I linked to was a different article posted by Thimbault about drawWithQuality(). That means that documentation here [2] appears to be incorrect or out of date. Om, can you set the stage quality to high 16x16 or high 16x16 linear in your Flash example and check for changes? Example code is in the article [1]. You may need to set the player version to greater than 15. It may be possible to change the quality at runtime. I made the following changes to make the flash side of things more sharper: * All strokes have capsStyle = SQUARE and jointStyle = MITER * Set stage.quality = HIGH_16X16_LINEAR in the top level application. Take a look now: Flash: http://people.apache.org/~bigosmallm/flexjs/drawing/flash/ HTML5: http://people.apache.org/~bigosmallm/flexjs/drawing/html5/ Thanks, Om [1] http://blog.kaourantin.net/?p=152 [2] http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageQuality.html On Monday, September 8, 2014, jude flexcapaci...@gmail.com wrote: Way to go! Looks great. At one point browsers couldn't do graphics at all. One thing I want to note is that the rendering in the browsers is getting better than that of Flash. I've attached a screen shot. In the graphic (if it came through) Flash is on the left and HTML (Firefox Mac) on the right. In issue 1 the box is blurry. This may be a subpixel rendering issue but if you compare both in a big picture way the Flash version is slightly more blurry all around. This might be caused by the level of anti-alias the FP is using. In issue 2 the curve of the ellipsis has less fidelity than the HTML5 version. You can see this when you look at them side by side. You may not be able to tell but I've seen other examples and it is more noticeable. In fact, at one point, Tinic Uro, one of the FP engineers said they can do higher quality graphics if we do not care about performance (or we need quality over speed). He wrote about it here, http://blog.kaourantin.net/?p=152 --read this. This is for the drawWithQuality() method that was added at the time of the post but this does not give us the option to upgrade the rendering of the stage. The drawWithQuality method uses the parameters here, http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/StageQuality.html. These include, BEST, HIGH, HIGH_16X16, HIGH_16X16_LINEAR, HIGH_8X8, HIGH_8X8_LINEAR, LOW, and MEDIUM. In the desktop profile of Adobe AIR, quality can be set to StageQuality.BEST or StageQuality.HIGH (and the default value is StageQuality.HIGH). Attempting to set it to another value has no effect (and the property remains unchanged). I'd say we need to be able to set the stage quality to higher values if we can especially if the browsers are starting to provide higher quality rendering than Flash. Sorry to hijack this thread, this response is really a rally or FYI to be able to inform or convince the FP team that now is the time to enable higher rendering quality on the stage. On Mon, Sep 8, 2014 at 2:48 AM, OmPrakash Muppirala bigosma...@gmail.com wrote: FlexJS now supports a basic drawing API (Rect, Ellipse, Circle, Path, SolidColor, SolidColorStroke) Here are the AS3 [1] and JS [2] versions So far, the rendering fidelity between the Flash and SVG/HTML5 version is very very close. For sure, there are some pretty major things to be worked out, but generally so far, the results have been very encouraging. You can see a quick and dirty example here: Flash version: http://people.apache.org/~bigosmallm/flexjs/drawing/flash/ HTML5 http://people.apache.org/~bigosmallm/flexjs/drawing/flash/HTML5 version: http://people.apache.org/~bigosmallm/flexjs/drawing/html5/ HTML5 version has been tested to work fine on Chrome, Firefox, IE11, Android browser and iPad Safari. Next up, i will be working on the following items: Polygons, Linear gradients, Radial gradients, filters and drop shadows. These should bring us very close to our current FXG based drawing APIs. After that, I plan on programmatically recreating a few FXG based skins in FlexJS and see how we can apply it skins on UI components. Feedback welcome! [1] https://github.com/apache/flex-asjs/tree/develop/frameworks/as/projects/FlexJSUI/src/org/apache/flex/core/graphics [2] https://github.com/apache/flex-asjs/tree/develop/frameworks/js/FlexJS/src/org/apache/flex/core/graphics
Re: Build failed in Jenkins: MD5Checker #91
Hi, Why did this fail? the MD5s look the same to me. Thanks, Justin On 11 Sep 2014, at 11:30 am, flex.ci.bui...@gmail.com wrote: See http://apacheflexbuild.cloudapp.net:8080/job/MD5Checker/91/ -- Started by timer Building remotely on flex_sdk_slave2 in workspace http://apacheflexbuild.cloudapp.net:8080/job/MD5Checker/ws/ No JDK named ‘(Default)’ found Fetching changes from the remote Git repository Fetching upstream changes from https://git-wip-us.apache.org/repos/asf/flex-utilities.git Checking out Revision df9ae1bd0a7f05f79ba5c59722ae6034216c535f (origin/develop) No JDK named ‘(Default)’ found [MD5Checker] $ cmd.exe /C 'c:\Jenkins\tools\hudson.tasks.Ant_AntInstallation\c_apache-ant-1.9.3\bin\ant.bat -file build.xml -Dplayerglobal.version=11.7 main exit %%ERRORLEVEL%%' Buildfile: http://apacheflexbuild.cloudapp.net:8080/job/MD5Checker/ws/MD5Checker/build.xml load-task: build: [mxmlc] Loading configuration file C:\Jenkins\workspace\flex-sdk\frameworks\air-config.xml [mxmlc] C:\Jenkins\workspace\MD5Checker\MD5Checker\src\MD5Checker.swf (1952471 bytes) main: [exec] Result: -1 [echo] Old Node: [echo] versionP id=flash.sdk.version.15.0 version=15.0 displayVersion=15 [echo] server id=flash.sdk.server.15.0http://download.macromedia.com/server [echo] folder id=flash.sdk.folder.15.0get/flashplayer/updaters/15//folder [echo] path id=flash.sdk.path.15.0http://download.macromedia.com/get/flashplayer/updaters/15//path [echo] file id=flash.sdk.file.15.0playerglobal15_0.swc/file [echo] md5 id=flash.sdk.md5.15.0051a72a4be1e02894dca0c2c01d8d8e2/md5 [echo] swfversion id=flash.sdk.swfversion.15.026/swfversion [echo] /versionP [echo] New Node: [echo] versionP id=flash.sdk.version.15.0 version=15.0 displayVersion=15 cacheID=Thu, 28 Aug 2014 09:25:39 GMT [echo] server id=flash.sdk.server.15.0http://download.macromedia.com/server [echo] folder id=flash.sdk.folder.15.0get/flashplayer/updaters/15//folder [echo] path id=flash.sdk.path.15.0http://download.macromedia.com/get/flashplayer/updaters/15//path [echo] file id=flash.sdk.file.15.0playerglobal15_0.swc/file [echo] md5 id=flash.sdk.md5.15.0051a72a4be1e02894dca0c2c01d8d8e2/md5 [echo] swfversion id=flash.sdk.swfversion.15.026/swfversion [echo] /versionP [echo] Old Node: [echo] versionP id=air.sdk.version.mac.15.0 version=15.0 displayVersion=15 [echo] server id=air.sdk.server.mac.15.0http://airdownload.adobe.com/server [echo] folder id=air.sdk.folder.mac.15.0air/mac/download/15.0//folder [echo] path id=air.sdk.path.mac.15.0http://airdownload.adobe.com/air/mac/download/15.0//path [echo] file id=air.sdk.file.mac.15.0AdobeAIRSDK.tbz2/file [echo] md5 id=air.sdk.md5.mac.15.0c380e51cb67585819344b37434169bb6/md5 [echo] /versionP [echo] New Node: [echo] versionP id=air.sdk.version.mac.15.0 version=15.0 displayVersion=15 cacheID=Fri, 29 Aug 2014 06:38:24 GMT [echo] server id=air.sdk.server.mac.15.0http://airdownload.adobe.com/server [echo] folder id=air.sdk.folder.mac.15.0air/mac/download/15.0//folder [echo] path id=air.sdk.path.mac.15.0http://airdownload.adobe.com/air/mac/download/15.0//path [echo] file id=air.sdk.file.mac.15.0AdobeAIRSDK.tbz2/file [echo] md5 id=air.sdk.md5.mac.15.0c380e51cb67585819344b37434169bb6/md5 [echo] /versionP BUILD FAILED http://apacheflexbuild.cloudapp.net:8080/job/MD5Checker/ws/MD5Checker/build.xml:103: MD5's changed! Total time: 4 minutes 26 seconds Build step 'Invoke Ant' marked build as failure No JDK named ‘(Default)’ found
Tour De Flex minor issues
Hi When using 4.13 release the PostCodeValidator the spark alert box gives as error and with the SDK locale example the new locales don't seem to be included. Running these as standalone projects works fine. The ant task to the postcode example is very simple: mxmlc file=${basedir}/src/@{example}.mxml output=${basedir}/src/@{example}.swf fork=true failonerror=true load-config filename=${FLEX_HOME}/frameworks/flex-config.xml/ /mxmlc The locale example: mxmlc file=${basedir}/src/@{example}.mxml output=${basedir}/src/@{example}.swf fork=true failonerror=true localeen_US/locale localeen_AU/locale localeen_GB/locale localeen_CA/locale localeel_GR/locale localede_CH/locale localept_PT/locale load-config filename=${FLEX_HOME}/frameworks/flex-config.xml/ /mxmlc Perhaps we have an flex-config.xml issue? Anyone have an idea to why these may not work? Or do we have an issue with the 4.13 release? Thanks, Justin
Re: Build failed in Jenkins: MD5Checker #91
Cuz it wants to record the cacheID so it doesn't have to keep downloading it. I'll update it. On 9/10/14 6:34 PM, Justin Mclean jus...@classsoftware.com wrote: Hi, Why did this fail? the MD5s look the same to me. Thanks, Justin On 11 Sep 2014, at 11:30 am, flex.ci.bui...@gmail.com wrote: See http://apacheflexbuild.cloudapp.net:8080/job/MD5Checker/91/ -- Started by timer Building remotely on flex_sdk_slave2 in workspace http://apacheflexbuild.cloudapp.net:8080/job/MD5Checker/ws/ No JDK named Œ(Default)¹ found Fetching changes from the remote Git repository Fetching upstream changes from https://git-wip-us.apache.org/repos/asf/flex-utilities.git Checking out Revision df9ae1bd0a7f05f79ba5c59722ae6034216c535f (origin/develop) No JDK named Œ(Default)¹ found [MD5Checker] $ cmd.exe /C 'c:\Jenkins\tools\hudson.tasks.Ant_AntInstallation\c_apache-ant-1.9.3\bi n\ant.bat -file build.xml -Dplayerglobal.version=11.7 main exit %%ERRORLEVEL%%' Buildfile: http://apacheflexbuild.cloudapp.net:8080/job/MD5Checker/ws/MD5Checker/bu ild.xml load-task: build: [mxmlc] Loading configuration file C:\Jenkins\workspace\flex-sdk\frameworks\air-config.xml [mxmlc] C:\Jenkins\workspace\MD5Checker\MD5Checker\src\MD5Checker.swf (1952471 bytes) main: [exec] Result: -1 [echo] Old Node: [echo] versionP id=flash.sdk.version.15.0 version=15.0 displayVersion=15 [echo] server id=flash.sdk.server.15.0http://download.macromedia.com/server [echo] folder id=flash.sdk.folder.15.0get/flashplayer/updaters/15//folder [echo] path id=flash.sdk.path.15.0http://download.macromedia.com/get/flashplayer/u pdaters/15//path [echo] file id=flash.sdk.file.15.0playerglobal15_0.swc/file [echo] md5 id=flash.sdk.md5.15.0051a72a4be1e02894dca0c2c01d8d8e2/md5 [echo] swfversion id=flash.sdk.swfversion.15.026/swfversion [echo] /versionP [echo] New Node: [echo] versionP id=flash.sdk.version.15.0 version=15.0 displayVersion=15 cacheID=Thu, 28 Aug 2014 09:25:39 GMT [echo] server id=flash.sdk.server.15.0http://download.macromedia.com/server [echo] folder id=flash.sdk.folder.15.0get/flashplayer/updaters/15//folder [echo] path id=flash.sdk.path.15.0http://download.macromedia.com/get/flashplayer/u pdaters/15//path [echo] file id=flash.sdk.file.15.0playerglobal15_0.swc/file [echo] md5 id=flash.sdk.md5.15.0051a72a4be1e02894dca0c2c01d8d8e2/md5 [echo] swfversion id=flash.sdk.swfversion.15.026/swfversion [echo] /versionP [echo] Old Node: [echo] versionP id=air.sdk.version.mac.15.0 version=15.0 displayVersion=15 [echo] server id=air.sdk.server.mac.15.0http://airdownload.adobe.com/server [echo] folder id=air.sdk.folder.mac.15.0air/mac/download/15.0//folder [echo] path id=air.sdk.path.mac.15.0http://airdownload.adobe.com/air/mac/download/ 15.0//path [echo] file id=air.sdk.file.mac.15.0AdobeAIRSDK.tbz2/file [echo] md5 id=air.sdk.md5.mac.15.0c380e51cb67585819344b37434169bb6/md5 [echo] /versionP [echo] New Node: [echo] versionP id=air.sdk.version.mac.15.0 version=15.0 displayVersion=15 cacheID=Fri, 29 Aug 2014 06:38:24 GMT [echo] server id=air.sdk.server.mac.15.0http://airdownload.adobe.com/server [echo] folder id=air.sdk.folder.mac.15.0air/mac/download/15.0//folder [echo] path id=air.sdk.path.mac.15.0http://airdownload.adobe.com/air/mac/download/ 15.0//path [echo] file id=air.sdk.file.mac.15.0AdobeAIRSDK.tbz2/file [echo] md5 id=air.sdk.md5.mac.15.0c380e51cb67585819344b37434169bb6/md5 [echo] /versionP BUILD FAILED http://apacheflexbuild.cloudapp.net:8080/job/MD5Checker/ws/MD5Checker/bu ild.xml:103: MD5's changed! Total time: 4 minutes 26 seconds Build step 'Invoke Ant' marked build as failure No JDK named Œ(Default)¹ found
Re: Tour De Flex minor issues
On 9/10/14 7:47 PM, Justin Mclean jus...@classsoftware.com wrote: Hi When using 4.13 release the PostCodeValidator the spark alert box gives as error Are you saying it works with other SDK versions? I was able to get an error about the Alert skin missing. That's usually a styles/moduleFactory issue. I noticed that Spark Alert is not leveraging the moduleFactory parameter in PopUpManager.addPopUp. Not sure if that's the answer. and with the SDK locale example the new locales don't seem to be included. Running these as standalone projects works fine. I'm not sure what error you are getting or how to reproduce it. -Alex