Commit 2936419d by Tom Tromey Committed by Tom Tromey

Point2D.java: Added protected constructor.

	* 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.

From-SVN: r37988
parent c06093a0
2000-12-03 Tom Tromey <tromey@redhat.com> 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.
* java/awt/AWTError.java: Extend Error, not * java/awt/AWTError.java: Extend Error, not
IllegalStateException. IllegalStateException.
......
...@@ -16,7 +16,7 @@ import java.awt.*; ...@@ -16,7 +16,7 @@ import java.awt.*;
/* Status: Believed complete and correct to JDK 1.2. */ /* 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_FIRST = 1004;
public static final int FOCUS_GAINED = 1004; public static final int FOCUS_GAINED = 1004;
......
...@@ -13,7 +13,7 @@ import java.awt.*; ...@@ -13,7 +13,7 @@ import java.awt.*;
public class KeyEvent extends InputEvent 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_FIRST = 400;
public static final int KEY_LAST = 402; public static final int KEY_LAST = 402;
public static final int KEY_PRESSED = 401; public static final int KEY_PRESSED = 401;
......
/* Copyright (C) 1999 Free Software Foundation /* Copyright (C) 1999, 2000 Free Software Foundation
This file is part of libjava. This file is part of libjava.
...@@ -10,12 +10,12 @@ package java.awt.event; ...@@ -10,12 +10,12 @@ package java.awt.event;
/** /**
* @author Per Bothner <bothner@cygnus.com> * @author Per Bothner <bothner@cygnus.com>
* @date Fenruary, 1999. * @date February, 1999.
*/ */
/* Status: Believed complete and correct. */ /* Status: Believed complete and correct. */
public class WindowAdapter implements WindowListener public abstract class WindowAdapter implements WindowListener
{ {
public void windowActivated (WindowEvent w) { } public void windowActivated (WindowEvent w) { }
public void windowClosed (WindowEvent w) { } public void windowClosed (WindowEvent w) { }
......
...@@ -20,16 +20,16 @@ import java.io.Serializable; ...@@ -20,16 +20,16 @@ import java.io.Serializable;
public class AffineTransform implements Cloneable, Serializable public class AffineTransform implements Cloneable, Serializable
{ {
static final int TYPE_IDENTITY = 0; public static final int TYPE_IDENTITY = 0;
static final int TYPE_FLIP = 64; public static final int TYPE_FLIP = 64;
static final int TYPE_GENERAL_ROTATION = 16; public static final int TYPE_GENERAL_ROTATION = 16;
static final int TYPE_GENERAL_SCALE = 4; public static final int TYPE_GENERAL_SCALE = 4;
static final int TYPE_GENERAL_TRANSFORM = 32; public static final int TYPE_GENERAL_TRANSFORM = 32;
static final int TYPE_MASK_ROTATION = 24; public static final int TYPE_MASK_ROTATION = 24;
static final int TYPE_MASK_SCALE = 6; public static final int TYPE_MASK_SCALE = 6;
static final int TYPE_QUADRANT_ROTATION = 8; public static final int TYPE_QUADRANT_ROTATION = 8;
static final int TYPE_TRANSLATION = 1; public static final int TYPE_TRANSLATION = 1;
static final int TYPE_UNIFORM_SCALE = 2; public static final int TYPE_UNIFORM_SCALE = 2;
public AffineTransform () public AffineTransform ()
{ {
...@@ -300,7 +300,7 @@ public class AffineTransform implements Cloneable, Serializable ...@@ -300,7 +300,7 @@ public class AffineTransform implements Cloneable, Serializable
this.type = 0; // FIXME this.type = 0; // FIXME
} }
public void concatentate (AffineTransform tx) public void concatenate (AffineTransform tx)
{ {
double n00 = m00 * tx.m00 + m01 * tx.m10; double n00 = m00 * tx.m00 + m01 * tx.m10;
double n01 = m00 * tx.m01 + m01 * tx.m11; double n01 = m00 * tx.m01 + m01 * tx.m11;
......
/* Copyright (C) 1999 Free Software Foundation /* Copyright (C) 1999, 2000 Free Software Foundation
This file is part of libjava. This file is part of libjava.
...@@ -10,7 +10,7 @@ package java.awt.geom; ...@@ -10,7 +10,7 @@ package java.awt.geom;
/** /**
* @author Per Bothner <bothner@cygnus.com> * @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. /* Written using online API docs for JDK 1.2 beta from http://www.javasoft.com.
...@@ -37,4 +37,8 @@ public abstract class Dimension2D implements Cloneable ...@@ -37,4 +37,8 @@ public abstract class Dimension2D implements Cloneable
} }
catch (CloneNotSupportedException _) {return null;} catch (CloneNotSupportedException _) {return null;}
} }
protected Dimension2D ()
{
}
} }
...@@ -26,6 +26,10 @@ public abstract class Point2D implements Cloneable ...@@ -26,6 +26,10 @@ public abstract class Point2D implements Cloneable
public abstract void setLocation (double x, double y); public abstract void setLocation (double x, double y);
protected Point2D ()
{
}
public void setLocation (Point2D pt) { setLocation(pt.getX(), pt.getY()); } public void setLocation (Point2D pt) { setLocation(pt.getX(), pt.getY()); }
static public double distanceSq (double X1, double Y1, double X2, double Y2) static public double distanceSq (double X1, double Y1, double X2, double Y2)
...@@ -71,6 +75,14 @@ public abstract class Point2D implements Cloneable ...@@ -71,6 +75,14 @@ public abstract class Point2D implements Cloneable
catch (CloneNotSupportedException _) {return null;} 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 static class Double extends Point2D
{ {
public double x; public double x;
...@@ -143,6 +155,12 @@ public abstract class Point2D implements Cloneable ...@@ -143,6 +155,12 @@ public abstract class Point2D implements Cloneable
this.y = (float) y; this.y = (float) y;
} }
public void setLocation (float x, float y)
{
this.x = x;
this.y = y;
}
public String toString () public String toString ()
{ {
return "(" + x + ", " + y + ")"; return "(" + x + ", " + y + ")";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment