Revision: 939
Author: allain.lalonde
Date: Wed Jan 20 14:13:34 2010
Log: 2.0-spike: Making PNode use children directly when used within Piccolo2D. Since it can never be null now, it made sense.
http://code.google.com/p/piccolo2d/source/detail?r=939

Modified:
/piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/PNode.java

=======================================
--- /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/PNode.java Wed Jan 20 10:01:15 2010 +++ /piccolo2d.java/branches/2.0-spike/core/src/main/java/org/piccolo2d/PNode.java Wed Jan 20 14:13:34 2010
@@ -113,7 +113,7 @@

     /**
      * The property name that identifies a change in this node's client
-     * propertie (see {...@link #getClientProperty getClientProperty}). In an
+     * property (see {...@link #getClientProperty getClientProperty}). In an
* property change event the new value will be a reference to the map of
      * client properties but old value will always be null.
      */
@@ -121,7 +121,7 @@

     /**
      * The property code that identifies a change in this node's client
-     * propertie (see {...@link #getClientProperty getClientProperty}). In an
+     * property (see {...@link #getClientProperty getClientProperty}). In an
* property change event the new value will be a reference to the map of
      * client properties but old value will always be null.
      */
@@ -3177,7 +3177,7 @@
         if (children == Collections.EMPTY_LIST) {
             children = new LinkedList<PNode>();
         }
-        getChildrenReference().add(index, child);
+        children.add(index, child);
         child.invalidatePaint();
         invalidateFullBounds();

@@ -3352,7 +3352,7 @@
     public PNode removeChild(final int index) {
         final PNode child = (PNode) children.remove(index);

-        if (children.size() == 0) {
+        if (children.isEmpty()) {
             children = EMPTY_CHILDREN;
         }

@@ -3371,7 +3371,7 @@
      *
      * @param childrenNodes the collection of children to remove
      */
-    public void removeChildren(final Collection<PNode> childrenNodes) {
+ public void removeChildren(final Collection<? extends PNode> childrenNodes) {
         for (PNode each : childrenNodes) {
             removeChild(each);
         }
@@ -3434,7 +3434,7 @@
     public void replaceWith(final PNode replacementNode) {
         if (parent != null) {
             final PNode p = parent;
-            final int index = p.getChildrenReference().indexOf(this);
+            final int index = p.children.indexOf(this);
             p.removeChild(this);
             p.addChild(index, replacementNode);
         }
-- 
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en

Reply via email to