diff options
author | Scott Gilbertson <scottg@mantatest.com> | 2006-02-23 20:50:49 +0000 |
---|---|---|
committer | Scott Gilbertson <sgilbertson@gcc.gnu.org> | 2006-02-23 20:50:49 +0000 |
commit | cbb5e20166ec05d529f819e12e0727ca6ff1749a (patch) | |
tree | e7dbeee69e81b207b0965b99b096bca140842b68 /libjava/gnu/awt | |
parent | 072b06f2dce99ea6fe42d7ec20ab152019c5f40b (diff) | |
download | gcc-cbb5e20166ec05d529f819e12e0727ca6ff1749a.zip gcc-cbb5e20166ec05d529f819e12e0727ca6ff1749a.tar.gz gcc-cbb5e20166ec05d529f819e12e0727ca6ff1749a.tar.bz2 |
IntegerGraphicsState.java (getClip): Clone clip before returning, handle null clip.
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.
From-SVN: r111395
Diffstat (limited to 'libjava/gnu/awt')
-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 |
3 files changed, 15 insertions, 3 deletions
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 () |