- /** Called once XWT is initialized and the application is running. */
- public static void running() {
- Log.log(Platform.class, "XWT is running");
- platform._running();
- }
-
- /** quits XWT */
- public static void exit() {
- Log.log(Platform.class, "exiting via Platform.exit()");
- platform._exit();
- }
-
- /** the human-readable name of the key mapped to XWT's 'alt' key */
- public static String altKeyName() { return platform._altKeyName(); }
-
- /** used to notify the user of very serious failures; usually used when logging is not working or unavailable */
- public static void criticalAbort(String message) {
- if (Log.on) Log.log(Platform.class, "Critical Abort:");
- if (Log.on) Log.log(Platform.class, message);
- platform._criticalAbort(message);
- }
-
- /** this method invokes the platform _createSurface() method and then enforces a few post-call invariants */
- public static Surface createSurface(Box b, boolean framed, boolean refreshable) {
- Surface ret = platform._createSurface(b, framed);
- ret.setInvisible(b.invisible);
- b.set(Box.size, 0, b.size(0) < Surface.scarPicture.getWidth() ? Surface.scarPicture.getWidth() : b.size(0));
- b.set(Box.size, 1, b.size(1) < Surface.scarPicture.getHeight() ? Surface.scarPicture.getHeight() : b.size(1));
-
- Object titlebar = b.get("titlebar", null, true);
- if (titlebar != null) ret.setTitleBarText(titlebar.toString());
-
- Object icon = b.get("icon", null, true);
- if (icon != null && !"".equals(icon)) {
- Picture pic = Box.getPicture(icon.toString());
- if (pic != null) ret.setIcon(pic);
- else if (Log.on) Log.log(Platform.class, "unable to load icon " + icon);
- }
-
- ret.setLimits(b.dmin(0), b.dmin(1), b.dmax(0), b.dmax(1));
-
- if (refreshable) {
- Surface.refreshableSurfaceWasCreated = true;
- Surface.allSurfaces.addElement(ret);
- ret.dirty(0, 0, ret.width, ret.height);
- ret.Refresh();
- }
- return ret;
- }
-