2004/01/17 07:30:31
[org.ibex.core.git] / src / org / xwt / plat / AWT.java
index 875641a..7c775bb 100644 (file)
@@ -5,6 +5,7 @@ import org.xwt.*;
 import org.xwt.util.*;
 import java.net.*;
 import java.io.*;
+import org.xwt.js.*;
 import java.util.*;
 import java.awt.*;
 import java.awt.datatransfer.*;
@@ -16,7 +17,7 @@ public class AWT extends JVM {
 
     protected String getDescriptiveName() { return "Generic JDK 1.1+ with AWT"; }
     protected PixelBuffer _createPixelBuffer(int w, int h, Surface owner) { return new AWTPixelBuffer(w, h); }
-    protected Picture _createPicture(Stream r) { return new AWTPicture(r); }
+    protected Picture _createPicture(JS r) { return new AWTPicture(r); }
     protected int _getScreenWidth() { return Toolkit.getDefaultToolkit().getScreenSize().width; }
     protected int _getScreenHeight() { return Toolkit.getDefaultToolkit().getScreenSize().height; }
     protected Surface _createSurface(Box b, boolean framed) { return new AWTSurface(b, framed); }
@@ -161,7 +162,7 @@ public class AWT extends JVM {
         private static ColorModel cmodel = new DirectColorModel(32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
         
         boolean initialized = false;
-        public AWTPicture(Stream r) { super(r); }
+        public AWTPicture(JS r) { super(r); }
         public void init() {
             if (initialized) return;
             initialized = true;
@@ -295,6 +296,8 @@ public class AWT extends JVM {
 
         class InnerFrame extends Frame {
             public InnerFrame() throws java.lang.UnsupportedOperationException { }
+            public Dimension getMinimumSize() {
+                return new Dimension(root == null ? 0 : root.minwidth, root == null ? 0 : root.minheight); }
             public void update(Graphics gr) { paint(gr); }
             public void paint(Graphics gr) {
                 Rectangle r = gr.getClipBounds();
@@ -312,6 +315,8 @@ public class AWT extends JVM {
 
         class InnerWindow extends Window {
             public InnerWindow() throws java.lang.UnsupportedOperationException { super(new Frame()); }
+            public Dimension getMinimumSize() {
+                return new Dimension(root == null ? 0 : root.minwidth, root == null ? 0 : root.minheight); }
             public void update(Graphics gr) { paint(gr); }
             public void paint(Graphics gr) {
                 Rectangle r = gr.getClipBounds();
@@ -319,6 +324,8 @@ public class AWT extends JVM {
             }
         }
 
+        public void setMinimumSize(int minx, int miny, boolean resizable) { if (frame != null) frame.setResizable(resizable); }
+
         public void render() {
             // useful optimizatin;
             window.setBackground((root.fillcolor & 0xFF000000) == 0 ?