X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fplat%2FAWT.java;h=f3f53d2517457e365ca7289a8ef1be8c2ab0a016;hp=d93758874b684fb9212794f463a71c1828c6aa6b;hb=05d23fde131a7d19b378c632c6cc6b7924d8ab4d;hpb=81eda5b4fc7bdf083aa6af02c971d3a75a3c39d5 diff --git a/src/org/ibex/plat/AWT.java b/src/org/ibex/plat/AWT.java index d937588..f3f53d2 100644 --- a/src/org/ibex/plat/AWT.java +++ b/src/org/ibex/plat/AWT.java @@ -302,7 +302,8 @@ public class AWT extends JVM { public void setIcon(Picture i) { if (frame != null) frame.setIconImage(((AWTPicture)i).i); } public void _setSize(int width, int height) { g = null; - window.setSize(width + (insets.left + insets.right), height + (insets.top + insets.bottom)); } + //window.setSize(width + (insets.left + insets.right), height + (insets.top + insets.bottom)); + } public void setInvisible(boolean b) { window.setVisible(!b); } protected void _setMinimized(boolean b) { if (Log.on) Log.info(this, "JDK 1.1 platforms cannot minimize or unminimize windows"); } protected void _setMaximized(boolean b) { @@ -318,22 +319,29 @@ public class AWT extends JVM { class InnerFrame extends Frame { public InnerFrame() throws java.lang.UnsupportedOperationException { } public Dimension getMinimumSize() { return new Dimension(root.minwidth(), root.minheight()); } - public void update(Graphics gr) { paint(gr); } + public void update(Graphics gr) { + Rectangle r = gr.getClipBounds(); + super.update(gr); + dirtify(r); + } public void paint(Graphics gr) { // Mac OS X Jdk1.4 Bug: after a componentResized(), you must wait for the paint() before you redraw Rectangle r = gr.getClipBounds(); - + super.paint(gr); + dirtify(r); + } + private void dirtify(java.awt.Rectangle r) { + if (r != null) { + Dirty(r.x - insets.left, r.y - insets.top, r.width, r.height); + } else { + Dirty(0, 0, + Math.max(getWidth() - insets.left - insets.right, root.width), + Math.min(getHeight() - insets.top - insets.bottom, root.height)); + } // ugly hack for Java1.4 dynamicLayout on Win32 -- this catches expansions during smooth resize - int newwidth = Math.max(r.x - insets.left + r.width, root.width); - int newheight = Math.max(r.y - insets.top + r.height, root.height); - if (newwidth > root.width || newheight > root.height) - componentResized(window.getWidth() - insets.left - insets.right, - window.getHeight() - insets.top - insets.bottom); - - //Dirty(r.x - insets.left, r.y - insets.top, r.width, r.height); - g = gr; - blit(r.x - insets.left, r.y - insets.top, r.width, r.height); - g.setClip(0, 0, getWidth(), getHeight()); + int newwidth = Math.max(getWidth() - insets.left - insets.right, root.width); + int newheight = Math.max(getHeight() - insets.top - insets.bottom, root.height); + if (newwidth != root.width || newheight != root.height) componentResized(newwidth, newheight); } } @@ -448,6 +456,7 @@ public class AWT extends JVM { SizeChange(newwidth, newheight); //if (newwidth > root.width) Dirty(root.width, 0, newwidth-root.width, newheight); //if (newheight > root.height) Dirty(0, root.height, newwidth, newheight-root.height); + Refresh(); } public void keyTyped(KeyEvent k) { }