Re: SWF Graphics api emulation -WIP

2020-01-28 Thread Alex Harui
Mainly for the record, the only other implementation that came to mind (and I 
rejected) was to track marked things.  Something like:

/** add a child */
public function addElement(element:IUIBase);

/** add an internal child */
public function addInternalElement(element:IUIBase, elementType:String)
{
internalElements.push({ element: element, elementType: elementType);
  addElement(element);
}
private var internalElements:Array= [];

/** get number of children */
public function get numElements():int
{
 return super.numElements - internalElements.length;
}

It would duplicate every IParent API: getElementAt, getInternalElementAt, for 
example.  But what I didn't like was that getElementAt would have to check the 
internalElements and not count elements in that array which would be slow.

There are variants to that strategy where you track childElements and consider 
everything else internal, but I still think that requires filtering on the 
calls most used by application developers.  The current implementation also 
duplicates the APIs, but because the application developer's children are all 
placed on an internal container, there isn't any filtering.

Of course, I could be wrong...
-Alex


On 1/28/20, 8:40 PM, "Greg Dove"  wrote:

@Alex - yeah, I was just curious if there could be a sneaky way to keep it
to the single level. If not, then so be it.
That was only for the UIGraphicsBase class, which I was pretty much using
like 'flash.display.Shape' for testing.

Anyhow, the Graphics emulation can be used with anything that implements
this:


https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs%2Fblob%2Fdevelop%2Fframeworks%2Fprojects%2FGraphics%2Fsrc%2Fmain%2Froyale%2Forg%2Fapache%2Froyale%2Fdisplay%2FIGraphicsTarget.as&data=02%7C01%7Caharui%40adobe.com%7C8b0de029d5d44c35209908d7a4755cc6%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637158696282111863&sdata=ruaKX6uEWmIPPwpxjKcoCVF1u3CLX%2FF8l8TD2YOJfnY%3D&reserved=0


Just thinking about it, that should be SVGSVGElement and not simply
SVGElement for the JS version on line 36. I will change that tomorrow.

So if a component view implemented its own version of the above interface
and supplies the SVG element as render target, then it doesn't actually
care where that internal svg is (child 0 or otherwise) - that is the view
component's problem.
I did also consider a future enhancement where the IGraphicsTarget instance
could have a 'graphicsBoundsChange' event dispatched (from itself) on a
frame update if the graphics bounds changed. This could be toggled on the
Graphics instance itself so it only happened if needed. But that is not
done at this point and also that could be added only if there is demand
for it, I think.



On Wed, Jan 29, 2020 at 5:37 AM Alex Harui  wrote:

>
>
> On 1/28/20, 1:01 AM, "Carlos Rovira"  wrote:
>
> Hi again :),
>
> I still didn't see the code, but was imagining how I'd like to use 
this
> feature.
>
> Some thoughts:
>
> 1.- Could be possible to have it as a bead for UIBase components a
> side of
> the UIGraphicBase that could still be convenient for some cases?
>
> Disclaimer:  I haven't written the code or looked at it, so this is just a
> high-level opinion:  Regarding a bead for UIBase, I think it would depend
> on how the "child 0" problem gets solved.   My reason for posting is to
> remind folks that in theory, the Basic Containers already support an
> internal container.  I haven't found a lightweight way of enabling 
internal
> containers, mainly because I didn't want to mark the children and compute
> or track the set, but also because since it is currently used for "chrome"
> (Panel TitleBar), it is relatively simple to enable it the way it is.
>
> Also, MXRoyale's UIComponent is essentially as heavy as a Basic Container,
> and Spark Skinning emulation supports a separate child Skin.  Other
> component sets could just start out being heavier if they want to quickly
> enable this new library via a bead.
>
> Of course, I could be wrong...
> -Alex
>
>
>




Jenkins build is back to normal : royale-asjs #651

2020-01-28 Thread apacheroyaleci
See 




Re: SWF Graphics api emulation -WIP

2020-01-28 Thread Greg Dove
@Alex - yeah, I was just curious if there could be a sneaky way to keep it
to the single level. If not, then so be it.
That was only for the UIGraphicsBase class, which I was pretty much using
like 'flash.display.Shape' for testing.

Anyhow, the Graphics emulation can be used with anything that implements
this:

https://github.com/apache/royale-asjs/blob/develop/frameworks/projects/Graphics/src/main/royale/org/apache/royale/display/IGraphicsTarget.as


Just thinking about it, that should be SVGSVGElement and not simply
SVGElement for the JS version on line 36. I will change that tomorrow.

So if a component view implemented its own version of the above interface
and supplies the SVG element as render target, then it doesn't actually
care where that internal svg is (child 0 or otherwise) - that is the view
component's problem.
I did also consider a future enhancement where the IGraphicsTarget instance
could have a 'graphicsBoundsChange' event dispatched (from itself) on a
frame update if the graphics bounds changed. This could be toggled on the
Graphics instance itself so it only happened if needed. But that is not
done at this point and also that could be added only if there is demand
for it, I think.



On Wed, Jan 29, 2020 at 5:37 AM Alex Harui  wrote:

>
>
> On 1/28/20, 1:01 AM, "Carlos Rovira"  wrote:
>
> Hi again :),
>
> I still didn't see the code, but was imagining how I'd like to use this
> feature.
>
> Some thoughts:
>
> 1.- Could be possible to have it as a bead for UIBase components a
> side of
> the UIGraphicBase that could still be convenient for some cases?
>
> Disclaimer:  I haven't written the code or looked at it, so this is just a
> high-level opinion:  Regarding a bead for UIBase, I think it would depend
> on how the "child 0" problem gets solved.   My reason for posting is to
> remind folks that in theory, the Basic Containers already support an
> internal container.  I haven't found a lightweight way of enabling internal
> containers, mainly because I didn't want to mark the children and compute
> or track the set, but also because since it is currently used for "chrome"
> (Panel TitleBar), it is relatively simple to enable it the way it is.
>
> Also, MXRoyale's UIComponent is essentially as heavy as a Basic Container,
> and Spark Skinning emulation supports a separate child Skin.  Other
> component sets could just start out being heavier if they want to quickly
> enable this new library via a bead.
>
> Of course, I could be wrong...
> -Alex
>
>
>


Re: SWF Graphics api emulation -WIP

2020-01-28 Thread Greg Dove
Hi Carlos,

What I added is intended mainly useful for emulation purposes, either for
easier migration of code that uses that approach in Flex, or the
convenience of a familiar api in certain circumstances. It provides a close
approximation of (most of) the swf drawing api, but it may only be
transitional support during migration for some people. It is intended for
use in code and not at all intended for markup.

It sounds like you want more declarative svg/fxg or degrafa-ish/mxml
graphics support.

There seems to be support already for svg, when I look at support between
Basic and Graphics, but I did not try to use those classes yet myself.
mxml graphics (and degrafa) was built on top of the flash drawing api. I
guess this emulation could be used to support that type of declarative
graphics in the same way. But it probably would be more performant and
compact to go direct to svg for a lot of that stuff, and maybe we already
have some classes for that I think, looking in the other parts of the Basic
and Graphics library (but, like I said, I did not use these yet).
As an example: for the original swf graphics approach, to change the fill
color on one of a set of rendered shapes in a declarative graphics tree
represented by a single display object requires clear() and then re-render
of all unchanged and changed definitions in the graphics data - in the
emulation code it would empty the svg that is used for 'rendering' and then
recreate it all with the small change. For 'direct-to-svg', it may only
need to change the fill color on a corresponding svg native declarative
shape or path, which then leaves the rest of the work up to the browser.


On Tue, Jan 28, 2020 at 10:00 PM Carlos Rovira 
wrote:

> Hi again :),
>
> I still didn't see the code, but was imagining how I'd like to use this
> feature.
>
> Some thoughts:
>
> 1.- Could be possible to have it as a bead for UIBase components a side of
> the UIGraphicBase that could still be convenient for some cases?
>
> 
> 
> <-- This could be a custom bead with the graphics
> code and the drawings can be created in a element created by a base bead
> (Maybe IGraphicsBead? and a GraphicsBead)
>
> 
>
> 2.- Could be possible even declare graphics instructions in MXML?
> Inside a js:GraphicsBead tag add things like:
>
> 
> 
> 
>
> (don't know right now if this could not be optimal, or maybe will require
> compiler optimization to remove all the extra code and translate to simple
> SWF/ SVG instructions)
>
> I thinking looking at the code of your example will help to imagine how all
> this could be modeled/applied
>
> thanks
>
> Carlos
>
>
>
>
> El mar., 28 ene. 2020 a las 9:44, Carlos Rovira ( >)
> escribió:
>
> > Hi Greg,
> >
> > very cool! :)
> > Hope to play with it very soon :)
> >
> > Do you plan to add your "graphics browser example" to examples?
> >
> > Thanks for working on this! :)
> >
> > Carlos
> >
> > El mar., 28 ene. 2020 a las 3:28, Greg Dove ()
> > escribió:
> >
> >> FYI, I just pushed the WIP on that.
> >>
> >> to use it in code, there is a UIGraphicsBase target.
> >> I'm still not happy with that, so it could change over time. At the
> moment
> >> the svg 'child' in javascript that is used as the 'rendered output'
> >> participates in the child element count for that class. Ideally it
> should
> >> not do that and should always be behind the children. Obviously there
> are
> >> different ways to make that work including adding a separate 'children'
> >> div
> >> container, but I wanted to see if there was a way to keep the native
> >> implementation as siblings but avoid the '0' indexed svg element from
> >> showing up in the normal api for child elements.
> >>
> >> Anyhow, a simple way to start working with this is as follows:
> >>
> >> Assuming you have the following in mxml;
> >>
> >> 
> >>
> >> then you could do the following somewhere inside a script block:
> >> (assuming: import org.apache.royale.display.Graphics; )
> >>
> >> var graphics:Graphics = Graphics.getInstanceFor(jsGraphicsTarget);
> >> {now use 'graphics' similar to how you would for swf here}
> >>
> >>
> >> On Tue, Jan 21, 2020 at 8:18 AM Greg Dove  wrote:
> >>
> >> > Thanks for checking that, Carlos. I think it should be quick to add
> this
> >> > to Royale after I am back from vacation.
> >> >
> >> >
> >> >
> >> > On Mon, 20 Jan 2020, 01:21 Carlos Rovira, 
> >> wrote:
> >> >
> >> >> Hi Greg,
> >> >>
> >> >> awesome work! Hope you can get ANT working soon. Although I think is
> >> not
> >> >> required and you can get to that at a later time when you have the
> >> time. I
> >> >> think the most important thing is not break maven/ant builds and not
> >> >> affect
> >> >> current code. Saving that, I think is safe to commit the work, and
> >> then go
> >> >> incremental from that point. I use to work in that way. If something
> >> can
> >> >> break build or running code, so it can be ensure integrity in one
> >> commit,
> >> >> then is better to work in a branch and merge

Build failed in Jenkins: royale-asjs #650

2020-01-28 Thread apacheroyaleci
See 


Changes:


--
[...truncated 1.17 MB...]
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [readline]:23: WARNING - accessing name require in externs 
has no effect. Perhaps you forgot to add a var keyword?
 [java] var stream = require('stream');
 [java]  ^^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [readline]:84: WARNING - name module is not defined in the 
externs.
 [java] module.exports = readline;
 [java] ^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [repl]:23: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var events = require('events');
 [java]  ^^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [repl]:24: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var stream = require('stream');
 [java]  ^^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [repl]:48: WARNING - name module is not defined in the 
externs.
 [java] module.exports = repl;
 [java] ^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [stream]:23: WARNING - accessing name require in externs 
has no effect. Perhaps you forgot to add a var keyword?
 [java] var events = require('events');
 [java]  ^^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [stream]:254: WARNING - name module is not defined in the 
externs.
 [java] module.exports = stream;
 [java] ^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [string_decoder]:52: WARNING - name module is not defined 
in the externs.
 [java] module.exports = StringDecoder;
 [java] ^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:23: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var crypto = require('crypto');
 [java]  ^^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:24: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var events = require('events');
 [java]  ^^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:25: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var net = require('net');
 [java]   ^^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:26: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var stream = require('stream');
 [java]  ^^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tls]:148: WARNING - name module is not defined in the 
externs.
 [java] module.exports = tls;
 [java] ^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tty]:23: WARNING - accessing name require in externs has 
no effect. Perhaps you forgot to add a var keyword?
 [java] var net = require('net');
 [java]   ^^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [tty]:75: WARNING - name module is not defined in the 
externs.
 [java] module.exports = tty;
 [java] ^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [url]:57: WARNING - name module is not defined in the 
externs.
 [java] module.exports = url;
 [java] ^^
 [java] 
 [java] Jan 29, 2020 3:21:57 AM 
com.google.javascript.jscomp.LoggerErrorManager println
 [java] WARNING: [util]:112: WARNING - name module is not defined in the 
externs.
 [java] module.exports = util;
 [java] ^^^

Build failed in Jenkins: royale-asjs #649

2020-01-28 Thread apacheroyaleci
See 


Changes:

[carlosrovira] todomvc-jewel-example: near completion

[carlosrovira] todomvc-jewel-example: left from last commit


--
[...truncated 1.81 MB...]
compile:
 [echo] Compiling libs/JewelTheme.swc
 [echo] ROYALE_HOME: 

 [echo] ROYALE_SWF_COMPILER_HOME: 

 [echo] ROYALE_COMPILER_HOME: 

 [java] args:
 [java] 
+royalelib=
 [java] +playerglobal.version=11.7
 [java] +env.AIR_HOME=C:\adobe\air\4.0\AdobeAIRSDK
 [java] -compiler.strict-xml=true
 [java] -compiler.targets=SWF,JSRoyale
 [java] -metadata.date=01/28/20 23:36 +
 [java] -metadata.dateFormat=MM/dd/yy HH:mm Z
 [java] -swf-debugfile-alias=/org/apache/royale/0.9.7
 [java] 
-output=
 [java] 
-load-config=
 [java] 
-js-load-config=
 [java] 
-js-load-config+=
 [java] target:SWF
 [java] target:JSRoyale
 [java] COMPC
 [java] Loading configuration: 

 [java] 
 [java] 50357 bytes written to 
C:\jenkins\workspace\royale-asjs\frameworks\themes\JewelTheme\target\JewelTheme.swc
 in 1.081 seconds
 [java] COMPCJSCRoyale
 [java] 3.9776425 seconds
 [java] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Xms384m -Xmx2g

compile-js:

copy-swc:
 [copy] Copying 1 file to 


check-for-tests:

test:

main:

Icons:
 [echo] swc-date is 01/28/20 23:36 +

clean:
 [echo] swc-date is 01/28/20 23:36 +

check-for-tests:

clean-tests:

check-compiler-home:

check-transpiler-home:

check-compiler:

compile:
 [echo] Compiling libs/Icons.swc
 [echo] ROYALE_HOME: 

 [echo] ROYALE_SWF_COMPILER_HOME: 

 [echo] ROYALE_COMPILER_HOME: 

 [java] args:
 [java] 
+royalelib=
 [java] +playerglobal.version=11.7
 [java] +env.AIR_HOME=C:\adobe\air\4.0\AdobeAIRSDK
 [java] -compiler.strict-xml=true
 [java] -compiler.targets=SWF,JSRoyale
 [java] -metadata.date=01/28/20 23:36 +
 [java] -metadata.dateFormat=MM/dd/yy HH:mm Z
 [java] -swf-debugfile-alias=/org/apache/royale/0.9.7
 [java] 
-output=
 [java] 
-load-config=
 [java] 
-js-load-config=
 [java] 
-js-load-config+=
 [java] target:SWF
 [java] target:JSRoyale
 [java] COMPC
 [java] Loading configuration: 

 [java] 
 [java] 30706 bytes written to 
C:\jenkins\workspace\royale-asjs\frameworks\projects\Icons\target\Icons.swc in 
3.176 seconds
 [java] COMPCJSCRoyale
 [java] 6.5290245 seconds
 [java] Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8 -Xms384m -Xmx2g

compile-js:
 [echo] swc-date is 01/28/20 23:36 +
   [delete] Deleting: 


clean:
 [echo] swc-date is 01/28/20 23:36 +
   [delete] Deleti

Re: SWF Graphics api emulation -WIP

2020-01-28 Thread Alex Harui


On 1/28/20, 1:01 AM, "Carlos Rovira"  wrote:

Hi again :),

I still didn't see the code, but was imagining how I'd like to use this
feature.

Some thoughts:

1.- Could be possible to have it as a bead for UIBase components a side of
the UIGraphicBase that could still be convenient for some cases?

Disclaimer:  I haven't written the code or looked at it, so this is just a 
high-level opinion:  Regarding a bead for UIBase, I think it would depend on 
how the "child 0" problem gets solved.   My reason for posting is to remind 
folks that in theory, the Basic Containers already support an internal 
container.  I haven't found a lightweight way of enabling internal containers, 
mainly because I didn't want to mark the children and compute or track the set, 
but also because since it is currently used for "chrome" (Panel TitleBar), it 
is relatively simple to enable it the way it is.

Also, MXRoyale's UIComponent is essentially as heavy as a Basic Container, and 
Spark Skinning emulation supports a separate child Skin.  Other component sets 
could just start out being heavier if they want to quickly enable this new 
library via a bead.

Of course, I could be wrong...
-Alex
 



Re: [royale-asjs] branch develop updated: ToolTipRemovalWhenItemRemoved: new bead to abstract best practice showcased in #697

2020-01-28 Thread Carlos Rovira
Hi Yishay,
please go ahead and do the changes
thanks!

El mar., 28 ene. 2020 a las 11:55, Yishay Weiss ()
escribió:

> Thanks for adding this. Since this behavior could be desirable in all
> component sets I’d like to suggest the following:
>
>
>   1.  Move it to Basic
>   2.  Create an interface ITooltipBead which includes removeTip()
>   3.  Have all tooltip beads implement it
>   4.  Use strand.getBeadByType(ITooltipBead) instead of requiring a
> tooltip param
>
> Do you agree?
>
> If you don’t have time I can do this.
>
> From: carlosrov...@apache.org
> Sent: Tuesday, January 28, 2020 11:34 AM
> To: comm...@royale.apache.org
> Subject: [royale-asjs] branch develop updated:
> ToolTipRemovalWhenItemRemoved: new bead to abstract best practice showcased
> in #697
>
> This is an automated email from the ASF dual-hosted git repository.
>
> carlosrovira pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>
>
> The following commit(s) were added to refs/heads/develop by this push:
>  new 93c5612  ToolTipRemovalWhenItemRemoved: new bead to abstract best
> practice showcased in #697
> 93c5612 is described below
>
> commit 93c5612fb36e8c450d6b8c2ff2b69b789c8461ee
> Author: Carlos Rovira 
> AuthorDate: Tue Jan 28 10:34:22 2020 +0100
>
> ToolTipRemovalWhenItemRemoved: new bead to abstract best practice
> showcased in #697
> ---
>  .../royale/itemRenderers/IconListItemRenderer.mxml |  27 +
>  .../Jewel/src/main/resources/jewel-manifest.xml|   2 +
>  .../itemRenderers/ToolTipRemovalWhenItemRemoved.as | 116
> +
>  3 files changed, 119 insertions(+), 26 deletions(-)
>
> diff --git
> a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
> b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
> index 906630b..b7c54d0 100644
> ---
> a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
> +++
> b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
> @@ -29,32 +29,6 @@ limitations under the License.
>  import
> org.apache.royale.jewel.beads.views.ListView;
>
>  import vos.IconListVO;
> -
> -private var host:List;
> -
> -/**
> - * listen to "itemRemoved" event dispatched from the List
> - */
> -override public function addedToParent():void
> -{
> -super.addedToParent();
> -
> -var view:ListView = this.itemRendererParent as ListView;
> -host = view.host as List;
> -IEventDispatcher(host).addEventListener("itemRemoved",
> handleItemRemoved);
> -}
> -
> -/**
> - * check if the renderer (item) is the current and in that
> case ensure remove listener and tip.
> - */
> -protected function
> handleItemRemoved(event:ItemRemovedEvent):void
> -{
> -if(event.item == this)
> -{
> -
> IEventDispatcher(host).removeEventListener("itemRemoved",
> handleItemRemoved);
> -tt.removeTip();
> -}
> -}
>
>  [Bindable("dataChange")]
>  public function get iconList():IconListVO
> @@ -83,6 +57,7 @@ limitations under the License.
>  
>  
>  
> +
>  
>
>   visible="{iconList ? iconList.icon != null : false}"
> click="clickCloseButton()"/>
> diff --git
> a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
> b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
> index 1b6d9a9..44d1bce 100644
> --- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
> +++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
> @@ -222,6 +222,8 @@
>   class="org.apache.royale.jewel.beads.itemRenderers.UpdateTableRowForArrayListData"
> />
>
>   class="org.apache.royale.jewel.beads.itemRenderers.RemoveAllItemRendererForArrayListData"
> />
> +
> + class="org.apache.royale.jewel.beads.itemRenderers.ToolTipRemovalWhenItemRemoved"
> />
>
>  
>
> diff --git
> a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/itemRenderers/ToolTipRemovalWhenItemRemoved.as
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/itemRenderers/ToolTipRemovalWhenItemRemoved.as
> new file mode 100644
> index 000..2ddeb2d
> --- /dev/null
> +++
> b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/itemRenderers/ToolTipRemovalWhenItemRemoved.as
> @@ -0,0 +1,116 @@
>
> +
> +//
> +//  Licensed to the Apache Software Foundation (ASF) under one or more
> +//  contributor license agreements.  See the NOTICE file distributed with
> +/

RE: [royale-asjs] branch develop updated: ToolTipRemovalWhenItemRemoved: new bead to abstract best practice showcased in #697

2020-01-28 Thread Yishay Weiss
Thanks for adding this. Since this behavior could be desirable in all component 
sets I’d like to suggest the following:


  1.  Move it to Basic
  2.  Create an interface ITooltipBead which includes removeTip()
  3.  Have all tooltip beads implement it
  4.  Use strand.getBeadByType(ITooltipBead) instead of requiring a tooltip 
param

Do you agree?

If you don’t have time I can do this.

From: carlosrov...@apache.org
Sent: Tuesday, January 28, 2020 11:34 AM
To: comm...@royale.apache.org
Subject: [royale-asjs] branch develop updated: ToolTipRemovalWhenItemRemoved: 
new bead to abstract best practice showcased in #697

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
 new 93c5612  ToolTipRemovalWhenItemRemoved: new bead to abstract best 
practice showcased in #697
93c5612 is described below

commit 93c5612fb36e8c450d6b8c2ff2b69b789c8461ee
Author: Carlos Rovira 
AuthorDate: Tue Jan 28 10:34:22 2020 +0100

ToolTipRemovalWhenItemRemoved: new bead to abstract best practice showcased 
in #697
---
 .../royale/itemRenderers/IconListItemRenderer.mxml |  27 +
 .../Jewel/src/main/resources/jewel-manifest.xml|   2 +
 .../itemRenderers/ToolTipRemovalWhenItemRemoved.as | 116 +
 3 files changed, 119 insertions(+), 26 deletions(-)

diff --git 
a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
 
b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
index 906630b..b7c54d0 100644
--- 
a/examples/royale/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
+++ 
b/examples/royale/TourDeJewel/src/main/royale/itemRenderers/IconListItemRenderer.mxml
@@ -29,32 +29,6 @@ limitations under the License.
 import org.apache.royale.jewel.beads.views.ListView;

 import vos.IconListVO;
-
-private var host:List;
-
-/**
- * listen to "itemRemoved" event dispatched from the List
- */
-override public function addedToParent():void
-{
-super.addedToParent();
-
-var view:ListView = this.itemRendererParent as ListView;
-host = view.host as List;
-IEventDispatcher(host).addEventListener("itemRemoved", 
handleItemRemoved);
-}
-
-/**
- * check if the renderer (item) is the current and in that case 
ensure remove listener and tip.
- */
-protected function handleItemRemoved(event:ItemRemovedEvent):void
-{
-if(event.item == this)
-{
-IEventDispatcher(host).removeEventListener("itemRemoved", 
handleItemRemoved);
-tt.removeTip();
-}
-}

 [Bindable("dataChange")]
 public function get iconList():IconListVO
@@ -83,6 +57,7 @@ limitations under the License.
 
 
 
+
 

 
diff --git a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml 
b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
index 1b6d9a9..44d1bce 100644
--- a/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
+++ b/frameworks/projects/Jewel/src/main/resources/jewel-manifest.xml
@@ -222,6 +222,8 @@
 

 
+
+

 

diff --git 
a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/itemRenderers/ToolTipRemovalWhenItemRemoved.as
 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/itemRenderers/ToolTipRemovalWhenItemRemoved.as
new file mode 100644
index 000..2ddeb2d
--- /dev/null
+++ 
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/itemRenderers/ToolTipRemovalWhenItemRemoved.as
@@ -0,0 +1,116 @@
+
+//
+//  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.
+//

Re: SWF Graphics api emulation -WIP

2020-01-28 Thread Carlos Rovira
Hi again :),

I still didn't see the code, but was imagining how I'd like to use this
feature.

Some thoughts:

1.- Could be possible to have it as a bead for UIBase components a side of
the UIGraphicBase that could still be convenient for some cases?



<-- This could be a custom bead with the graphics
code and the drawings can be created in a element created by a base bead
(Maybe IGraphicsBead? and a GraphicsBead)
   


2.- Could be possible even declare graphics instructions in MXML?
Inside a js:GraphicsBead tag add things like:





(don't know right now if this could not be optimal, or maybe will require
compiler optimization to remove all the extra code and translate to simple
SWF/ SVG instructions)

I thinking looking at the code of your example will help to imagine how all
this could be modeled/applied

thanks

Carlos




El mar., 28 ene. 2020 a las 9:44, Carlos Rovira ()
escribió:

> Hi Greg,
>
> very cool! :)
> Hope to play with it very soon :)
>
> Do you plan to add your "graphics browser example" to examples?
>
> Thanks for working on this! :)
>
> Carlos
>
> El mar., 28 ene. 2020 a las 3:28, Greg Dove ()
> escribió:
>
>> FYI, I just pushed the WIP on that.
>>
>> to use it in code, there is a UIGraphicsBase target.
>> I'm still not happy with that, so it could change over time. At the moment
>> the svg 'child' in javascript that is used as the 'rendered output'
>> participates in the child element count for that class. Ideally it should
>> not do that and should always be behind the children. Obviously there are
>> different ways to make that work including adding a separate 'children'
>> div
>> container, but I wanted to see if there was a way to keep the native
>> implementation as siblings but avoid the '0' indexed svg element from
>> showing up in the normal api for child elements.
>>
>> Anyhow, a simple way to start working with this is as follows:
>>
>> Assuming you have the following in mxml;
>>
>> 
>>
>> then you could do the following somewhere inside a script block:
>> (assuming: import org.apache.royale.display.Graphics; )
>>
>> var graphics:Graphics = Graphics.getInstanceFor(jsGraphicsTarget);
>> {now use 'graphics' similar to how you would for swf here}
>>
>>
>> On Tue, Jan 21, 2020 at 8:18 AM Greg Dove  wrote:
>>
>> > Thanks for checking that, Carlos. I think it should be quick to add this
>> > to Royale after I am back from vacation.
>> >
>> >
>> >
>> > On Mon, 20 Jan 2020, 01:21 Carlos Rovira, 
>> wrote:
>> >
>> >> Hi Greg,
>> >>
>> >> awesome work! Hope you can get ANT working soon. Although I think is
>> not
>> >> required and you can get to that at a later time when you have the
>> time. I
>> >> think the most important thing is not break maven/ant builds and not
>> >> affect
>> >> current code. Saving that, I think is safe to commit the work, and
>> then go
>> >> incremental from that point. I use to work in that way. If something
>> can
>> >> break build or running code, so it can be ensure integrity in one
>> commit,
>> >> then is better to work in a branch and merge as soon as you get the
>> safe
>> >> state.
>> >>
>> >> Thanks for working on that. it will make Royale even more interesting.
>> I
>> >> think it could be great to use in Jewel for some graphic improvements
>> :)
>> >>
>> >> Looking at the example, I went through all and see all working good or
>> >> with
>> >> the issues already mentioned in the text part (Mitter, Bitmap repeat
>> >> Error,...). Is curious to see that lines and curves seems to render
>> better
>> >> now in browsers than in Flash Player where still lacks of some weird
>> >> representations when going from rect to curve.
>> >>
>> >> We'll be showing this as soon as you commit to develop in social
>> networks.
>> >> I think this can be of interest  for many people out there that can see
>> >> Royale reaching new and important capabilities.
>> >>
>> >> Congrats for what you have achieved here!! Is awesome! :)
>> >>
>> >>
>> >>
>> >> El dom., 19 ene. 2020 a las 4:01, Greg Dove ()
>> >> escribió:
>> >>
>> >> > Just quickly, to add to the list at the bottom of the last email
>> >> > another thing you can do is download the rendered svg.
>> >> > It should open in Inkscape or Illustrator. I have been mainly using
>> >> > Inkscape to check that, I think it is more accurate in terms of
>> >> conforming
>> >> > with svg spec.
>> >> >
>> >> >
>> >> > On Sun, Jan 19, 2020 at 3:41 PM Greg Dove 
>> wrote:
>> >> >
>> >> > >
>> >> > > Just a quick update on where I am at with the above.
>> >> > > I was hoping to get the the current code for this in before I go on
>> >> > > vacation for the next week, but I won't be able to do that (I need
>> to
>> >> > work
>> >> > > through the build side of things, I have only got maven working so
>> >> far).
>> >> > >
>> >> > > I have been focused recently on BitmapData support and have what I
>> >> think
>> >> > > is an adequate starting point for this.
>> >> > > it is really only supporting setPixel, setPi

RE: [royale-asjs] branch develop updated: Only contorllers truly intersted in multiselection will dipatch a multiselection event.

2020-01-28 Thread Yishay Weiss
If guess I figured most of the beads (and item renderers) were fine for my 
use-case so I might as well just use them as they are. We were not in immediate 
needs of anchors, for example. I realize directly instantiating a bead breaks 
IoC so I might have been following an example, but I don’t see such an example 
in the sources. Feel free to refactor this.

From: Alex Harui
Sent: Tuesday, January 28, 2020 7:21 AM
To: dev@royale.apache.org; 
comm...@royale.apache.org
Subject: Re: [royale-asjs] branch develop updated: Only contorllers truly 
intersted in multiselection will dipatch a multiselection event.

Just noticed this while looking into the has/is refactor.

Was this ClassFactory created to fix a bug?  I didn't think the renderers would 
have loaded their IBeadController during the create() call.  Should happen when 
they are placed on the display list unless placed on the strand as an override 
(in which case, it should be respected as intentional?)

IMO, MutipleSelectionLists might benefit from their own renderers (subclasses 
of StringItemRenderer or whatever) that would specify a different set of beads 
(not just mouse controlers, but someday keyboard controllers).  And possibly 
additional information for the renderers about the selection.  Renderer visuals 
for multiple selection might need to be more complex than for single selection 
(anchors, carets, etc).

Mostly wondering,
-Alex

On 11/24/19, 4:26 AM, "yish...@apache.org"  wrote:

This is an automated email from the ASF dual-hosted git repository.

yishayw pushed a commit to branch develop
in repository 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgitbox.apache.org%2Frepos%2Fasf%2Froyale-asjs.git&data=02%7C01%7Caharui%40adobe.com%7C1062582d7b7f4000bf7d08d770d97f6d%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637101951823273040&sdata=8vA%2ByeX3qJz8ZyAsTGZeSZpxQzSgdHUAulThoBui4xo%3D&reserved=0


The following commit(s) were added to refs/heads/develop by this push:
 new 95cc8f9  Only contorllers truly intersted in multiselection will 
dipatch a multiselection event.
 new dd5ca83  Merge branch 'develop' of 
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Froyale-asjs&data=02%7C01%7Caharui%40adobe.com%7C1062582d7b7f4000bf7d08d770d97f6d%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637101951823273040&sdata=lgKjvVJQ%2FS6f5%2FDWwjhNBveNNoU7zhs2dVREQzCqN1c%3D&reserved=0
 into develop
95cc8f9 is described below

commit 95cc8f9dc87503c91f0d345036796d93b15cb1e4
Author: DESKTOP-RH4S838\Yishay 
AuthorDate: Sun Nov 24 14:23:33 2019 +0200

Only contorllers truly intersted in multiselection will dipatch a 
multiselection event.

Also, make sure to use metevent for apple devices as ctrlKey is not 
usually associated with multiselection there.
---
 .../projects/Basic/src/main/resources/defaults.css |   2 +-
 .../projects/Basic/src/main/royale/BasicClasses.as |   1 +
 .../MultiSelectionItemRendererClassFactory.as  |  65 +
 .../AccordionItemRendererMouseController.as|   2 -
 .../controllers/ItemRendererMouseController.as |  10 --
 .../ListMultiSelectionMouseController.as   |   4 +-
 ...> MultiSelectionItemRendererMouseController.as} | 106 
++---
 .../supportClasses/ButtonBarButtonItemRenderer.as  |   2 -
 .../html/supportClasses/TextButtonItemRenderer.as  |   2 -
 .../projects/Core/src/main/royale/CoreClasses.as   |   1 +
 .../org/apache/royale/events/ItemClickedEvent.as   |  18 +---
 ...dEvent.as => MultiSelectionItemClickedEvent.as} |  67 ++---
 .../controllers/ItemRendererMouseController.as |   4 -
 13 files changed, 156 insertions(+), 128 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/resources/defaults.css 
b/frameworks/projects/Basic/src/main/resources/defaults.css
index 8069565..64d320c 100644
--- a/frameworks/projects/Basic/src/main/resources/defaults.css
+++ b/frameworks/projects/Basic/src/main/resources/defaults.css
@@ -396,7 +396,7 @@ MultiSelectionList
 IBeadController: 
ClassReference("org.apache.royale.html.beads.controllers.ListMultiSelectionMouseController");
 IBeadLayout: 
ClassReference("org.apache.royale.html.beads.layouts.VerticalLayout");
 IDataProviderItemRendererMapper: 
ClassReference("org.apache.royale.html.beads.DataItemRendererFactoryForArrayData");
-   IItemRendererClassFactory: 
ClassReference("org.apache.royale.core.ItemRendererClassFactory");
+   IItemRendererClassFactory: 
ClassReference("org.apache.royale.html.beads.MultiSelectionItemRendererClassFactory");
 IItemRenderer: 
ClassReference("org.apache.royale.html.supportClasses.StringItemRenderer");
 IViewport: 
ClassReference("org.apache.royale.html.support

Re: SWF Graphics api emulation -WIP

2020-01-28 Thread Carlos Rovira
Hi Greg,

very cool! :)
Hope to play with it very soon :)

Do you plan to add your "graphics browser example" to examples?

Thanks for working on this! :)

Carlos

El mar., 28 ene. 2020 a las 3:28, Greg Dove ()
escribió:

> FYI, I just pushed the WIP on that.
>
> to use it in code, there is a UIGraphicsBase target.
> I'm still not happy with that, so it could change over time. At the moment
> the svg 'child' in javascript that is used as the 'rendered output'
> participates in the child element count for that class. Ideally it should
> not do that and should always be behind the children. Obviously there are
> different ways to make that work including adding a separate 'children' div
> container, but I wanted to see if there was a way to keep the native
> implementation as siblings but avoid the '0' indexed svg element from
> showing up in the normal api for child elements.
>
> Anyhow, a simple way to start working with this is as follows:
>
> Assuming you have the following in mxml;
>
> 
>
> then you could do the following somewhere inside a script block:
> (assuming: import org.apache.royale.display.Graphics; )
>
> var graphics:Graphics = Graphics.getInstanceFor(jsGraphicsTarget);
> {now use 'graphics' similar to how you would for swf here}
>
>
> On Tue, Jan 21, 2020 at 8:18 AM Greg Dove  wrote:
>
> > Thanks for checking that, Carlos. I think it should be quick to add this
> > to Royale after I am back from vacation.
> >
> >
> >
> > On Mon, 20 Jan 2020, 01:21 Carlos Rovira, 
> wrote:
> >
> >> Hi Greg,
> >>
> >> awesome work! Hope you can get ANT working soon. Although I think is not
> >> required and you can get to that at a later time when you have the
> time. I
> >> think the most important thing is not break maven/ant builds and not
> >> affect
> >> current code. Saving that, I think is safe to commit the work, and then
> go
> >> incremental from that point. I use to work in that way. If something can
> >> break build or running code, so it can be ensure integrity in one
> commit,
> >> then is better to work in a branch and merge as soon as you get the safe
> >> state.
> >>
> >> Thanks for working on that. it will make Royale even more interesting. I
> >> think it could be great to use in Jewel for some graphic improvements :)
> >>
> >> Looking at the example, I went through all and see all working good or
> >> with
> >> the issues already mentioned in the text part (Mitter, Bitmap repeat
> >> Error,...). Is curious to see that lines and curves seems to render
> better
> >> now in browsers than in Flash Player where still lacks of some weird
> >> representations when going from rect to curve.
> >>
> >> We'll be showing this as soon as you commit to develop in social
> networks.
> >> I think this can be of interest  for many people out there that can see
> >> Royale reaching new and important capabilities.
> >>
> >> Congrats for what you have achieved here!! Is awesome! :)
> >>
> >>
> >>
> >> El dom., 19 ene. 2020 a las 4:01, Greg Dove ()
> >> escribió:
> >>
> >> > Just quickly, to add to the list at the bottom of the last email
> >> > another thing you can do is download the rendered svg.
> >> > It should open in Inkscape or Illustrator. I have been mainly using
> >> > Inkscape to check that, I think it is more accurate in terms of
> >> conforming
> >> > with svg spec.
> >> >
> >> >
> >> > On Sun, Jan 19, 2020 at 3:41 PM Greg Dove 
> wrote:
> >> >
> >> > >
> >> > > Just a quick update on where I am at with the above.
> >> > > I was hoping to get the the current code for this in before I go on
> >> > > vacation for the next week, but I won't be able to do that (I need
> to
> >> > work
> >> > > through the build side of things, I have only got maven working so
> >> far).
> >> > >
> >> > > I have been focused recently on BitmapData support and have what I
> >> think
> >> > > is an adequate starting point for this.
> >> > > it is really only supporting setPixel, setPixel32, fillRect, lock,
> >> > unlock,
> >> > > dispose. I did add a couple of other methods, but have not really
> >> started
> >> > > to test those yet.
> >> > >
> >> > > If you are interested you can test this and let me know of any
> issues
> >> you
> >> > > see. I have a series of test suites in a live testing app I have
> been
> >> > using.
> >> > > (This is really meant for desktop use, but does actually show
> >> something
> >> > on
> >> > > a large screen tablet).
> >> > >
> >> > > Here is a direct link into one of the bitmap based tests:
> >> > >
> >> >
> >>
> http://interactionscript.com/royale/swf-graphics/index.html?defaultTest=4,1
> >> > > See instructions at the end of this email if you want more info
> about
> >> > what
> >> > > you can do.
> >> > >
> >> > > This is working with beginBitmapFill, and lineBitmapStyle. Smooth
> vs.
> >> > > non-smooth works on quite a few browsers, but not all browsers seem
> to
> >> > > support the non-smoothing (i.e. 'non-alias' or 'crisp' scaling)
> >> option.
> >> > > Repeat vs. non-repea

Re: Renderers doesn't support States

2020-01-28 Thread Carlos Rovira
ok, I separate States to a new MXMLStatesItemRenderer.
For Jewel, that uses StyledItemRenderer as the base class now extend this
new one to get states support by default

El lun., 27 ene. 2020 a las 21:49, Alex Harui ()
escribió:

> Classes in Basic should remain PAYG.  That would imply that MXML States
> support would go in a subclass of MXMLItemRenderer.
>
> My 2 cents,
> -Alex
>
> On 1/27/20, 10:58 AM, "Carlos Rovira"  wrote:
>
> Hi,
>
> today while working on a TodoMVC version in Royale notice that
> ItemRenderers does not support States.
> So I'm going to add it, but want to ask the best point to do. IMO it
> could
> be in MXMLItemRenderer.
>
> thoughts?
>
> --
> Carlos Rovira
>
> https://nam04.safelinks.protection.outlook.com/?url=http%3A%2F%2Fabout.me%2Fcarlosrovira&data=02%7C01%7Caharui%40adobe.com%7Cc7aba0e4270d4ac63b4b08d7a35aedd1%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C637157483241210726&sdata=3AxmqnEZIC1BGXIulf8e1oHqv8sp%2Fu6jesN%2FF%2FiljlQ%3D&reserved=0
>
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira