get rid of JS.BT
[org.ibex.core.git] / src / org / ibex / core / Box.java
index 053357a..a587a55 100644 (file)
@@ -99,6 +99,8 @@ public final class Box extends JSScope implements Task {
     Box redirect = this;
     int flags = VISIBLE | PACKED | REPACK | RECONSTRAIN | REPLACE | FIXED | STOP_UPWARD_PROPAGATION | CLIP | MOVED;
 
+    private BalancedTree bt;
+    
     private String text = null;
     private Font font = DEFAULT_FONT; 
     private Picture texture = null;
@@ -938,4 +940,15 @@ public final class Box extends JSScope implements Task {
             JS.log(e);
         }
     }
+    
+    // BalancedTree functions
+    private void insertNode(int p, Box b) {
+        if(bt == null) bt = new BalancedTree();
+        bt.insertNode(p,b);
+    }
+    
+    private int treeSize() { return bt == null ? 0 : bt.treeSize(); }
+    private int indexNode(Box b) { return bt == null ? -1 : bt.indexNode(b); }
+    private void deleteNode(int p) { bt.deleteNode(p); }
+    private Box getNode(int p) { return (Box)bt.getNode(p); }
 }