-// 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.*;
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 PixelBuffer _createDoubleBuffer(int w, int h, Surface owner) { return new AWTDoubleBuffer(w, h); }
protected Picture _createPicture(int[] b, int w, int h) { return new AWTPicture(b, w, h); }
protected int _getScreenWidth() { return Toolkit.getDefaultToolkit().getScreenSize().width; }
protected int _getScreenHeight() { return Toolkit.getDefaultToolkit().getScreenSize().height; }
}
}
- protected static class AWTDoubleBuffer extends DoubleBuffer {
+ protected static class AWTPixelBuffer extends DoubleBuffer {
protected Image i = null;
protected Graphics g = null;
/** JDK1.1 platforms require that a component be associated with each off-screen buffer */
static Component component = null;
- protected AWTDoubleBuffer() { }
- public AWTDoubleBuffer(int w, int h) {
- synchronized(AWTDoubleBuffer.class) {
+ protected AWTPixelBuffer() { }
+ public AWTPixelBuffer(int w, int h) {
+ synchronized(AWTPixelBuffer.class) {
if (component == null) {
component = new Frame();
component.setVisible(false);
protected static class AWTSurface extends Surface
implements MouseListener, MouseMotionListener, KeyListener, ComponentListener, WindowListener {
- public void blit(DoubleBuffer s, int sx, int sy, int dx, int dy, int dx2, int dy2) {
+ public void blit(PixelBuffer s, int sx, int sy, int dx, int dy, int dx2, int dy2) {
if (ourGraphics == null) ourGraphics = window.getGraphics();
- ourGraphics.drawImage(((AWTDoubleBuffer)s).i, dx + insets.left, dy + insets.top, dx2 + insets.left, dy2 + insets.top,
+ ourGraphics.drawImage(((AWTPixelBuffer)s).i, dx + insets.left, dy + insets.top, dx2 + insets.left, dy2 + insets.top,
sx, sy, sx + (dx2 - dx), sy + (dy2 - dy), null);
}