2003/11/13 07:46:41
[org.ibex.core.git] / src / org / xwt / BoxTree.java
index ef84541..9f89ece 100644 (file)
@@ -330,7 +330,7 @@ public final class BoxTree extends Box {
         removeNode();
         parent = null;
         if (oldparent != null) { Box b = oldparent; MARK_REFLOW_b; }
-        if (oldparent != null) oldparent.putAndInvokeTraps("childremoved", this);
+        if (oldparent != null) oldparent.putAndTriggerJSTraps("childremoved", this);
     }
 
     /** Returns ith child */
@@ -372,22 +372,22 @@ public final class BoxTree extends Box {
         }
 
         if (redirect == null) {
-            if (value == null) putAndTriggerTraps("childremoved", getChild(i));
+            if (value == null) putAndTriggerJSTraps("childremoved", getChild(i));
             else Log.logJS(this, "attempt to add/remove children to/from a node with a null redirect");
 
         } else if (redirect != this) {
-            if (value != null) putAndTriggerTraps("childadded", b);
+            if (value != null) putAndTriggerJSTraps("childadded", value);
             redirect.put(i, value);
             if (value == null) {
-                Box b = (Box)redirect.get(new Integer(i)) : (Box)value;
-                if (b != null) putAndTriggerTraps("childremoved", b);
+                Box b = (Box)redirect.get(new Integer(i));
+                if (b != null) putAndTriggerJSTraps("childremoved", b);
             }
 
         } else if (value == null) {
-            if (i < 0 || i > numChildren()) return;
+            if (i < 0 || i > numchildren) return;
             Box b = getChild(i);
             b.remove();
-            putAndTriggerTraps("childremoved", b);
+            putAndTriggerJSTraps("childremoved", b);
 
         } else {
             Box b = (Box)value;
@@ -412,15 +412,15 @@ public final class BoxTree extends Box {
             numchildren++;
 
             Box before = getChild(i);
-            if (before == null) root.peerTree_rightmost().insertAfterMe(b);
+            if (before == null) rootChild.peerTree_rightmost().insertAfterMe(b);
             else before.insertBeforeMe(b);
             
             // need both of these in case child was already uncalc'ed
             MARK_REFLOW_b;
             MARK_REFLOW;
             
-            b.dirty();
-            putAndTriggerTraps("childadded", b);
+            b.dirty(); 
+            putAndTriggerJSTraps("childadded", b);
         }
     }
 }