Skip to main content
Known Participant
Sep 10, 2009 9:30 PM UTC
Question

Why isn't DataGroup and IVisualElementContainer?

It seems that the DataGroup is missing some important features that the Group has, such as addElement/removeElement, and it seems like it almost just grabs some random methods from IVisualElementContainer as it needs them (getElementAt, getVirtualElementAt).

if you don't want people to manually "addElement" in the datagroup, you could just throw an error, but have a reference to the "player version" with $addElement.  But having that extra functionality is important for adding more support for other types of graphics in the DataGroup.

I would like to extend the functionality of DataGroup so it can support full 3D, but I need to use addElement-like functionality, so it seems like putting the Group IVisualElementContainer code into GroupBase would be a good thing.

Please let me know if you what you think.

Lance

This topic is closed to new replies. Start a new post to keep the conversation going.

2 replies

Sep 11, 2009 7:31 AM UTC

The methods in DataGroup are the "read-only" methods out of IVisualElementContainer, which Group and a few other classes implement.  These methods/getters are getElementAt(), getElementIndex(), and numElements.  It is not intended for someone to be able to use the "read-write" methods of IVisualElementContainer (addElement, removeElement, etc...) on a DataGroup.

DataGroups are meant for the sole purpose on rendering data items in to visual elements.  Explaining your use-case might help figure out what would be the best way to do it and if we should modify DataGroup to help support the use-case.

Also, there is no player version of addElement.  There's only addChild, and there is a $addChild method you can use to access the player version of it, though it's not reccomended to do that with either Group or DataGroup because they internally make assumptions that they own their own display list.

-Ryan

Translate
viatroposAuthor
Known Participant
Sep 10, 2009 9:32 PM UTC

Plus 99% of the methods in there are private so I can't do anything with them unless I modify the source.

Translate