From 7bde45b2eb84502b62e77e46d947e46dcbd333d6 Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Fri, 9 Aug 2002 04:26:17 +0000 Subject: AWT/Swing merge from GNU Classpath. From-SVN: r56147 --- libjava/java/awt/EventQueue.java | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'libjava/java/awt/EventQueue.java') diff --git a/libjava/java/awt/EventQueue.java b/libjava/java/awt/EventQueue.java index 6696b0c..1ce3d16 100644 --- a/libjava/java/awt/EventQueue.java +++ b/libjava/java/awt/EventQueue.java @@ -320,4 +320,27 @@ public class EventQueue } } } -} + + /** + * Returns the timestamp of the most recent event that had a timestamp, or + * the initialization time of the event queue if no events have been fired. + * At present, only InputEvents, ActionEvents, + * InputMethodEvents, and InvocationEvents have + * timestamps, but this may be added to other events in future versions. + * If this is called by the event dispatching thread, it can be any + * (sequential) value, but to other threads, the safest bet is to return + * System.currentTimeMillis(). + * + * @return the most recent timestamp + * @see InputEvent#getWhen() + * @see ActionEvent#getWhen() + * @see InvocationEvent#getWhen() + * @see InputMethodEvent#getWhen() + * @since 1.4 + */ + public static long getMostRecentEventTime() + { + // XXX For now, this ONLY does the current time. + return System.currentTimeMillis(); + } +} // class EventQueue -- cgit v1.1