On 9/18/14 10:47 AM, "OmPrakash Muppirala" <bigosma...@gmail.com> wrote:
>On Thu, Sep 18, 2014 at 9:07 AM, Alex Harui <aha...@adobe.com> wrote: > >> BTW, I was thinking about this some moreŠ >> >> I haven't looked at your code, but are GraphicShapes actually allowed to >> be children of any container? Or do they have to be children of a >> GraphicsContainer? If the latter, then they shouldn't implement IUIBase >> and the developer may have to first place a GraphicsContainer in the DOM >> to contain them. >> >> >The plan is to support both. GraphicShape is the base class for >individual >shapes like Rect, Ellipse, etc. It is also the base class for >GraphicsContainer which exposes methods like drawRect, drawEllipse, etc. >In the former case, Rects can be directly added to a container. In the >latter case, GraphicsContainer can be added to a container. I guess I was expecting that you could declaratively describe a complex graphic and do something like: <GraphicsContainer> <Rect ..> <Circle ..> <Path ..> </GraphicsContainer> I would then think the child Rect, Circle and Path shouldn't be heavy. But I also see the need to have a single shape as a child of a container and mixed in with other components. What about doing something similar to Spark? Spark has a BitmapImage graphic primitive and an Image component. FlexJS could have a Rect component as well as a Rect graphic element that only can be a child of a GraphicsContainer. The Rect component can just be a UIBase that is composed of a GraphicsContainer child with a Rect in it. That would be consistent with the composition philosophy of FlexJS: common patterns get composited into Components and can be further optimized if needed. Thoughts? -Alex