Beispiel #1
0
 public virtual bool postEvent(Event evt)
 {
     bool handled = handleEvent(evt);
     if (handled)
     {
         return true;
     }
     // propagate non-handled events up to parent
     Component par = parent;
     // try to call postEvent only on components which
     // override any of deprecated method handlers
     // while (par != null && !par.deprecatedEventHandler) {
     // par = par.parent;
     // }
     // translate event coordinates before posting it to parent
     if (par != null)
     {
         evt.translate(x, y);
         par.postEvent(evt);
     }
     return false;
 }
Beispiel #2
0
 public bool mouseUp(Event evt, int x, int y)
 {
     // to be overridden: do nothing,
     // just return false to propagate event up to the parent container
     return false;
 }
Beispiel #3
0
 public bool lostFocus(Event evt, Object what)
 {
     // to be overridden: do nothing,
     // just return false to propagate event up to the parent container
     return false;
 }
Beispiel #4
0
 public bool keyDown(Event evt, int key)
 {
     // to be overridden: do nothing,
     // just return false to propagate event up to the parent container
     return false;
 }
Beispiel #5
0
 public virtual bool handleEvent(Event evt)
 {
     switch (evt.id)
     {
         case Event.ACTION_EVENT:
             return action(evt, evt.arg);
         case Event.GOT_FOCUS:
             return gotFocus(evt, null);
         case Event.LOST_FOCUS:
             return lostFocus(evt, null);
         case Event.MOUSE_DOWN:
             return mouseDown(evt, evt.x, evt.y);
         case Event.MOUSE_DRAG:
             return mouseDrag(evt, evt.x, evt.y);
         case Event.MOUSE_ENTER:
             return mouseEnter(evt, evt.x, evt.y);
         case Event.MOUSE_EXIT:
             return mouseExit(evt, evt.x, evt.y);
         case Event.MOUSE_MOVE:
             return mouseMove(evt, evt.x, evt.y);
         case Event.MOUSE_UP:
             return mouseUp(evt, evt.x, evt.y);
         case Event.KEY_ACTION:
         case Event.KEY_PRESS:
             return keyDown(evt, evt.key);
         case Event.KEY_ACTION_RELEASE:
         case Event.KEY_RELEASE:
             return keyUp(evt, evt.key);
         default:
             break;
     }
     return false;// event not handled
 }
Beispiel #6
0
 public AWTEvent(Event e)
     : this(e.target, e.id)
 {
 }