diff options
-rw-r--r-- | libjava/ChangeLog | 13 | ||||
-rw-r--r-- | libjava/classpath/gnu/java/awt/peer/GLightweightPeer.java | 7 | ||||
-rw-r--r-- | libjava/classpath/java/awt/Graphics.java | 3 | ||||
-rw-r--r-- | libjava/gnu/awt/j2d/Graphics2DImpl.java | 6 | ||||
-rw-r--r-- | libjava/gnu/awt/j2d/IntegerGraphicsState.java | 6 | ||||
-rw-r--r-- | libjava/gnu/awt/xlib/XCanvasPeer.java | 6 |
6 files changed, 37 insertions, 4 deletions
diff --git a/libjava/ChangeLog b/libjava/ChangeLog index d96d031..6804217 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,16 @@ +2006-02-23 Scott Gilbertson <scottg@mantatest.com> + + * gnu/awt/j2d/IntegerGraphicsState.java (getClip): Clone clip + before returning, handle null clip. + (getClipBounds): Handle null clip. + * gnu/awt/j2d/Graphics2DImpl.java (clipRect): Handle null clip. + * gnu/awt/xlib/XCanvasPeer.java (): + (getLocationOnScreen): Implement. + * classpath/gnu/java/awt/peer/GLightweightPeer.java + (repaint): Merged with Classpath. + * classpath/java/awt/Graphics.java (hitClip): Merged with + Classpath. + 2006-02-21 Robert Schuster <robertschuster@fsfe.org> * link.cc: Added variant of create_error_method that diff --git a/libjava/classpath/gnu/java/awt/peer/GLightweightPeer.java b/libjava/classpath/gnu/java/awt/peer/GLightweightPeer.java index 5252e80..25735bb 100644 --- a/libjava/classpath/gnu/java/awt/peer/GLightweightPeer.java +++ b/libjava/classpath/gnu/java/awt/peer/GLightweightPeer.java @@ -227,7 +227,12 @@ public class GLightweightPeer public void print(Graphics graphics) {} - public void repaint(long tm, int x, int y, int width, int height) {} + public void repaint(long tm, int x, int y, int width, int height) + { + Component p = comp.getParent (); + if(p != null) + p.repaint(tm,x+comp.getX(),y+comp.getY(),width,height); + } public void requestFocus() {} diff --git a/libjava/classpath/java/awt/Graphics.java b/libjava/classpath/java/awt/Graphics.java index a28ca7e..09bf7ca 100644 --- a/libjava/classpath/java/awt/Graphics.java +++ b/libjava/classpath/java/awt/Graphics.java @@ -617,6 +617,9 @@ public abstract class Graphics */ public boolean hitClip(int x, int y, int width, int height) { + Shape clip = getClip(); + if (clip == null) + return true; return getClip().intersects(x, y, width, height); } diff --git a/libjava/gnu/awt/j2d/Graphics2DImpl.java b/libjava/gnu/awt/j2d/Graphics2DImpl.java index dd46e7f..5091af6 100644 --- a/libjava/gnu/awt/j2d/Graphics2DImpl.java +++ b/libjava/gnu/awt/j2d/Graphics2DImpl.java @@ -175,6 +175,12 @@ public class Graphics2DImpl extends Graphics2D implements Cloneable public void clipRect(int x, int y, int width, int height) { Shape clip = state.getClip(); + if (clip == null) + { + clip = new Rectangle (x,y,width,height); + setClip (clip); + return; + } if (clip instanceof Rectangle) { Rectangle clipRect = (Rectangle) clip; diff --git a/libjava/gnu/awt/j2d/IntegerGraphicsState.java b/libjava/gnu/awt/j2d/IntegerGraphicsState.java index 4eb4c61..bcfacd0 100644 --- a/libjava/gnu/awt/j2d/IntegerGraphicsState.java +++ b/libjava/gnu/awt/j2d/IntegerGraphicsState.java @@ -132,9 +132,11 @@ public class IntegerGraphicsState extends AbstractGraphicsState public Shape getClip() { + if (clip == null) + return null; if (clip instanceof Rectangle) { - Rectangle clipRect = (Rectangle) clip; + Rectangle clipRect = (Rectangle) ((Rectangle) clip).clone(); clipRect.x -= tx; clipRect.y -= ty; return clipRect; @@ -149,6 +151,8 @@ public class IntegerGraphicsState extends AbstractGraphicsState public Rectangle getClipBounds() { + if (clip == null) + return null; Rectangle clipRect = clip.getBounds(); clipRect.x -= tx; diff --git a/libjava/gnu/awt/xlib/XCanvasPeer.java b/libjava/gnu/awt/xlib/XCanvasPeer.java index 74e0dc2..097ad0e 100644 --- a/libjava/gnu/awt/xlib/XCanvasPeer.java +++ b/libjava/gnu/awt/xlib/XCanvasPeer.java @@ -247,10 +247,12 @@ public class XCanvasPeer implements CanvasPeer gfx2d.setColor(component.getBackground()); return gfx2d; } - + + private Rectangle locationBounds; public Point getLocationOnScreen() { - throw new UnsupportedOperationException("FIXME, not implemented"); + locationBounds = window.getBounds (locationBounds); + return new Point (locationBounds.x,locationBounds.y); } public Dimension getMinimumSize () |