Пример #1
0
 // WARNING: it's called on the Toolkit thread!
 void preprocessPostEvent(AWTEvent event) {
   if (event instanceof WindowEvent) {
     WindowListener listener = windowListener;
     if (listener != null) {
       switch (event.getID()) {
         case WindowEvent.WINDOW_CLOSING:
           listener.windowClosing((WindowEvent) event);
           break;
         case WindowEvent.WINDOW_ICONIFIED:
           listener.windowIconified((WindowEvent) event);
           break;
       }
     }
   }
 }
Пример #2
0
 public void handleEvent(AWTEvent e) {
   super.handleEvent(e);
   if (isXEmbedActive()) {
     switch (e.getID()) {
       case FocusEvent.FOCUS_GAINED:
         canvasFocusGained((FocusEvent) e);
         break;
       case FocusEvent.FOCUS_LOST:
         canvasFocusLost((FocusEvent) e);
         break;
       case KeyEvent.KEY_PRESSED:
       case KeyEvent.KEY_RELEASED:
         if (!((InputEvent) e).isConsumed()) {
           forwardKeyEvent((KeyEvent) e);
         }
         break;
     }
   }
 }