2002/04/28 04:36:08
[org.ibex.core.git] / src / org / xwt / plat / Java2.java
index f7451c3..1ff8764 100644 (file)
@@ -122,6 +122,8 @@ public class Java2 extends AWT {
     // This is rumored to be fixed in JDK 1.4.
     protected static void _doDrawImage(Graphics g, Image i, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver o) {
         
+        if (dx1 == dx2 || dy1 == dy2) return;
+
         if (dx2 - dx1 != sx2 - sx1 || dy2 - dy1 != sy2 - sy1)
             g.drawImage(i, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, o);
         else {
@@ -175,4 +177,24 @@ public class Java2 extends AWT {
     }
 
     protected String getDescriptiveName() { return "Java 1.2+ JVM"; }
+
+    protected void _newBrowserWindow(String url) {
+        if (Main.applet == null) {
+            if (Log.on) Log.log(this, "Main.applet is null; cannot invoke showDocument()");
+            return;
+        }
+        if (Log.on) Log.log(this, "asking browser to show URL " + url);
+        try {
+            Main.applet.getAppletContext().showDocument(new URL(url), "_blank");
+        } catch (MalformedURLException e) {
+            if (Log.on) Log.log(this, e);
+        }
+    }
+
+    /** used to notify the user of very serious failures; usually used when logging is not working or unavailable */
+    protected void _criticalAbort(String message) {
+        if (Log.on) Log.log(this, message);
+        new Semaphore().block();
+    }
+
 }