static final Font DEFAULT_FONT;
static {
- try { DEFAULT_FONT = Font.getFont(Main.builtin.get(JS.S("fonts/vera/Vera.ttf")), 10); }
+ try { DEFAULT_FONT = Font.getFont((JS)Main.builtin.get(JS.S("fonts/vera/Vera.ttf")), 10); }
catch(JSExn e) { throw new Error("Error loading default font: " + e); }
}
public JS callMethod(JS method, JS a0, JS a1, JS a2, JS[] rest, int nargs) throws JSExn {
switch (nargs) {
case 1: {
- //#jswitch(method)
+ //#switch(JS.toString(method))
case "indexof":
Box b = (Box)a0;
if (b.parent != this)
if (JS.isInt(name))
return redirect == null ? null : redirect == this ? getChild(JS.toInt(name)) : redirect.get(name);
- //#jswitch(name)
+ //#switch(JS.toString(name))
case "surface": return parent == null ? null : parent.getAndTriggerTraps(name);
case "indexof": return METHOD;
case "distanceto": return METHOD;
private class Mouse extends JS implements JS.Cloneable {
public JS get(JS key) throws JSExn {
- //#jswitch(key)
+ //#switch(JS.toString(key))
case "x": return N(globalToLocalX(getSurface()._mousex));
case "y": return N(globalToLocalY(getSurface()._mousey));
public void put(JS name, JS value) throws JSExn {
if (JS.isInt(name)) { put(JS.toInt(name), value); return; }
- //#jswitch(name)
+ //#switch(JS.toString(name))
case "thisbox": if (value == null) removeSelf();
case "text": { String s = value == null ? "" : JS.toString(value); CHECKSET_STRING(text); RECONSTRAIN(); dirty(); }
case "strokecolor": value = N(Color.stringToColor(JS.toString(value))); CHECKSET_INT(strokecolor); dirty();
private void setAlign(JS value) throws JSExn {
clear(ALIGNS);
- //#jswitch(value)
+ //#switch(JS.toString(value))
case "topleft": set(ALIGN_TOP | ALIGN_LEFT);
case "bottomleft": set(ALIGN_BOTTOM | ALIGN_LEFT);
case "topright": set(ALIGN_TOP | ALIGN_RIGHT);