Exemplo n.º 1
0
 void updateState(KeyEvent event) {
   if (isOld(event)) return;
   synchronized (this) {
     lastEventTime(event);
     modifiers(event.getModifiers());
     // FIXME add state of individual keys
   }
 }
Exemplo n.º 2
0
 void updateState(MouseEvent event) {
   if (isOld(event)) return;
   // childAt and locationOnScreenOf want the tree lock, so be careful not to use any additional
   // locks at the same time
   // to avoid deadlock.
   Point eventScreenLocation = null;
   // Determine the current mouse position in screen coordinates
   try {
     eventScreenLocation = locationOnScreenOf(event.getComponent());
   } catch (IllegalComponentStateException e) {
     // component might be hidden by the time we process this event
   } catch (UnexpectedException e) {
     if (!(e.getCause() instanceof IllegalComponentStateException)) throw e;
   }
   synchronized (this) {
     lastEventTime(event);
     dragDropInfo.update(event);
     mouseInfo.modifiers(modifiers);
     mouseInfo.update(event, eventScreenLocation);
     modifiers(mouseInfo.modifiers());
   }
 }