-// Copyright 2002 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright 2003 Adam Megacz, see the COPYING file for licensing [GPL]
package org.xwt.plat;
import org.xwt.*;
import java.awt.datatransfer.*;
import java.awt.image.*;
import java.awt.event.*;
-import java.applet.*;
/** Platform subclass for all VM's providing AWT 1.1 functionality */
-public class AWT extends Platform {
+public class AWT extends JVM {
protected String getDescriptiveName() { return "Generic JDK 1.1+ with AWT"; }
protected DoubleBuffer _createDoubleBuffer(int w, int h, Surface owner) { return new AWTDoubleBuffer(w, h); }
protected int _stringWidth(String font, String text) { return getFont(font).metrics.stringWidth(text); }
protected int _getMaxAscent(String font) { return getFont(font).metrics.getMaxAscent(); }
protected int _getMaxDescent(String font) { return getFont(font).metrics.getMaxDescent(); }
- protected boolean _supressDirtyOnResize() { return true; }
+ protected boolean _supressDirtyOnResize() { return false; }
protected void postInit() {
if (Log.on) Log.log(Platform.class, " color depth = " + Toolkit.getDefaultToolkit().getColorModel().getPixelSize() + "bpp");
Rectangle r = gr.getClipBounds();
// ugly hack for Java1.4 dynamicLayout on Win32 -- this catches expansions during smooth resize
- int newwidth = Math.max(r.x - insets.left + r.width, width);
- int newheight = Math.max(r.y - insets.top + r.height, height);
- if (newwidth > width || newheight > height)
+ int newwidth = Math.max(r.x - insets.left + r.width, root.width);
+ int newheight = Math.max(r.y - insets.top + r.height, root.height);
+ if (newwidth > root.width || newheight > root.height)
componentResized(window.getWidth() - insets.left - insets.right, window.getHeight() - insets.top - insets.bottom);
Dirty(r.x - insets.left, r.y - insets.top, r.width, r.height);
public void windowClosed(WindowEvent e) { }
public void windowClosing(WindowEvent e) { Close(); }
public void windowIconified(WindowEvent e) { Minimized(true); }
- public void windowDeiconified(WindowEvent e) { dirty(0, 0, width, height); Minimized(false); }
+ public void windowDeiconified(WindowEvent e) { dirty(0, 0, root.width, root.height); Minimized(false); }
public void windowActivated(WindowEvent e) { Focused(true); }
public void windowDeactivated(WindowEvent e) { Focused(false); }
public void componentMoved(ComponentEvent e) { PosChange(window.getLocation().x + insets.left, window.getLocation().y + insets.top); }
}
public void componentResized(int newwidth, int newheight) {
- int oldwidth = width;
- int oldheight = height;
+ int oldwidth = root.width;
+ int oldheight = root.height;
SizeChange(newwidth, newheight);
// we do this because JVMs which don't clear the background won't force repaints of these areas
// ugly hack for Java1.4 dynamicLayout on Win32 -- this catches contractions during smooth resize
int newwidth = window.getWidth() - insets.left - insets.right;
int newheight = window.getHeight() - insets.top - insets.bottom;
- if (newwidth != width || newheight != height) componentResized(newwidth, newheight);
+ if (newwidth != root.width || newheight != root.height) componentResized(newwidth, newheight);
Move(m.getX() - insets.left, m.getY() - insets.top);
}
protected String[] _listFonts() { return fontList; }
private static String[] fontList;
static {
+ /*
String[] awtfonts = Toolkit.getDefaultToolkit().getFontList();
fontList = new String[awtfonts.length * 4];
for(int i=0; i<awtfonts.length; i++) {
fontList[i * 4 + 2] = awtfonts[i] + "*i";
fontList[i * 4 + 3] = awtfonts[i] + "*bi";
}
+ */
+ fontList = new String[] { };
}
private static Hash fontCache = new Hash();