private boolean processMouseEvent(MouseEvent e){
  int id=e.getID();
  Component mouseOver=nativeContainer.getMouseEventTarget(e.getX(),e.getY(),Container.INCLUDE_SELF);
  trackMouseEnterExit(mouseOver,e);
  Component met=mouseEventTarget.get();
  if (!isMouseGrab(e) && id != MouseEvent.MOUSE_CLICKED) {
    met=(mouseOver != nativeContainer) ? mouseOver : null;
    mouseEventTarget=new WeakReference<>(met);
  }
  if (met != null) {
switch (id) {
case MouseEvent.MOUSE_ENTERED:
case MouseEvent.MOUSE_EXITED:
      break;
case MouseEvent.MOUSE_PRESSED:
    retargetMouseEvent(met,id,e);
  break;
case MouseEvent.MOUSE_RELEASED:
retargetMouseEvent(met,id,e);
break;
case MouseEvent.MOUSE_CLICKED:
if (mouseOver == met) {
retargetMouseEvent(mouseOver,id,e);
}
break;
case MouseEvent.MOUSE_MOVED:
retargetMouseEvent(met,id,e);
break;
case MouseEvent.MOUSE_DRAGGED:
if (isMouseGrab(e)) {
retargetMouseEvent(met,id,e);
}
break;
case MouseEvent.MOUSE_WHEEL:
if (eventLog.isLoggable(PlatformLogger.Level.FINEST) && (mouseOver != null)) {
eventLog.finest("retargeting mouse wheel to " + mouseOver.getName() + ", "+ mouseOver.getClass());
}
retargetMouseEvent(mouseOver,id,e);
break;
}
if (id != MouseEvent.MOUSE_WHEEL) {
e.consume();
}
}
return e.isConsumed();
}

private boolean processMouseEvent ( MouseEvent e ) { int id = e . getID ( ) ; Component mouseOver = nativeContainer . getMouseEventTarget ( e . getX ( ) , e . getY ( ) , Container . INCLUDE_SELF ) ; trackMouseEnterExit ( mouseOver , e ) ; Component met = mouseEventTarget . get ( ) ; if ( ! isMouseGrab ( e ) && id != MouseEvent . MOUSE_CLICKED ) { met = ( mouseOver != nativeContainer ) ? mouseOver : null ; mouseEventTarget = new WeakReference < > ( met ) ; } if ( met != null ) { switch ( id ) { case MouseEvent . MOUSE_ENTERED : case MouseEvent . MOUSE_EXITED : break ; case MouseEvent . MOUSE_PRESSED : retargetMouseEvent ( met , id , e ) ; break ; case MouseEvent . MOUSE_RELEASED : retargetMouseEvent ( met , id , e ) ; break ; case MouseEvent . MOUSE_CLICKED : if ( mouseOver == met ) { retargetMouseEvent ( mouseOver , id , e ) ; } break ; case MouseEvent . MOUSE_MOVED : retargetMouseEvent ( met , id , e ) ; break ; case MouseEvent . MOUSE_DRAGGED : if ( isMouseGrab ( e ) ) { retargetMouseEvent ( met , id , e ) ; } break ; case MouseEvent . MOUSE_WHEEL : if ( eventLog . isLoggable ( PlatformLogger . Level . FINEST ) && ( mouseOver != null ) ) { eventLog . finest ( "retargeting mouse wheel to " + mouseOver . getName ( ) + ", " + mouseOver . getClass ( ) ) ; } retargetMouseEvent ( mouseOver , id , e ) ; break ; } if ( id != MouseEvent . MOUSE_WHEEL ) { e . consume ( ) ; } } return e . isConsumed ( ) ; }
this method attempts to distribute a mouse event to a lightweight component . it tries to avoid doing any unnecessary probes down into the component tree to minimize the overhead of determining where to route the event , since mouse movement events tend to come in large and frequent amounts .
