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
This commit is contained in:
Tom Tromey
2000-12-04 02:27:21 +00:00
committed by Tom Tromey
parent c06093a0a3
commit 2936419d1c
7 changed files with 51 additions and 18 deletions
+18
View File
@@ -26,6 +26,10 @@ public abstract class Point2D implements Cloneable
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 @@ public abstract class Point2D implements Cloneable
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;
@@ -143,6 +155,12 @@ public abstract class Point2D implements Cloneable
this.y = (float) y;
}
public void setLocation (float x, float y)
{
this.x = x;
this.y = y;
}
public String toString ()
{
return "(" + x + ", " + y + ")";