- /** 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 */
- protected Surface _createSurface(Box b, boolean framed) { return null; }
- public static Surface createSurface(Box b, boolean framed, boolean refreshable) {
- Surface ret = platform._createSurface(b, framed);
- ret.setInvisible(false);
-
- Object titlebar = b.get("titlebar", true);
- if (titlebar != null) ret.setTitleBarText(titlebar.toString());
-
- Object icon = b.get("icon", true);
- if (icon != null && icon instanceof Res) {
- Picture pic = Picture.fromRes((Res)icon);
- 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.allSurfaces.addElement(ret);
- ret.dirty(0, 0, b.width, b.height);
- ret.Refresh();
- }
- return ret;
- }
-