This is the mail archive of the java-patches@sources.redhat.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: More AWT updates wrt 1.2


This patch fixes some minor AWT divergences from 1.2.
I'm checking it in.

2000-12-03  Tom Tromey  <tromey@redhat.com>

	* java/awt/geom/Point2D.java: Added protected constructor.
	(equals): New method.
	(Float.setLocation(float,float)): New method.
	* java/awt/geom/Dimension2D.java: Added protected constructor.
	* java/awt/geom/AffineTransform.java: Made all constants public.
	(concatenate): Fixed typo in name.
	* java/awt/event/WindowAdapter.java: Class now abstract.
	* java/awt/event/KeyEvent.java (CHAR_UNDEFINED): Now final.
	* java/awt/event/FocusEvent.java: Extend ComponentEvent, not
	AWTEvent.

Tom

Index: java/awt/event/FocusEvent.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/event/FocusEvent.java,v
retrieving revision 1.2
diff -u -r1.2 FocusEvent.java
--- FocusEvent.java	2000/07/12 03:32:06	1.2
+++ FocusEvent.java	2000/12/04 02:23:15
@@ -16,7 +16,7 @@
 
 /* Status: Believed complete and correct to JDK 1.2.  */
 
-public class FocusEvent extends AWTEvent
+public class FocusEvent extends ComponentEvent
 {
   public static final int FOCUS_FIRST = 1004;
   public static final int FOCUS_GAINED = 1004;
Index: java/awt/event/KeyEvent.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/event/KeyEvent.java,v
retrieving revision 1.6
diff -u -r1.6 KeyEvent.java
--- KeyEvent.java	2000/08/09 13:01:44	1.6
+++ KeyEvent.java	2000/12/04 02:23:15
@@ -13,7 +13,7 @@
 
 public class KeyEvent extends InputEvent
 {
-  public static char CHAR_UNDEFINED = 0;;
+  public static final char CHAR_UNDEFINED = 0;;
   public static final int KEY_FIRST = 400;
   public static final int KEY_LAST = 402;
   public static final int KEY_PRESSED = 401;
Index: java/awt/event/WindowAdapter.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/event/WindowAdapter.java,v
retrieving revision 1.3
diff -u -r1.3 WindowAdapter.java
--- WindowAdapter.java	2000/03/07 19:55:25	1.3
+++ WindowAdapter.java	2000/12/04 02:23:15
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libjava.
 
@@ -10,12 +10,12 @@
 
 /**
  * @author Per Bothner <bothner@cygnus.com>
- * @date Fenruary, 1999.
+ * @date February, 1999.
  */
 
 /* Status:  Believed complete and correct. */
 
-public class WindowAdapter implements WindowListener
+public abstract class WindowAdapter implements WindowListener
 {
   public void windowActivated (WindowEvent w) { }
   public void windowClosed (WindowEvent w) { }
Index: java/awt/geom/AffineTransform.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/geom/AffineTransform.java,v
retrieving revision 1.1
diff -u -r1.1 AffineTransform.java
--- AffineTransform.java	2000/07/23 00:24:14	1.1
+++ AffineTransform.java	2000/12/04 02:23:16
@@ -20,16 +20,16 @@
 
 public class AffineTransform implements Cloneable, Serializable
 {
-  static final int TYPE_IDENTITY = 0;
-  static final int TYPE_FLIP = 64;
-  static final int TYPE_GENERAL_ROTATION = 16;
-  static final int TYPE_GENERAL_SCALE = 4;
-  static final int TYPE_GENERAL_TRANSFORM = 32;
-  static final int TYPE_MASK_ROTATION = 24;
-  static final int TYPE_MASK_SCALE = 6;
-  static final int TYPE_QUADRANT_ROTATION = 8;
-  static final int TYPE_TRANSLATION = 1;
-  static final int TYPE_UNIFORM_SCALE = 2;
+  public static final int TYPE_IDENTITY = 0;
+  public static final int TYPE_FLIP = 64;
+  public static final int TYPE_GENERAL_ROTATION = 16;
+  public static final int TYPE_GENERAL_SCALE = 4;
+  public static final int TYPE_GENERAL_TRANSFORM = 32;
+  public static final int TYPE_MASK_ROTATION = 24;
+  public static final int TYPE_MASK_SCALE = 6;
+  public static final int TYPE_QUADRANT_ROTATION = 8;
+  public static final int TYPE_TRANSLATION = 1;
+  public static final int TYPE_UNIFORM_SCALE = 2;
 
   public AffineTransform ()
   {
@@ -300,7 +300,7 @@
     this.type = 0;		// FIXME
   }
 
-  public void concatentate (AffineTransform tx)
+  public void concatenate (AffineTransform tx)
   {
     double n00 = m00 * tx.m00 + m01 * tx.m10;
     double n01 = m00 * tx.m01 + m01 * tx.m11;
Index: java/awt/geom/Dimension2D.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/geom/Dimension2D.java,v
retrieving revision 1.4
diff -u -r1.4 Dimension2D.java
--- Dimension2D.java	2000/08/09 13:01:44	1.4
+++ Dimension2D.java	2000/12/04 02:23:16
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libjava.
 
@@ -10,7 +10,7 @@
 
 /**
  * @author Per Bothner <bothner@cygnus.com>
- * @date Fenruary, 1999.
+ * @date February, 1999.
  */
 
 /* Written using online API docs for JDK 1.2 beta from http://www.javasoft.com.
@@ -36,5 +36,9 @@
       return super.clone ();
     } 
     catch (CloneNotSupportedException _) {return null;}
+  }
+
+  protected Dimension2D ()
+  {
   }
 }
Index: java/awt/geom/Point2D.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/geom/Point2D.java,v
retrieving revision 1.5
diff -u -r1.5 Point2D.java
--- Point2D.java	2000/08/09 13:01:44	1.5
+++ Point2D.java	2000/12/04 02:23:16
@@ -26,6 +26,10 @@
 
   public abstract void setLocation (double x, double y);
 
+  protected Point2D ()
+  {
+  }
+
   public void setLocation (Point2D pt)  { setLocation(pt.getX(), pt.getY()); }
 
   static public double distanceSq (double X1, double Y1, double X2, double Y2)
@@ -71,6 +75,14 @@
     catch (CloneNotSupportedException _) {return null;}
   }
 
+  public boolean equals (Object o)
+  {
+    if (! (o instanceof Point2D))
+      return false;
+    Point2D p = (Point2D) o;
+    return getX () == p.getX () && getY () == p.getY ();
+  }
+
   public static class Double extends Point2D
   {
     public double x;
@@ -141,6 +153,12 @@
     {
       this.x = (float) x;
       this.y = (float) y;
+    }
+
+    public void setLocation (float x, float y)
+    {
+      this.x = x;
+      this.y = y;
     }
 
     public String toString ()

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]