2003/12/29 22:29:28
authormegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:43:44 +0000 (07:43 +0000)
committermegacz <megacz@xwt.org>
Fri, 30 Jan 2004 07:43:44 +0000 (07:43 +0000)
darcs-hash:20040130074344-2ba56-ddf47a908e0072994f15c9459430ef33d2f045f8.gz

src/org/xwt/Box.java

index 6f0c92c..48c5628 100644 (file)
@@ -67,7 +67,7 @@ public final class Box extends JSScope implements Scheduler.Task {
    
     static {
         Font f = null;
-        try { f = Font.getFont((Res)Main.builtin.get("fonts/vera/Vera.ttf"), 10); }
+        try { f = Font.getFont((Stream)Main.builtin.get("fonts/vera/Vera.ttf"), 10); }
         catch(JSExn e) { Log.info(Box.class, "should never happen: "+e); }
         DEFAULT_FONT = f;
     }
@@ -177,7 +177,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 { Res res = texture.res; texture = null; throw new JSExn("image not found: "+res); }
+            else { Stream res = texture.res; texture = null; throw new JSExn("image not found: "+res); }
         }
 
         MARK_REPACK;
@@ -530,7 +530,7 @@ public final class Box extends JSScope implements Scheduler.Task {
         case "toback": if (parent == null && getSurface() != null && toBoolean(value)) { getSurface().toBack(); }
         case "tofront": if (parent == null && getSurface() != null && toBoolean(value)) { getSurface().toFront(); }
         case "redirect": if (redirect == this) redirect = (Box)value; else Log.info(this, "redirect can only be set once");
-        case "font": font = value == null ? null : Font.getFont((Res)value, font == null ? 10 : font.pointsize); MARK_RESIZE; dirty();
+        case "font": font = value == null ? null : Font.getFont((Stream)value, font == null ? 10 : font.pointsize); MARK_RESIZE; dirty();
         case "fontsize": font = Font.getFont(font == null ? null : font.res, toInt(value)); MARK_RESIZE; dirty();
         case "x": if (parent==null && Surface.fromBox(this)!=null) { CHECKSET_INT(x); } else { if (test(PACKED) && parent != null) return; CHECKSET_INT(x); dirty(); MARK_RESIZE; dirty(); }
         case "y": if (parent==null && Surface.fromBox(this)!=null) { CHECKSET_INT(y); } else { if (test(PACKED) && parent != null) return; CHECKSET_INT(y); dirty(); MARK_RESIZE; dirty(); }
@@ -632,8 +632,8 @@ public final class Box extends JSScope implements Scheduler.Task {
             dirty();
             return;
         }
-        if (!(value instanceof Res)) return;
-        texture = Picture.load((Res)value, this);
+        if (!(value instanceof Stream)) return;
+        texture = Picture.load((Stream)value, this);
     }
 
     // FIXME: mouse move/release still needs to propagate to boxen in which the mouse was pressed and is still held down