X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fcore%2FBox.java;h=869683984a4066542ea6e89501a56a9a230d739d;hp=17323c1108082a97108800d7f2fd1e5419015aba;hb=05d23fde131a7d19b378c632c6cc6b7924d8ab4d;hpb=2ea4142ec6959e6663f83ab23a26bb202ffce226 diff --git a/src/org/ibex/core/Box.java b/src/org/ibex/core/Box.java index 17323c1..8696839 100644 --- a/src/org/ibex/core/Box.java +++ b/src/org/ibex/core/Box.java @@ -58,13 +58,9 @@ public final class Box extends JS.Obj implements Callable { //#define CHECKSET_STRING(prop) if ((value==null&&prop==null)||(value!=null&&JSU.toString(value).equals(prop))) break; prop=JSU.toString(value); // FIXME memory leak - static Basket.Map boxToCursor = new Basket.HashMap(500, 3); + static Basket.Map boxToCursor = new Basket.Hash(500, 3); - static final Font DEFAULT_FONT; - static { - try { DEFAULT_FONT = Font.getFont((JS)Main.builtin.get(JSU.S("fonts/vera/Vera.ttf")), 10); } - catch(JSExn e) { throw new Error("Error loading default font: " + e); } - } + public static final Font DEFAULT_FONT = Font.getFont(Main.vera, 10); // Flags ////////////////////////////////////////////////////////////////////// @@ -118,6 +114,10 @@ public final class Box extends JS.Obj implements Callable { public int maxwidth = Integer.MAX_VALUE; public int minheight = 0; public int maxheight = Integer.MAX_VALUE; + public int minwidth() { return minwidth; } + public int minheight() { return minheight; } + public int maxwidth() { return maxwidth; } + public int maxheight() { return maxheight; } private short rows = 1; private short cols = 0; private short rowspan = 1; @@ -445,7 +445,6 @@ public final class Box extends JS.Obj implements Callable { // Methods to implement org.ibex.js.JS ////////////////////////////////////// - public JS call(JS method, JS[] args) throws JSExn { switch (args.length) { @@ -604,9 +603,9 @@ public final class Box extends JS.Obj implements Callable { JSU.error("redirect can only be set to a descendant of its current value"); case "fontsize": font = Font.getFont(font == null ? null : font.stream, JSU.toInt(value)); RECONSTRAIN(); dirty(); case "font": - if(!(value instanceof Stream)) throw new JSExn("You can only put streams to the font property"); + if(!(value instanceof Fountain)) throw new JSExn("You can only put streams to the font property"); //FIXME: if (font == value) return; // FIXME: unclone() - font = value == null ? null : Font.getFont((Stream)value, font == null ? 10 : font.pointsize); + font = value == null ? null : Font.getFont((Fountain)value, font == null ? 10 : font.pointsize); RECONSTRAIN(); dirty(); case "x": if (parent==null && Surface.fromBox(this)!=null) {