- /** 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.width = b.height < Surface.scarPicture.getWidth() ? Surface.scarPicture.getWidth() : b.width;
- b.height = b.height < Surface.scarPicture.getHeight() ? Surface.scarPicture.getHeight() : b.height;
-
- Object titlebar = b.get("titlebar", true);
- if (titlebar != null) ret.setTitleBarText(titlebar.toString());
-
- Object icon = b.get("icon", true);
- if (icon != null && !"".equals(icon)) {
- Picture pic = ImageDecoder.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.minwidth, b.minheight, b.maxwidth, b.maxheight);
-
- if (refreshable) {
- Surface.refreshableSurfaceWasCreated = true;
- Surface.allSurfaces.addElement(ret);
- ret.dirty(0, 0, b.width, b.height);
- ret.Refresh();
- }
- return ret;
- }
-