projects
/
org.ibex.core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix infinite loop
[org.ibex.core.git]
/
src
/
org
/
ibex
/
plat
/
AWT.java
diff --git
a/src/org/ibex/plat/AWT.java
b/src/org/ibex/plat/AWT.java
index
c7a1dce
..
0f6143a
100644
(file)
--- a/
src/org/ibex/plat/AWT.java
+++ b/
src/org/ibex/plat/AWT.java
@@
-1,7
+1,9
@@
-// Copyright 2004 Adam Megacz, see the COPYING file for licensing [GPL]
+// Copyright 2000-2005 the Contributors, as shown in the revision logs.
+// Licensed under the GNU General Public License version 2 ("the License").
+// You may not use this file except in compliance with the License.
+
package org.ibex.plat;
package org.ibex.plat;
-import org.ibex.*;
import org.ibex.util.*;
import java.io.*;
import org.ibex.js.*;
import org.ibex.util.*;
import java.io.*;
import org.ibex.js.*;
@@
-9,6
+11,9
@@
import java.awt.*;
import java.awt.datatransfer.*;
import java.awt.image.*;
import java.awt.event.*;
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 {
/** Platform subclass for all VM's providing AWT 1.1 functionality */
public class AWT extends JVM {
@@
-113,8
+118,8
@@
public class AWT extends JVM {
// Inner Classes /////////////////////////////////////////////////////////////////////////////////////
// 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);
private Image i = null;
private static ColorModel cmodel = new DirectColorModel(32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
@@
-128,7
+133,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) {
Image getImage() {
if (i == null && isLoaded) {
@@
-213,11
+218,11
@@
public class AWT extends JVM {
}
/** implemented with java.awt 1.1's setXORMode() */
}
/** 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
// 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
g.fillRect(cx1, cy1, cx2 - cx1, cy2 - cy1);
// blacken the area we want the glyph to cover
@@
-227,8
+232,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.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
g.fillRect(cx1, cy1, cx2 - cx1, cy2 - cy1);
// restore the graphics context
@@
-237,7
+242,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) {
// 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++) {
if (x1 == x3 && x2 == x4) {
g.fillRect(x1, y1, x4 - x1, y2 - y1);
} else for(int y=y1; y<y2; y++) {
@@
-330,8
+335,8
@@
public class AWT extends JVM {
if (oldfill != root.fillcolor) {
oldfill = root.fillcolor;
window.setBackground((root.fillcolor & 0xFF000000) == 0 ?
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));
}
(root.fillcolor >> 8) & 0xff,
(root.fillcolor) & 0xff));
}