OSDN Git Service

2006-02-23 Scott Gilbertson <scottg@mantatest.com>
authorsgilbertson <sgilbertson@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Feb 2006 20:50:49 +0000 (20:50 +0000)
committersgilbertson <sgilbertson@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Feb 2006 20:50:49 +0000 (20:50 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@111395 138bc75d-0d04-0410-961f-82ee72b054a4

libjava/ChangeLog
libjava/classpath/gnu/java/awt/peer/GLightweightPeer.java
libjava/classpath/java/awt/Graphics.java
libjava/gnu/awt/j2d/Graphics2DImpl.java
libjava/gnu/awt/j2d/IntegerGraphicsState.java
libjava/gnu/awt/xlib/XCanvasPeer.java

index d96d031..6804217 100644 (file)
@@ -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
index 5252e80..25735bb 100644 (file)
@@ -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() {}
 
index a28ca7e..09bf7ca 100644 (file)
@@ -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);
   }
 
index dd46e7f..5091af6 100644 (file)
@@ -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;
index 4eb4c61..bcfacd0 100644 (file)
@@ -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;
index 74e0dc2..097ad0e 100644 (file)
@@ -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 ()