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:
parent
c06093a0a3
commit
2936419d1c
7 changed files with 51 additions and 18 deletions
|
@ -16,7 +16,7 @@ import java.awt.*;
|
|||
|
||||
/* 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;
|
||||
|
|
|
@ -13,7 +13,7 @@ import java.awt.*;
|
|||
|
||||
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;
|
||||
|
|
|
@ -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 @@ package java.awt.event;
|
|||
|
||||
/**
|
||||
* @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) { }
|
||||
|
|
|
@ -20,16 +20,16 @@ import java.io.Serializable;
|
|||
|
||||
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 @@ public class AffineTransform implements Cloneable, Serializable
|
|||
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;
|
||||
|
|
|
@ -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 @@ package java.awt.geom;
|
|||
|
||||
/**
|
||||
* @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.
|
||||
|
@ -37,4 +37,8 @@ public abstract class Dimension2D implements Cloneable
|
|||
}
|
||||
catch (CloneNotSupportedException _) {return null;}
|
||||
}
|
||||
|
||||
protected Dimension2D ()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 + ")";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue