- private String alignToString() {
- switch(flags & ALIGNS) {
- case (ALIGN_TOP | ALIGN_LEFT): return "topleft";
- case (ALIGN_BOTTOM | ALIGN_LEFT): return "bottomleft";
- case (ALIGN_TOP | ALIGN_RIGHT): return "topright";
- case (ALIGN_BOTTOM | ALIGN_RIGHT): return "bottomright";
- case ALIGN_TOP: return "top";
- case ALIGN_BOTTOM: return "bottom";
- case ALIGN_LEFT: return "left";
- case ALIGN_RIGHT: return "right";
- case 0: return "center";
- default: throw new Error("invalid alignment flags: " + (flags & ALIGNS));
- }
- }
-
- private void setAlign(JS value) throws JSExn {
- clear(ALIGNS);
- //#switch(JSU.toString(value))
- case "topleft": set(ALIGN_TOP | ALIGN_LEFT);
- case "bottomleft": set(ALIGN_BOTTOM | ALIGN_LEFT);
- case "topright": set(ALIGN_TOP | ALIGN_RIGHT);
- case "bottomright": set(ALIGN_BOTTOM | ALIGN_RIGHT);
- case "top": set(ALIGN_TOP);
- case "bottom": set(ALIGN_BOTTOM);
- case "left": set(ALIGN_LEFT);
- case "right": set(ALIGN_RIGHT);
- default: JSU.log("invalid alignment \"" + JSU.str(value) + "\"");
- //#end
- }
-