[kaffe] CVS kaffe (riccardo): implemented some methods

Kaffe CVS cvs-commits at kaffe.org
Sun Jan 29 11:58:47 PST 2006


PatchSet 7109 
Date: 2006/01/29 19:18:17
Author: riccardo
Branch: HEAD
Tag: (none) 
Log:
implemented some methods

Members: 
	ChangeLog:1.4627->1.4628 
	libraries/javalib/awt-implementations/kaffe/java/awt/EventQueue.java:1.2->1.3 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4627 kaffe/ChangeLog:1.4628
--- kaffe/ChangeLog:1.4627	Sat Jan 28 10:17:39 2006
+++ kaffe/ChangeLog	Sun Jan 29 19:18:17 2006
@@ -1,3 +1,20 @@
+2006-01-29  Riccardo Mottola <riccardo at kaffe.org>
+	* libraries/javalib/awt-implementations/kaffe/java/awt/EventQueue.java
+	Implemented some stuff, adapting from classpath.
+
+2006-01-29  Riccardo Mottola <riccardo at kaffe.org>
+	* libraries/javalib/awt-implementations/kaffe/org/kaffe/applet/AppletTagjava
+	removed warnings
+
+2006-01-29  Riccardo Mottola <riccardo at kaffe.org>
+	* libraries/javalib/awt-implementations/kaffe/java/awt/Component.java
+	libraries/javalib/awt-implementations/kaffe/java/awt/Dialog.java
+	libraries/javalib/awt-implementations/kaffe/java/awt/EventQueue.java
+	libraries/javalib/awt-implementations/kaffe/java/awt/Graphics.java
+	libraries/javalib/awt-implementations/kaffe/java/awt/Window.java
+	libraries/javalib/awt-implementations/kaffe/java/awt/event/InputEvent.java:
+	Added stubs for several missing functions or made trivial implementations of them.
+	
 2006-01-28  Guilhem Lavaux  <guilhem at kaffe.org>
 
 	* libraries/clib/native/Makefile.am: Also export TestNative.
Index: kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/EventQueue.java
diff -u kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/EventQueue.java:1.2 kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/EventQueue.java:1.3
--- kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/EventQueue.java:1.2	Sun Jan 29 14:33:49 2006
+++ kaffe/libraries/javalib/awt-implementations/kaffe/java/awt/EventQueue.java	Sun Jan 29 19:18:26 2006
@@ -1,17 +1,26 @@
-package java.awt;
-
-import java.awt.event.FocusEvent;
-import java.awt.event.PaintEvent;
-
 /**
  *
  * Copyright (c) 1998
  *   Transvirtual Technologies Inc.  All rights reserved.
  *
+ * Copyright (c) 2006
+ *      Kaffe.org developers. See ChangeLog for details.
+ *
  * See the file "license.terms" for information on usage and redistribution
  * of this file.
- * @author P.C.Mehlitz
+ *
+ * original code P.C.Mehlitz
+ * some code taken or adapted from Classpath
  */
+
+package java.awt;
+
+import java.awt.event.FocusEvent;
+import java.awt.event.PaintEvent;
+import java.awt.event.InvocationEvent;
+import java.lang.reflect.InvocationTargetException;
+
+
 public class EventQueue
 {
 	AWTEvent localQueue;
@@ -203,13 +212,40 @@
 	return Thread.currentThread() == Toolkit.eventThread;
 }
 
-// TODO this is only a stub
-public static void invokeLater(Runnable runnable) {
+// adapted from classpath
+public static void invokeAndWait(Runnable runnable)
+	throws InterruptedException, InvocationTargetException {
+
+	Exception  exception;
+	Thread     currentThr;
+	EventQueue eq;
+
+	if (isDispatchThread ())
+    		throw new Error("Can't call invokeAndWait from event dispatch thread");
+
+    	currentThr = Thread.currentThread();
+	eq = Toolkit.getDefaultToolkit().getSystemEventQueue();
 
+	InvocationEvent ie = new InvocationEvent(eq,  runnable, currentThr, true);
+
+	synchronized (currentThr)
+	{
+    		eq.postEvent(ie);
+        	currentThr.wait();
+	}
+
+	exception = ie.getException();
+	if (exception != null)
+    		throw new InvocationTargetException(exception);
 }
 
-// TODO this is only a stub
-public static void invokeAndWait(Runnable runnable) {
+// adapted from classpath
+public static void invokeLater(Runnable runnable) {
+	EventQueue eq = Toolkit.getDefaultToolkit().getSystemEventQueue(); 
+
+	InvocationEvent ie = new InvocationEvent(eq, runnable, null, false);
+
+	eq.postEvent(ie);
 }
 
 




More information about the kaffe mailing list