reorganized file layout (part 2: edits)
[org.ibex.core.git] / src / org / ibex / plat / AWT.java
index c7a1dce..8c8956d 100644 (file)
@@ -9,6 +9,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 +116,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 +131,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 +216,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 +230,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 +240,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<y2; y++) {
@@ -330,8 +333,8 @@ public class AWT extends JVM {
             if (oldfill != root.fillcolor) {
                 oldfill = root.fillcolor;
                 window.setBackground((root.fillcolor & 0xFF000000) == 0 ?
-                                     Color.white :
-                                     new Color((root.fillcolor >> 16) & 0xff,
+                                     java.awt.Color.white :
+                                     new java.awt.Color((root.fillcolor >> 16) & 0xff,
                                                (root.fillcolor >> 8) & 0xff,
                                                (root.fillcolor) & 0xff));
             }