X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fxwt%2Fplat%2FAWT.java;h=9b01d2fb6a3feda78bbcd5ec115d47d457bf9921;hb=acec04210e2f94f01bf6aeea29f8eef12ba54a1a;hp=ab3cfa962cb589fd29fb95aa79a4a5c709818843;hpb=8fd78bcfe4e844cae509d132ca37bd32a115a6f1;p=org.ibex.core.git diff --git a/src/org/xwt/plat/AWT.java b/src/org/xwt/plat/AWT.java index ab3cfa9..9b01d2f 100644 --- a/src/org/xwt/plat/AWT.java +++ b/src/org/xwt/plat/AWT.java @@ -27,6 +27,31 @@ public class AWT extends Platform { protected int _getMaxDescent(String font) { return getFont(font).metrics.getMaxDescent(); } protected boolean _supressDirtyOnResize() { return true; } + protected void postInit() { + if (Log.on) Log.log(Platform.class, " color depth = " + + Toolkit.getDefaultToolkit().getColorModel().getPixelSize() + "bpp"); + } + + protected void _criticalAbort(String message) { + if (Log.on) Log.log(this, message); + final Dialog d = new Dialog(new Frame(), "XWT Cannot Continue"); + d.setLayout(new BorderLayout()); + TextArea ta = new TextArea("XWT cannot continue because:\n\n" + message, 10, 80); + ta.setEditable(false); + d.add(ta, "Center"); + Button b = new Button("OK"); + b.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + d.dispose(); + } + }); + d.add(b, "South"); + d.setModal(true); + d.pack(); + d.show(); + new Semaphore().block(); + } + protected String _getClipBoard() { Clipboard cb = Toolkit.getDefaultToolkit().getSystemClipboard(); if (cb == null) return null; @@ -405,7 +430,11 @@ public class AWT extends Platform { if (ret == null) { pf.parse(font); if (pf.name.equals("tty")) pf.name = "monospace"; - ret = new MetricatedFont(pf.name, (pf.bold ? Font.BOLD : 0) | (pf.italic ? Font.ITALIC : 0), pf.size); + + // Java's fonts tend to be, on average, two points smaller than Win32/X11 fonts. This is most acute in + // the proxy password dialog on Linux + ret = new MetricatedFont(pf.name, (pf.bold ? Font.BOLD : 0) | (pf.italic ? Font.ITALIC : 0), pf.size + 2); + fontCache.put(font, ret); } return ret;