2004/01/13 10:27:45
[org.ibex.core.git] / src / org / xwt / Box.java
index c4f34e5..9bb8645 100644 (file)
@@ -175,7 +175,7 @@ public final class Box extends JSScope implements Scheduler.Task {
         // as external events have occured, check the state of box
         if (texture != null) {
             if (texture.isLoaded) { minwidth = min(texture.width, maxwidth); minheight = min(texture.height, maxheight); }
-            else { Stream res = texture.res; texture = null; throw new JSExn("image not found: "+res); }
+            else { JS res = texture.res; texture = null; throw new JSExn("image not found: "+res); }
         }
 
         MARK_REPACK;
@@ -472,7 +472,7 @@ public final class Box extends JSScope implements Scheduler.Task {
         throw new Error("unreachable"); // unreachable
     }
 
-    private class Mouse extends JS {
+    private class Mouse extends JS.Cloneable {
         public Object get(Object key) {
             //#switch(key)
             case "x": return N(globalToLocalX(getSurface()._mousex));
@@ -642,10 +642,10 @@ public final class Box extends JSScope implements Scheduler.Task {
             int newfillcolor = stringToColor((String)value);
             if (newfillcolor == fillcolor) return;
             fillcolor = newfillcolor;
-        } else if(value instanceof Stream) {
-            texture = Picture.load((Stream)value, this);
+        } else if(value instanceof JS) {
+            texture = Picture.load((JS)value, this);
         } else {
-            throw new JSExn("fill must be null, a String, or a stream");
+            throw new JSExn("fill must be null, a String, or a stream, not a " + value.getClass());
         }
         dirty();
     }