Hi Cam,

Cameron McCormack <[email protected]> wrote on 04/02/2009 08:00:02 AM:

> [email protected]:
> > -            children.addAll(Arrays.asList(middleMarkerProxies));

> Did Collection.addAll() not work because CompositeGraphicsNode doesn?t
> implement all of the List interface methods properly, or some other
> reason?

   CompositeGraphicsNode didn't implement addAll (it is optional):
    public boolean addAll(Collection c) {
        throw new UnsupportedOperationException();
    }

   It was silly to use addAll in this case anyway since we will
be building a List from our Array which we will then just iterate
over the list and add each element individually.  Since the
Children are a linked list there is no advantage to knowing the
number of items to be added before hand (plus I'm fairly sure
iterating over an array is faster than retrieving elements from
a List object).

   Note that there are a number of other optional operations that
CompositeGraphicsNode doesn't implement.

> And did the addAll() calls for the animation event name sets
> also not work?

   No that would have worked. I just liked it better this way.
If you do that make sure to make the first loop into an addAll
call as well.  That 'mismatch' is the reason I changed the code. 
I decided to go back rather than forward...

Reply via email to