Patch: java.awt.event

Tom Tromey tromey@cygnus.com
Sat Apr 8 21:10:00 GMT 2000


Today I wrote almost everything in java.awt.event (easier than it
sounds).  I'm checking it in.  Don't get your hopes up -- this doesn't
mean I'm writing AWT.  I just felt like doing something.

2000-04-08  Tom Tromey  <tromey@cygnus.com>

	* Makefile.in: Rebuilt.
	* Makefile.am (awt_java_source_files): Added new files.
	* java/awt/IllegalComponentStateException.java: New file.
	* java/awt/ItemSelectable.java: New file.
	* java/awt/event/WindowEvent.java: Finished.
	* java/awt/event/TextEvent.java: Finished.
	* java/awt/event/ContainerEvent.java: New file.
	* java/awt/Component.java (getX, getY): New methods.
	* java/awt/event/PaintEvent.java: New file.
	* java/awt/event/MouseEvent.java: New file.
	* java/awt/ActiveEvent.java: New file.
	* java/awt/event/KeyEvent.java: Finished.
	* java/awt/event/ItemEvent.java: New file.
	* java/awt/Adjustable.java: New file.
	* java/awt/event/InputMethodEvent.java: New file.
	* java/awt/event/InputEvent.java: Finished.
	* java/awt/event/FocusEvent.java: New file.
	* java/awt/event/MouseMotionAdapter.java: New file.
	* java/awt/event/MouseAdapter.java: New file.
	* java/awt/event/KeyAdapter.java: New file.
	* java/awt/event/FocusAdapter.java: New file.
	* java/awt/event/ContainerAdapter.java: New file.
	* java/awt/event/ComponentEvent.java: Finished.
	* java/awt/event/AdjustmentEvent.java: New file.
	* java/awt/event/ComponentAdapter.java: New file.
	* java/awt/event/ActionEvent.java: Finished.
	* java/awt/event/MouseMotionListener.java: New file.
	* java/awt/event/MouseListener.java: New file.
	* java/awt/event/ItemListener.java: New file.
	* java/awt/event/InputMethodListener.java: New file.
	* java/awt/event/ContainerListener.java: New file.
	* java/awt/event/FocusListener.java: New file.
	* java/awt/event/ComponentListener.java: New file.
	* java/awt/event/AWTEventListener.java: New file.
	* java/awt/event/AdjustmentListener.java: New file.

Tom

Index: Makefile.am
===================================================================
RCS file: /cvs/java/libgcj/libjava/Makefile.am,v
retrieving revision 1.56
diff -u -r1.56 Makefile.am
--- Makefile.am	2000/04/06 00:29:39	1.56
+++ Makefile.am	2000/04/09 04:01:18
@@ -488,49 +488,77 @@
 ## hand.
 special_java_source_files = java/lang/Class.java java/lang/Object.java
 
-awt_java_source_files = \
+awt_java_source_files =	\
+java/awt/AWTError.java \
 java/awt/AWTEvent.java \
 java/awt/AWTException.java \
+java/awt/ActiveEvent.java \
+java/awt/Adjustable.java \
 java/awt/BorderLayout.java \
-java/awt/Component.java \
 java/awt/Color.java \
-java/awt/Container.java \
-java/awt/Dimension.java \
+java/awt/Component.java	\
+java/awt/Container.java	\
+java/awt/Dimension.java	\
 java/awt/Event.java \
 java/awt/Font.java \
 java/awt/Frame.java \
 java/awt/Graphics.java \
+java/awt/IllegalComponentStateException.java \
 java/awt/Image.java \
+java/awt/ItemSelectable.java \
 java/awt/LayoutManager.java \
 java/awt/LayoutManager2.java \
 java/awt/Menu.java \
 java/awt/MenuBar.java \
-java/awt/MenuItem.java \
 java/awt/MenuComponent.java \
 java/awt/MenuContainer.java \
+java/awt/MenuItem.java \
 java/awt/Paint.java \
 java/awt/PaintContext.java \
 java/awt/Point.java \
-java/awt/Rectangle.java \
+java/awt/Rectangle.java	\
 java/awt/Shape.java \
 java/awt/TextArea.java \
 java/awt/TextComponent.java \
 java/awt/Toolkit.java \
 java/awt/Transparency.java \
 java/awt/Window.java \
-java/awt/event/ActionEvent.java \
+java/awt/event/AWTEventListener.java \
+java/awt/event/ActionEvent.java	\
 java/awt/event/ActionListener.java \
+java/awt/event/AdjustmentEvent.java \
+java/awt/event/AdjustmentListener.java \
+java/awt/event/ComponentAdapter.java \
 java/awt/event/ComponentEvent.java \
+java/awt/event/ComponentListener.java \
+java/awt/event/ContainerAdapter.java \
+java/awt/event/ContainerEvent.java \
+java/awt/event/ContainerListener.java \
+java/awt/event/FocusAdapter.java \
+java/awt/event/FocusEvent.java \
+java/awt/event/FocusListener.java \
 java/awt/event/InputEvent.java \
+java/awt/event/InputMethodEvent.java \
+java/awt/event/InputMethodListener.java	\
+java/awt/event/InvocationEvent.java \
+java/awt/event/ItemEvent.java \
+java/awt/event/ItemListener.java \
+java/awt/event/KeyAdapter.java \
 java/awt/event/KeyEvent.java \
-java/awt/event/KeyListener.java \
+java/awt/event/KeyListener.java	\
+java/awt/event/MouseAdapter.java \
+java/awt/event/MouseEvent.java \
+java/awt/event/MouseListener.java \
+java/awt/event/MouseMotionAdapter.java \
+java/awt/event/MouseMotionListener.java	\
+java/awt/event/PaintEvent.java \
 java/awt/event/TextEvent.java \
 java/awt/event/TextListener.java \
 java/awt/event/WindowAdapter.java \
-java/awt/event/WindowEvent.java \
+java/awt/event/WindowEvent.java	\
 java/awt/event/WindowListener.java \
-java/awt/geom/Point2D.java \
 java/awt/geom/Dimension2D.java \
+java/awt/geom/Point2D.java \
 java/awt/peer/ComponentPeer.java \
 java/awt/peer/ContainerPeer.java \
 java/awt/peer/FramePeer.java \
Index: java/awt/AWTError.java
===================================================================
RCS file: AWTError.java
diff -N AWTError.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ AWTError.java	Sat Apr  8 21:01:18 2000
@@ -0,0 +1,25 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+
+public class AWTError extends IllegalStateException
+{
+  public AWTError (String s)
+  {
+    super (s);
+  }
+}
Index: java/awt/AWTEvent.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/AWTEvent.java,v
retrieving revision 1.3
diff -u -r1.3 AWTEvent.java
--- AWTEvent.java	2000/03/07 19:55:25	1.3
+++ AWTEvent.java	2000/04/09 04:01:18
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libjava.
 
@@ -15,7 +15,20 @@
   protected boolean consumed;
   protected int id;
 
-  public int getID() { return id; }
+  public int getID()
+  {
+    return id;
+  }
+
+  public String paramString ()
+  {
+    return toString ();
+  }
+
+  public String toString ()
+  {
+    return getClass().getName() + "[" + id + "]";
+  }
 
   public AWTEvent (Object source, int id)
   {
Index: java/awt/ActiveEvent.java
===================================================================
RCS file: ActiveEvent.java
diff -N ActiveEvent.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ ActiveEvent.java	Sat Apr  8 21:01:18 2000
@@ -0,0 +1,21 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public interface ActiveEvent
+{
+  public void dispatch ();
+}
Index: java/awt/Adjustable.java
===================================================================
RCS file: Adjustable.java
diff -N Adjustable.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ Adjustable.java	Sat Apr  8 21:01:18 2000
@@ -0,0 +1,39 @@
+/* Copyright (C) 1999, 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt;
+import java.awt.event.*;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public interface Adjustable
+{
+  static final int HORIZONTAL;
+  static final int VERTICAL;
+
+  public void addAdjustmentListener (AdjustmentListener l);
+  public int getBlockIncrement ();
+  public int getMaximum ();
+  public int getMinimum ();
+  public int getOrientation ();
+  public int getUnitIncrement ();
+  public int getValue ();
+  public int getVisibleAmount ();
+  public void removeAdjustmentListener (AdjustmentListener l);
+  public void setBlockIncrement (int b);
+  public void setMaximum (int max);
+  public void setMinimum (int min);
+  public void setUnitIncrement (int u);
+  public void setValue (int v);
+  public void setVisibleAmount (int v);
+}
Index: java/awt/Component.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/Component.java,v
retrieving revision 1.3
diff -u -r1.3 Component.java
--- Component.java	2000/03/07 19:55:25	1.3
+++ Component.java	2000/04/09 04:01:21
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libjava.
 
@@ -65,6 +65,16 @@
   public Point getLocation ()
   {
     return new Point(x, y);
+  }
+
+  public int getX ()
+  {
+    return x;
+  }
+
+  public int getY ()
+  {
+    return y;
   }
 
   public Dimension getSize ()
Index: java/awt/IllegalComponentStateException.java
===================================================================
RCS file: IllegalComponentStateException.java
diff -N IllegalComponentStateException.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ IllegalComponentStateException.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,30 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+
+public class IllegalComponentStateException extends IllegalStateException
+{
+  public IllegalComponentStateException ()
+  {
+    super ();
+  }
+
+  public IllegalComponentStateException (String s)
+  {
+    super (s);
+  }
+}
Index: java/awt/ItemSelectable.java
===================================================================
RCS file: ItemSelectable.java
diff -N ItemSelectable.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ ItemSelectable.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,24 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt;
+import java.awt.event.*;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public interface ItemSelectable
+{
+  public void addItemListener (ItemListener l);
+  public Object[] getSelectedObjects ();
+  public void removeItemListener (ItemListener l);
+}
Index: java/awt/event/AWTEventListener.java
===================================================================
RCS file: AWTEventListener.java
diff -N AWTEventListener.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ AWTEventListener.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,22 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+import java.awt.*;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public interface AWTEventListener extends java.util.EventListener
+{
+  public void eventDispatched (AWTEvent e);
+}
Index: java/awt/event/ActionEvent.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/event/ActionEvent.java,v
retrieving revision 1.3
diff -u -r1.3 ActionEvent.java
--- ActionEvent.java	2000/03/07 19:55:25	1.3
+++ ActionEvent.java	2000/04/09 04:01:21
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libjava.
 
@@ -9,10 +9,18 @@
 package java.awt.event;
 import java.awt.*;
 
-/* A very incomplete placeholder. */
+/* Status: Believed complete and correct to JDK 1.2.  */
 
 public class ActionEvent extends AWTEvent
 {
+  public static final int ACTION_FIRST = 1001;
+  public static final int ACTION_LAST = 1001;
+  public static final int ACTION_PERFORMED = 1001;
+  public static final int ALT_MASK = 8;
+  public static final int CTRL_MASK = 2;
+  public static final int META_MASK = 4;
+  public static final int SHIFT_MASK = 1;
+
   String actionCommand;
   int modifiers;
 
@@ -28,8 +36,20 @@
     actionCommand = command;
     this.modifiers = modifiers;
   }
+
+  public String getActionCommand ()
+  {
+    return actionCommand;
+  }
 
-  public String getActionCommand () { return actionCommand; }
+  public int getModifiers ()
+  {
+    return modifiers;
+  }
 
-  public int getModifiers () { return modifiers; }
+  public String paramString ()
+  {
+    return ("ActionEvent[" + actionCommand + "," + modifiers
+	    + ";" + super.paramString () + "]");
+  }
 }
Index: java/awt/event/AdjustmentEvent.java
===================================================================
RCS file: AdjustmentEvent.java
diff -N AdjustmentEvent.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ AdjustmentEvent.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,60 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+import java.awt.*;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public class AdjustmentEvent extends AWTEvent
+{
+  public static final int ADJUSTMENT_FIRST = 601;
+  public static final int ADJUSTMENT_LAST = 601;
+  public static final int ADJUSTMENT_VALUE_CHANGED = 601;
+  public static final int BLOCK_DECREMENT = 3;
+  public static final int BLOCK_INCREMENT = 4;
+  public static final int TRACK = 5;
+  public static final int UNIT_DECREMENT = 2;
+  public static final int UNIT_INCREMENT = 1;
+
+  public AdjustmentEvent (Adjustable source, int id, int type, int value)
+  {
+    super (source, id);
+    this.type = type;
+    this.value = value;
+  }
+
+  public Adjustable getAdjustable ()
+  {
+    return (Adjustable) source;
+  }
+
+  public int getAdjustmentType ()
+  {
+    return type;
+  }
+
+  public int getValue ()
+  {
+    return value;
+  }
+
+  public String paramString ()
+  {
+    return ("AdjustmentEvent[" + type + "," + value
+	    + ";" + super.paramString () + "]");
+  }
+
+  private int type;
+  private int value;
+}
Index: java/awt/event/AdjustmentListener.java
===================================================================
RCS file: AdjustmentListener.java
diff -N AdjustmentListener.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ AdjustmentListener.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,21 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public interface AdjustmentListener extends java.util.EventListener
+{
+  public void adjustmentValueChanged (AdjustmentEvent e);
+}
Index: java/awt/event/ComponentAdapter.java
===================================================================
RCS file: ComponentAdapter.java
diff -N ComponentAdapter.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ ComponentAdapter.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,35 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public abstract class ComponentAdapter implements ComponentListener
+{
+  public void componentHidden (ComponentEvent e)
+  {
+  }
+
+  public void componentMoved (ComponentEvent e)
+  {
+  }
+
+  public void componentResized (ComponentEvent e)
+  {
+  }
+
+  public void componentShown (ComponentEvent e)
+  {
+  }
+}
Index: java/awt/event/ComponentEvent.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/event/ComponentEvent.java,v
retrieving revision 1.3
diff -u -r1.3 ComponentEvent.java
--- ComponentEvent.java	2000/03/07 19:55:25	1.3
+++ ComponentEvent.java	2000/04/09 04:01:21
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libjava.
 
@@ -9,12 +9,34 @@
 package java.awt.event;
 import java.awt.*;
 
-/* A very incomplete placeholder. */
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
 
+/* Status: Believed complete and correct to JDK 1.2.  */
+
 public class ComponentEvent extends AWTEvent
 {
-  public ComponentEvent (Object source, int id)
+  public static final int COMPONENT_FIRST = 100;
+  public static final int COMPONENT_HIDDEN = 103;
+  public static final int COMPONENT_LAST = 103;
+  public static final int COMPONENT_MOVED = 100;
+  public static final int COMPONENT_RESIZED = 101;
+  public static final int COMPONENT_SHOWN = 102;
+
+  public ComponentEvent (Component source, int id)
   {
     super(source, id);
+  }
+
+  public Component getComponent ()
+  {
+    return (Component) source;
+  }
+
+  public String paramString ()
+  {
+    return super.paramString ();
   }
 }
Index: java/awt/event/ComponentListener.java
===================================================================
RCS file: ComponentListener.java
diff -N ComponentListener.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ ComponentListener.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,24 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public interface ComponentListener extends java.util.EventListener
+{
+  public void componentHidden (ComponentEvent e);
+  public void componentMoved (ComponentEvent e);
+  public void componentResized (ComponentEvent e);
+  public void componentShown (ComponentEvent e);
+}
Index: java/awt/event/ContainerAdapter.java
===================================================================
RCS file: ContainerAdapter.java
diff -N ContainerAdapter.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ ContainerAdapter.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,27 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public abstract class ContainerAdapter implements ContainerListener
+{
+  public void componentAdded (ContainerEvent e)
+  {
+  }
+
+  public void componentRemoved (ContainerEvent e)
+  {
+  }
+}
Index: java/awt/event/ContainerEvent.java
===================================================================
RCS file: ContainerEvent.java
diff -N ContainerEvent.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ ContainerEvent.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,50 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+import java.awt.*;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public class ContainerEvent extends ComponentEvent
+{
+  public static final int COMPONENT_ADDED = 300;
+  public static final int COMPONENT_REMOVED = 301;
+  public static final int CONTAINER_FIRST = 300;
+  public static final int CONTAINER_LAST = 301;
+
+  // FIXME: jdk1.2 docs say source is a Component.
+  public ContainerEvent (Container source, int id, Component child)
+  {
+    super (source, id);
+    this.child = child;
+  }
+
+  public Component getChild ()
+  {
+    return child;
+  }
+
+  public Component getContainer ()
+  {
+    return (Container) source;
+  }
+
+  public String paramString ()
+  {
+    return ("ContainerEvent[" + child
+	    + ";" + super.paramString () + "]");
+  }
+
+  private Component child;
+}
Index: java/awt/event/ContainerListener.java
===================================================================
RCS file: ContainerListener.java
diff -N ContainerListener.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ ContainerListener.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,22 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public interface ContainerListener extends java.util.EventListener
+{
+  public void componentAdded (ContainerEvent e);
+  public void componentRemoved (ContainerEvent e);
+}
Index: java/awt/event/FocusAdapter.java
===================================================================
RCS file: FocusAdapter.java
diff -N FocusAdapter.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ FocusAdapter.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,27 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public abstract class FocusAdapter implements FocusListener
+{
+  public void focusGained (FocusEvent e)
+  {
+  }
+
+  public void focusLost (FocusEvent e)
+  {
+  }
+}
Index: java/awt/event/FocusEvent.java
===================================================================
RCS file: FocusEvent.java
diff -N FocusEvent.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ FocusEvent.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,50 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+import java.awt.*;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public class FocusEvent extends AWTEvent
+{
+  public static final int FOCUS_FIRST = 1004;
+  public static final int FOCUS_GAINED = 1004;
+  public static final int FOCUS_LAST = 1005;
+  public static final int FOCUS_LOST = 1005;
+
+  public FocusEvent (Component source, int id)
+  {
+    super (source, id);
+    this.temporary = false;
+  }
+
+  public FocusEvent (Component source, int id, boolean temporary)
+  {
+    super (source, id);
+    this.temporary = temporary;
+  }
+
+  public boolean isTemporary ()
+  {
+    return temporary;
+  }
+
+  public String paramString ()
+  {
+    return ("FocusEvent[" + temporary
+	    + ";" + super.paramString () + "]");
+  }
+
+  private boolean temporary;
+}
Index: java/awt/event/FocusListener.java
===================================================================
RCS file: FocusListener.java
diff -N FocusListener.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ FocusListener.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,22 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public interface FocusListener extends java.util.EventListener
+{
+  public void focusGained (FocusEvent e);
+  public void focusLost (FocusEvent e);
+}
Index: java/awt/event/InputEvent.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/event/InputEvent.java,v
retrieving revision 1.3
diff -u -r1.3 InputEvent.java
--- InputEvent.java	2000/03/07 19:55:25	1.3
+++ InputEvent.java	2000/04/09 04:01:21
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libjava.
 
@@ -7,16 +7,67 @@
 details.  */
 
 package java.awt.event;
+import java.awt.*;
 
-/* A very incomplete placeholder. */
+/* Status: Believed complete and correct to JDK 1.2.  */
 
-public class InputEvent extends ComponentEvent
+public abstract class InputEvent extends ComponentEvent
 {
-  InputEvent (Object source, int id)  // Not public
+  public static final int ALT_GRAPH_MASK = 32;
+  public static final int ALT_MASK = 8;
+  public static final int BUTTON1_MASK = 16;
+  public static final int BUTTON2_MASK = 8;
+  public static final int BUTTON3_MASK = 4;
+  public static final int CTRL_MASK = 2;
+  public static final int META_MASK = 4;
+  public static final int SHIFT_MASK = 1;
+
+  InputEvent (Component source, int id)  // Not public
   {
     super(source, id);
   }
 
+  public boolean isShiftDown ()
+  {
+    return (modifiers & SHIFT_MASK) != 0;
+  }
+
+  public boolean isControlDown ()
+  {
+    return (modifiers & CTRL_MASK) != 0;
+  }
+
+  public boolean isMetaDown ()
+  {
+    return (modifiers & META_MASK) != 0;
+  }
+
+  public boolean isAltDown ()
+  {
+    return (modifiers & ALT_MASK) != 0;
+  }
+
+  public long getWhen ()
+  {
+    return when;
+  }
+
+  public int getModifiers ()
+  {
+    return modifiers;
+  }
+
+  public boolean isConsumed ()
+  {
+    return consumed;
+  }
+
   public void consume ()
-  { /* FIXME */ }
+  {
+    /* FIXME */
+    consumed = true;
+  }
+
+  private long when;
+  private int modifiers;
 }
Index: java/awt/event/InputMethodEvent.java
===================================================================
RCS file: InputMethodEvent.java
diff -N InputMethodEvent.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ InputMethodEvent.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,54 @@
+/* Copyright (C) 1999, 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+import java.awt.*;
+
+/* A very incomplete placeholder. */
+
+public class InputMethodEvent extends AWTEvent
+{
+  public static final int CARET_POSITION_CHANGED = 1101;
+  public static final int INPUT_METHOD_FIRST = 1100;
+  public static final int INPUT_METHOD_LAST = 1101;
+  public static final int INPUT_METHOD_TEXT_CHANGED = 1100;
+
+  /*
+  public InputMethodEvent (Component source, int id,
+			   AttributedCharacterIterator text,
+			   int committedCharacterCount, TextHitInfo caret,
+			   TextHitInfo visiblePosition)
+  {
+    if (id < INPUT_METHOD_FIRST
+	|| id > INPUT_METHOD_LAST
+	|| (id == CARET_POSITION_CHANGED && text != null)
+	|| committedCharacterCount < 0
+	|| (committedCharacterCount
+	    > text.getEndIndex () - text.getBeginIndex ()))
+      throw new IllegalArgumentException ();
+  }
+
+  public InputMethodEvent (Component source, int id, TextHitInfo caret,
+			   TextHitInfo visiblePosition);
+
+  public void consume ();
+  public TextHitInfo getCaret ();
+  public int getCommittedCharacterCount ();
+  public AttributedCharacterIterator getText ();
+  public TextHitInfo getVisiblePosition ();
+  public boolean isConsumed ();
+
+  public String paramString ();
+  */
+
+  // FIXME: this is just to let it compile.
+  private InputMethodEvent ()
+  {
+    super (null, -1);
+  }
+}
Index: java/awt/event/InputMethodListener.java
===================================================================
RCS file: InputMethodListener.java
diff -N InputMethodListener.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ InputMethodListener.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,22 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public interface InputMethodListener extends java.util.EventListener
+{
+  public void caretPositionChanged (InputMethodEvent e);
+  public void inputMethodTextChanged (InputMethodEvent e);
+}
Index: java/awt/event/InvocationEvent.java
===================================================================
RCS file: InvocationEvent.java
diff -N InvocationEvent.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ InvocationEvent.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,84 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+import java.awt.*;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Still one bug.  */
+
+public class InvocationEvent extends AWTEvent implements ActiveEvent
+{
+  public static final int INVOCATION_DEFAULT = 1200;
+  public static final int INVOCATION_FIRST = 1200;
+  public static final int INVOCATION_LAST = 1200;
+
+  protected InvocationEvent (Object source, int id, Runnable runnable,
+			     Object notifier, boolean catchExceptions)
+  {
+    super (source, id);
+    this.runnable = runnable;
+    this.notifier = notifier;
+    this.catchExceptions = catchExceptions;
+  }
+
+  public InvocationEvent (Object source, Runnable runnable)
+  {
+    super (source, INVOCATION_DEFAULT);
+    this.runnable = runnable;
+  }
+
+  public InvocationEvent (Object source, Runnable runnable, Object notifier)
+  {
+    super (source, INVOCATION_DEFAULT);
+    this.runnable = runnable;
+    this.notifier = notifier;
+  }
+
+  public void dispatch ()
+  {
+    Exception e = null;
+    try
+      {
+	runnable.run ();
+      }
+    catch (Exception _)
+      {
+	e = _;
+      }
+
+    // FIXME: what to do if !catchExceptions?
+    if (catchExceptions)
+      exception = e;
+
+    if (notifier != null)
+      notifier.notifyAll ();
+  }
+
+  public Exception getException ()
+  {
+    return exception;
+  }
+
+  public String paramString ()
+  {
+    return ("InvocationEvent[" + notifier + "," + runnable
+	    + "," + catchExceptions
+	    + ";" + super.paramString () + "]");
+  }
+
+  protected boolean catchExceptions;
+  protected Object notifier;
+  protected Runnable runnable;
+
+  private Exception exception;
+}
Index: java/awt/event/ItemEvent.java
===================================================================
RCS file: ItemEvent.java
diff -N ItemEvent.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ ItemEvent.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,57 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+import java.awt.*;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public class ItemEvent extends AWTEvent
+{
+  public static final int DESELECTED = 2;
+  public static final int ITEM_FIRST = 701;
+  public static final int ITEM_LAST = 701;
+  public static final int ITEM_STATE_CHANGED = 701;
+  public static final int SELECTED = 1;
+
+  public ItemEvent (ItemSelectable source, int id, Object item, int sc)
+  {
+    super (source, id);
+    this.item = item;
+    this.stateChange = sc;
+  }
+
+  public Object getItem ()
+  {
+    return item;
+  }
+
+  public ItemSelectable getItemSelectable ()
+  {
+    return (ItemSelectable) source;
+  }
+
+  public int getStateChange ()
+  {
+    return stateChange;
+  }
+
+  public String paramString ()
+  {
+    return ("ItemEvent[" + item + "," + stateChange
+	    + ";" + super.paramString () + "]");
+  }
+
+  private Object item;
+  private int stateChange;
+}
Index: java/awt/event/ItemListener.java
===================================================================
RCS file: ItemListener.java
diff -N ItemListener.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ ItemListener.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,21 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public interface ItemListener extends java.util.EventListener
+{
+  public void itemStateChanged (ItemEvent e);
+}
Index: java/awt/event/KeyAdapter.java
===================================================================
RCS file: KeyAdapter.java
diff -N KeyAdapter.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ KeyAdapter.java	Sat Apr  8 21:01:21 2000
@@ -0,0 +1,31 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public abstract class KeyAdapter implements KeyListener
+{
+  public void keyPressed (KeyEvent w)
+  {
+  }
+
+  public void keyReleased (KeyEvent w)
+  {
+  }
+
+  public void keyTyped (KeyEvent w)
+  {
+  }
+}
Index: java/awt/event/KeyEvent.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/event/KeyEvent.java,v
retrieving revision 1.3
diff -u -r1.3 KeyEvent.java
--- KeyEvent.java	2000/03/07 19:55:25	1.3
+++ KeyEvent.java	2000/04/09 04:01:22
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libjava.
 
@@ -9,23 +9,218 @@
 package java.awt.event;
 import java.awt.*;
 
-/* A very incomplete placeholder. */
+/* Status: still incomplete.  */
 
 public class KeyEvent extends InputEvent
 {
-  int keyCode;
-  char keyChar;
-  int modifiers;
+  public static 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;
+  public static final int KEY_RELEASED = 402;
+  public static final int KEY_TYPED = 400;
+  public static final int VK_0 = 48;
+  public static final int VK_1 = 49;
+  public static final int VK_2 = 50;
+  public static final int VK_3 = 51;
+  public static final int VK_4 = 52;
+  public static final int VK_5 = 53;
+  public static final int VK_6 = 54;
+  public static final int VK_7 = 55;
+  public static final int VK_8 = 56;
+  public static final int VK_9 = 57;
+  public static final int VK_A = 65;
+  public static final int VK_ACCEPT = 30;
+  public static final int VK_ADD = 107;
+  public static final int VK_AGAIN = 65481;
+  public static final int VK_ALL_CANDIDATES = 256;
+  public static final int VK_ALPHANUMERIC = 240;
+  public static final int VK_ALT = 18;
+  public static final int VK_ALT_GRAPH = 65406;
+  public static final int VK_AMPERSAND = 150;
+  public static final int VK_ASTERISK = 151;
+  public static final int VK_AT = 512;
+  public static final int VK_B = 66;
+  public static final int VK_BACK_QUOTE = 192;
+  public static final int VK_BACK_SLASH = 92;
+  public static final int VK_BACK_SPACE = 8;
+  public static final int VK_BRACELEFT = 161;
+  public static final int VK_BRACERIGHT = 162;
+  public static final int VK_C = 67;
+  public static final int VK_CANCEL = 3;
+  public static final int VK_CAPS_LOCK = 20;
+  public static final int VK_CIRCUMFLEX = 514;
+  public static final int VK_CLEAR = 12;
+  public static final int VK_CLOSE_BRACKET = 93;
+  public static final int VK_CODE_INPUT = 258;
+  public static final int VK_COLON = 513;
+  public static final int VK_COMMA = 44;
+  public static final int VK_COMPOSE = 65312;
+  public static final int VK_CONTROL = 17;
+  public static final int VK_CONVERT = 28;
+  public static final int VK_COPY = 65485;
+  public static final int VK_CUT = 65489;
+  public static final int VK_D = 68;
+  public static final int VK_DEAD_ABOVEDOT = 134;
+  public static final int VK_DEAD_ABOVERING = 136;
+  public static final int VK_DEAD_ACUTE = 129;
+  public static final int VK_DEAD_BREVE = 133;
+  public static final int VK_DEAD_CARON = 138;
+  public static final int VK_DEAD_CEDILLA = 139;
+  public static final int VK_DEAD_CIRCUMFLEX = 130;
+  public static final int VK_DEAD_DIAERESIS = 135;
+  public static final int VK_DEAD_DOUBLEACUTE = 137;
+  public static final int VK_DEAD_GRAVE = 128;
+  public static final int VK_DEAD_IOTA = 141;
+  public static final int VK_DEAD_MACRON = 132;
+  public static final int VK_DEAD_OGONEK = 140;
+  public static final int VK_DEAD_SEMIVOICED_SOUND = 143;
+  public static final int VK_DEAD_TILDE = 131;
+  public static final int VK_DEAD_VOICED_SOUND = 142;
+  public static final int VK_DECIMAL = 110;
+  public static final int VK_DELETE = 127;
+  public static final int VK_DIVIDE = 111;
+  public static final int VK_DOLLAR = 515;
+  public static final int VK_DOWN = 40;
+  public static final int VK_E = 69;
+  public static final int VK_END = 35;
+  public static final int VK_ENTER = 10;
+  public static final int VK_EQUALS = 61;
+  public static final int VK_ESCAPE = 27;
+  public static final int VK_EURO_SIGN = 516;
+  public static final int VK_EXCLAMATION_MARK = 517;
+  public static final int VK_F = 70;
+  public static final int VK_F1 = 112;
+  public static final int VK_F10 = 121;
+  public static final int VK_F11 = 122;
+  public static final int VK_F12 = 123;
+  public static final int VK_F13 = 61440;
+  public static final int VK_F14 = 61441;
+  public static final int VK_F15 = 61442;
+  public static final int VK_F16 = 61443;
+  public static final int VK_F17 = 61444;
+  public static final int VK_F18 = 61445;
+  public static final int VK_F19 = 61446;
+  public static final int VK_F2 = 113;
+  public static final int VK_F20 = 61447;
+  public static final int VK_F21 = 61448;
+  public static final int VK_F22 = 61449;
+  public static final int VK_F23 = 61450;
+  public static final int VK_F24 = 61451;
+  public static final int VK_F3 = 114;
+  public static final int VK_F4 = 115;
+  public static final int VK_F5 = 116;
+  public static final int VK_F6 = 117;
+  public static final int VK_F7 = 118;
+  public static final int VK_F8 = 119;
+  public static final int VK_F9 = 120;
+  public static final int VK_FINAL = 24;
+  public static final int VK_FIND = 65488;
+  public static final int VK_FULL_WIDTH = 243;
+  public static final int VK_G = 71;
+  public static final int VK_GREATER = 160;
+  public static final int VK_H = 72;
+  public static final int VK_HALF_WIDTH = 244;
+  public static final int VK_HELP = 156;
+  public static final int VK_HIRAGANA = 242;
+  public static final int VK_HOME = 36;
+  public static final int VK_I = 73;
+  public static final int VK_INSERT = 155;
+  public static final int VK_INVERTED_EXCLAMATION_MARK = 518;
+  public static final int VK_J = 74;
+  public static final int VK_JAPANESE_HIRAGANA = 260;
+  public static final int VK_JAPANESE_KATAKANA = 259;
+  public static final int VK_JAPANESE_ROMAN = 261;
+  public static final int VK_K = 75;
+  public static final int VK_KANA = 21;
+  public static final int VK_KANJI = 25;
+  public static final int VK_KATAKANA = 241;
+  public static final int VK_KP_DOWN = 225;
+  public static final int VK_KP_LEFT = 226;
+  public static final int VK_KP_RIGHT = 227;
+  public static final int VK_KP_UP = 224;
+  public static final int VK_L = 76;
+  public static final int VK_LEFT = 37;
+  public static final int VK_LEFT_PARENTHESIS = 519;
+  public static final int VK_LESS = 153;
+  public static final int VK_M = 77;
+  public static final int VK_META = 157;
+  public static final int VK_MINUS = 45;
+  public static final int VK_MODECHANGE = 31;
+  public static final int VK_MULTIPLY = 106;
+  public static final int VK_N = 78;
+  public static final int VK_NONCONVERT = 29;
+  public static final int VK_NUM_LOCK = 144;
+  public static final int VK_NUMBER_SIGN = 520;
+  public static final int VK_NUMPAD0 = 96;
+  public static final int VK_NUMPAD1 = 97;
+  public static final int VK_NUMPAD2 = 98;
+  public static final int VK_NUMPAD3 = 99;
+  public static final int VK_NUMPAD4 = 100;
+  public static final int VK_NUMPAD5 = 101;
+  public static final int VK_NUMPAD6 = 102;
+  public static final int VK_NUMPAD7 = 103;
+  public static final int VK_NUMPAD8 = 104;
+  public static final int VK_NUMPAD9 = 105;
+  public static final int VK_O = 79;
+  public static final int VK_OPEN_BRACKET = 91;
+  public static final int VK_P = 80;
+  public static final int VK_PAGE_DOWN = 34;
+  public static final int VK_PAGE_UP = 33;
+  public static final int VK_PASTE = 65487;
+  public static final int VK_PAUSE = 19;
+  public static final int VK_PERIOD = 46;
+  public static final int VK_PLUS = 521;
+  public static final int VK_PREVIOUS_CANDIDATE = 257;
+  public static final int VK_PRINTSCREEN = 154;
+  public static final int VK_PROPS = 65482;
+  public static final int VK_Q = 81;
+  public static final int VK_QUOTE = 222;
+  public static final int VK_QUOTEDBL = 152;
+  public static final int VK_R = 82;
+  public static final int VK_RIGHT = 39;
+  public static final int VK_RIGHT_PARENTHESIS = 522;
+  public static final int VK_ROMAN_CHARACTERS = 245;
+  public static final int VK_S = 83;
+  public static final int VK_SCROLL_LOCK = 145;
+  public static final int VK_SEMICOLON = 59;
+  public static final int VK_SEPARATER = 108;
+  public static final int VK_SHIFT = 16;
+  public static final int VK_SLASH = 47;
+  public static final int VK_SPACE = 32;
+  public static final int VK_STOP = 65480;
+  public static final int VK_SUBTRACT = 109;
+  public static final int VK_T = 84;
+  public static final int VK_TAB = 9;
+  public static final int VK_U = 85;
+  public static final int VK_UNDEFINED = 0;
+  public static final int VK_UNDERSCORE = 523;
+  public static final int VK_UNDO = 65483;
+  public static final int VK_UP = 38;
+  public static final int VK_V = 86;
+  public static final int VK_W = 87;
+  public static final int VK_X = 88;
+  public static final int VK_Y = 89;
+  public static final int VK_Z = 90;
 
   public KeyEvent (Component source, int id, long when,
 		  int modifiers, int keyCode, char keyChar)
   {
-    super(source, id);
+    super (source, id);
     this.keyCode = keyCode;
     this.keyChar = keyChar;
     this.modifiers = modifiers;
   }
 
+  public KeyEvent (Component source, int id, long when,
+		   int modifiers, int keyCode)
+  {
+    super (source, id);
+    this.keyCode = keyCode;
+    this.keyChar = CHAR_UNDEFINED; // FIXME?
+    this.modifiers = modifiers;
+  }
+
   public int getKeyCode () { return keyCode; }
 
   public char getKeyChar () { return keyChar; }
@@ -35,4 +230,32 @@
   public void setKeyChar (char keyChar) { this.keyChar = keyChar; }
 
   public void setModifiers (int modifiers) { this.modifiers = modifiers; }
+
+  public static String getKeyText (int keyCode)
+  {
+    // FIXME
+    throw new InternalError ("unimplemented");
+  }
+
+  public static String getKeyModifiersText (int modifiers)
+  {
+    // FIXME
+    throw new InternalError ("unimplemented");
+  }
+
+  public boolean isActionKey ()
+  {
+    // FIXME
+    return false;
+  }
+
+  public String paramString ()
+  {
+    return ("KeyEvent[" + keyCode + "," + keyChar + "," + modifiers
+	    + ";" + super.paramString () + "]");
+  }
+
+  private int keyCode;
+  private char keyChar;
+  private int modifiers;
 }
Index: java/awt/event/MouseAdapter.java
===================================================================
RCS file: MouseAdapter.java
diff -N MouseAdapter.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ MouseAdapter.java	Sat Apr  8 21:01:22 2000
@@ -0,0 +1,39 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public abstract class MouseAdapter implements MouseListener
+{
+  public void mouseClicked (MouseEvent e)
+  {
+  }
+
+  public void mouseEntered (MouseEvent e)
+  {
+  }
+
+  public void mouseExited (MouseEvent e)
+  {
+  }
+
+  public void mousePressed (MouseEvent e)
+  {
+  }
+
+  public void mouseReleased (MouseEvent e)
+  {
+  }
+}
Index: java/awt/event/MouseEvent.java
===================================================================
RCS file: MouseEvent.java
diff -N MouseEvent.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ MouseEvent.java	Sat Apr  8 21:01:22 2000
@@ -0,0 +1,91 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+import java.awt.*;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public class MouseEvent extends InputEvent
+{
+  public static final int MOUSE_CLICKED = 500;
+  public static final int MOUSE_DRAGGED = 506;
+  public static final int MOUSE_ENTERED = 504;
+  public static final int MOUSE_EXITED = 505;
+  public static final int MOUSE_FIRST = 500;
+  public static final int MOUSE_LAST = 506;
+  public static final int MOUSE_MOVED = 503;
+  public static final int MOUSE_PRESSED = 501;
+  public static final int MOUSE_RELEASED = 502;
+
+  public MouseEvent (Component source, int id, long when, int modifiers,
+		     int x, int y, int clickCount, boolean popupTrigger)
+  {
+    super (source, id);
+    this.when = when;
+    this.modifiers = modifiers;
+    this.x = x;
+    this.y = y;
+    this.clickCount = clickCount;
+    this.popupTrigger = popupTrigger;
+  }
+
+  public int getClickCount ()
+  {
+    return clickCount;
+  }
+
+  public Point getPoint ()
+  {
+    Point p = ((Component) source).getLocation ();
+    p.x = x - p.x;
+    p.y = y - p.y;
+    return p;
+  }
+
+  public int getX ()
+  {
+    return x - ((Component) source).getX ();
+  }
+
+  public int getY ()
+  {
+    return y - ((Component) source).getY ();
+  }
+
+  public boolean isPopupTrigger ()
+  {
+    return popupTrigger;
+  }
+
+  public String paramString ()
+  {
+    return ("MouseEvent[" + when + "," + modifiers
+	    + ",(" + x + "," + y + "),"
+	    + clickCount + "," + popupTrigger
+	    + ";" + super.paramString () + "]");
+  }
+
+  public void translatePoint (int x, int y)
+  {
+    this.x += x;
+    this.y += y;
+  }
+
+  private long when;
+  private int modifiers;
+  private int x;
+  private int y;
+  private int clickCount;
+  private boolean popupTrigger;
+}
Index: java/awt/event/MouseListener.java
===================================================================
RCS file: MouseListener.java
diff -N MouseListener.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ MouseListener.java	Sat Apr  8 21:01:22 2000
@@ -0,0 +1,25 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public interface MouseListener extends java.util.EventListener
+{
+  public void mouseClicked (MouseEvent e);
+  public void mouseEntered (MouseEvent e);
+  public void mouseExited (MouseEvent e);
+  public void mousePressed (MouseEvent e);
+  public void mouseReleased (MouseEvent e);
+}
Index: java/awt/event/MouseMotionAdapter.java
===================================================================
RCS file: MouseMotionAdapter.java
diff -N MouseMotionAdapter.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ MouseMotionAdapter.java	Sat Apr  8 21:01:22 2000
@@ -0,0 +1,27 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public abstract class MouseMotionAdapter implements MouseMotionListener
+{
+  public void mouseDragged (MouseEvent e)
+  {
+  }
+
+  public void mouseMoved (MouseEvent e)
+  {
+  }
+}
Index: java/awt/event/MouseMotionListener.java
===================================================================
RCS file: MouseMotionListener.java
diff -N MouseMotionListener.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ MouseMotionListener.java	Sat Apr  8 21:01:22 2000
@@ -0,0 +1,22 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public interface MouseMotionListener extends java.util.EventListener
+{
+  public void mouseDragged (MouseEvent e);
+  public void mouseMoved (MouseEvent e);
+}
Index: java/awt/event/PaintEvent.java
===================================================================
RCS file: PaintEvent.java
diff -N PaintEvent.java
--- /dev/null	Tue May  5 13:32:27 1998
+++ PaintEvent.java	Sat Apr  8 21:01:22 2000
@@ -0,0 +1,49 @@
+/* Copyright (C) 2000  Free Software Foundation
+
+   This file is part of libjava.
+
+This software is copyrighted work licensed under the terms of the
+Libjava License.  Please consult the file "LIBJAVA_LICENSE" for
+details.  */
+
+package java.awt.event;
+import java.awt.*;
+
+/**
+ * @author Tom Tromey <tromey@cygnus.com>
+ * @date April 8, 2000
+ */
+
+/* Status: Believed complete and correct to JDK 1.2.  */
+
+public class PaintEvent extends ComponentEvent
+{
+  public static final int PAINT = 800;
+  public static final int PAINT_FIRST = 800;
+  public static final int PAINT_LAST = 801;
+  public static final int UPDATE = 801;
+
+  public PaintEvent (Component source, int id, Rectangle updateRect)
+  {
+    super (source, id);
+    this.updateRect = updateRect;
+  }
+
+  public Rectangle getUpdateRect ()
+  {
+    return updateRect;
+  }
+
+  public String paramString ()
+  {
+    return ("PaintEvent[" + updateRect
+	    + ";" + super.paramString () + "]");
+  }
+
+  public void setUpdateRect (Rectangle updateRect)
+  {
+    this.updateRect = updateRect;
+  }
+
+  private Rectangle updateRect;
+}
Index: java/awt/event/TextEvent.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/event/TextEvent.java,v
retrieving revision 1.3
diff -u -r1.3 TextEvent.java
--- TextEvent.java	2000/03/07 19:55:25	1.3
+++ TextEvent.java	2000/04/09 04:01:22
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libjava.
 
@@ -9,12 +9,21 @@
 package java.awt.event;
 import java.awt.*;
 
-/* A very incomplete placeholder. */
+/* Status: Believed complete and correct to JDK 1.2.  */
 
 public class TextEvent extends AWTEvent
 {
+  public static final int TEXT_FIRST = 900;
+  public static final int TEXT_LAST = 900;
+  public static final int TEXT_VALUE_CHANGED = 900;
+
   public TextEvent (Object source, int id)
+  {
+    super (source, id);
+  }
+
+  public String paramString ()
   {
-    super(source, id);
+    return super.paramString ();
   }
 }
Index: java/awt/event/WindowEvent.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/awt/event/WindowEvent.java,v
retrieving revision 1.3
diff -u -r1.3 WindowEvent.java
--- WindowEvent.java	2000/03/07 19:55:25	1.3
+++ WindowEvent.java	2000/04/09 04:01:22
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2000  Free Software Foundation
 
    This file is part of libjava.
 
@@ -7,13 +7,34 @@
 details.  */
 
 package java.awt.event;
+import java.awt.*;
 
-/* A very incomplete placeholder. */
+/* Status: Believed complete and correct to JDK 1.2.  */
 
 public class WindowEvent extends ComponentEvent
 {
-  public WindowEvent (Object source, int id)
+  public static final int WINDOW_ACTIVATED = 205;
+  public static final int WINDOW_CLOSED = 202;
+  public static final int WINDOW_CLOSING = 201;
+  public static final int WINDOW_DEACTIVATED = 206;
+  public static final int WINDOW_DEICONIFIED = 204;
+  public static final int WINDOW_FIRST = 200;
+  public static final int WINDOW_ICONIFIED = 203;
+  public static final int WINDOW_LAST = 206;
+  public static final int WINDOW_OPENED = 200;
+
+  public WindowEvent (Window source, int id)
+  {
+    super (source, id);
+  }
+
+  public Window getWindow ()
+  {
+    return (Window) source;
+  }
+
+  public String paramString ()
   {
-    super(source, id);
+    return super.paramString ();
   }
 }


More information about the Java-patches mailing list