Bug 22088 - Events are not created with proper timestamp
Events are not created with proper timestamp
Status: CLOSED FIXED
Product: qa
Classification: Unclassified
Component: Code
3.x
Sun Solaris
: P1 (vote)
: TBD
Assigned To: issues@qa
issues@qa
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2002-04-04 10:25 UTC by Jiri Skrivanek
Modified: 2011-02-17 09:32 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Skrivanek 2002-04-04 10:25:24 UTC
EventDispatcher now creates events like this:

MouseEvent event = new MouseEvent(component, id,
0, mods, x, y, clickCount, popup);

KeyEvent event = new KeyEvent(component, id, 0,
mods, keyCode);

0 stands for timestamp. But IDE has its own
double-click detection where it checks time
difference between single clicks and if time
difference is less than a constant, it assumes it
is a double-click. It makes some tests to fail.
It would be better to create events with proper
timestamp:

390: MouseEvent event = new MouseEvent(component,
id, System.currentTimeMillis(), mods, x, y,
clickCount, popup);
427:	KeyEvent event = new KeyEvent(component, id,
System.currentTimeMillis(), mods, keyCode);
440:	KeyEvent event = new KeyEvent(component, id,
System.currentTimeMillis(), mods, keyCode,
keyChar);
Comment 1 Alexandre Iline 2002-04-15 05:36:21 UTC
Just like Jiri said:

System.currentTimeMillis() instead of 0 as 
timestamp.
Comment 2 Alexandre Iline 2002-04-15 08:32:58 UTC
390c390,391
< 	MouseEvent event = new MouseEvent(component, id, 0, mods, x, y,
clickCount, popup);
---
> 	MouseEvent event = new MouseEvent(component, id,
System.currentTimeMillis(), 
> 					  mods, x, y, clickCount, popup);
427c428,429
< 	KeyEvent event = new KeyEvent(component, id, 0, mods, keyCode);
---
> 	KeyEvent event = new KeyEvent(component, id,
System.currentTimeMillis()
> 				      , mods, keyCode);
440c442,443
< 	KeyEvent event = new KeyEvent(component, id, 0, mods, keyCode,
keyChar);
---
> 	KeyEvent event = new KeyEvent(component, id,
System.currentTimeMillis(), 
> 				      mods, keyCode, keyChar);
Comment 3 Jiri Skrivanek 2002-04-15 17:29:53 UTC
Verified.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo