X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Fplat%2FAWT.java;h=fc08b1d4998b446c07577c7550dd43046153a4d5;hb=ac0b1db223ee818fa2fe812d8d2e18089781ee6a;hp=c7a1dce9698f0b58639ff1ddc5b24ca9149308f4;hpb=fd6731e682bcf3801104fc3c35c808ba241b1739;p=org.ibex.core.git diff --git a/src/org/ibex/plat/AWT.java b/src/org/ibex/plat/AWT.java index c7a1dce..fc08b1d 100644 --- a/src/org/ibex/plat/AWT.java +++ b/src/org/ibex/plat/AWT.java @@ -1,7 +1,6 @@ // Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL] package org.ibex.plat; -import org.ibex.*; import org.ibex.util.*; import java.io.*; import org.ibex.js.*; @@ -9,6 +8,9 @@ import java.awt.*; import java.awt.datatransfer.*; import java.awt.image.*; import java.awt.event.*; +import org.ibex.graphics.*; +import org.ibex.core.*; +import org.ibex.net.*; /** Platform subclass for all VM's providing AWT 1.1 functionality */ public class AWT extends JVM { @@ -113,8 +115,8 @@ public class AWT extends JVM { // Inner Classes ///////////////////////////////////////////////////////////////////////////////////// - protected org.ibex.Font.Glyph _createGlyph(org.ibex.Font f, char c) { return new AWTGlyph(f, c); } - protected static class AWTGlyph extends org.ibex.Font.Glyph { + protected org.ibex.graphics.Font.Glyph _createGlyph(org.ibex.graphics.Font f, char c) { return new AWTGlyph(f, c); } + protected static class AWTGlyph extends org.ibex.graphics.Font.Glyph { private Image i = null; private static ColorModel cmodel = new DirectColorModel(32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000); @@ -128,7 +130,7 @@ public class AWT extends JVM { }; */ - public AWTGlyph(org.ibex.Font f, char c) { super(f, c); } + public AWTGlyph(org.ibex.graphics.Font f, char c) { super(f, c); } Image getImage() { if (i == null && isLoaded) { @@ -213,11 +215,11 @@ public class AWT extends JVM { } /** implemented with java.awt 1.1's setXORMode() */ - public void drawGlyph(org.ibex.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) { + public void drawGlyph(org.ibex.graphics.Font.Glyph source, int dx, int dy, int cx1, int cy1, int cx2, int cy2, int rgb) { // XOR the target region - g.setXORMode(new Color((rgb & 0x00ff0000) >> 16, (rgb & 0x0000ff00) >> 8, rgb & 0x000000ff)); - g.setColor(new Color(0x0, 0x0, 0x0)); + g.setXORMode(new java.awt.Color((rgb & 0x00ff0000) >> 16, (rgb & 0x0000ff00) >> 8, rgb & 0x000000ff)); + g.setColor(new java.awt.Color(0x0, 0x0, 0x0)); g.fillRect(cx1, cy1, cx2 - cx1, cy2 - cy1); // blacken the area we want the glyph to cover @@ -227,8 +229,8 @@ public class AWT extends JVM { g.setClip(0, 0, i.getWidth(null), i.getHeight(null)); // XOR back, turning black into the chosen rgb color - g.setXORMode(new Color((rgb & 0x00ff0000) >> 16, (rgb & 0x0000ff00) >> 8, rgb & 0x000000ff)); - g.setColor(new Color(0x0, 0x0, 0x0)); + g.setXORMode(new java.awt.Color((rgb & 0x00ff0000) >> 16, (rgb & 0x0000ff00) >> 8, rgb & 0x000000ff)); + g.setColor(new java.awt.Color(0x0, 0x0, 0x0)); g.fillRect(cx1, cy1, cx2 - cx1, cy2 - cy1); // restore the graphics context @@ -237,7 +239,7 @@ public class AWT extends JVM { // FIXME: try to use os acceleration public void fillTrapezoid(int x1, int x2, int y1, int x3, int x4, int y2, int argb) { - g.setColor(new Color((argb & 0x00FF0000) >> 16, (argb & 0x0000FF00) >> 8, (argb & 0x000000FF))); + g.setColor(new java.awt.Color((argb & 0x00FF0000) >> 16, (argb & 0x0000FF00) >> 8, (argb & 0x000000FF))); if (x1 == x3 && x2 == x4) { g.fillRect(x1, y1, x4 - x1, y2 - y1); } else for(int y=y1; y> 16) & 0xff, + java.awt.Color.white : + new java.awt.Color((root.fillcolor >> 16) & 0xff, (root.fillcolor >> 8) & 0xff, (root.fillcolor) & 0xff)); }