447 return;
448 }
449 Point coord = XBaseWindow.toOtherWindow(xtiPeer.getWindow(),
450 XToolkit.getDefaultRootWindow(),
451 e.getX(), e.getY());
452
453 if (e.isPopupTrigger()) {
454 xtiPeer.showPopupMenu(coord.x, coord.y);
455 }
456
457 e.translatePoint(coord.x - e.getX(), coord.y - e.getY());
458 // This is a hack in order to set non-Component source to MouseEvent
459 // instance.
460 // In some cases this could lead to unpredictable result (e.g. when
461 // other class tries to cast source field to Component).
462 // We already filter DRAG events out (CR 6565779).
463 e.setSource(xtiPeer.target);
464 XToolkit.postEvent(XToolkit.targetToAppContext(e.getSource()), e);
465 }
466 public void mouseClicked(MouseEvent e) {
467 if ((e.getClickCount() > 1 || xtiPeer.balloon.isVisible()) &&
468 e.getButton() == MouseEvent.BUTTON1)
469 {
470 ActionEvent aev = new ActionEvent(xtiPeer.target, ActionEvent.ACTION_PERFORMED,
471 xtiPeer.target.getActionCommand(), e.getWhen(),
472 e.getModifiers());
473 XToolkit.postEvent(XToolkit.targetToAppContext(aev.getSource()), aev);
474 }
475 if (xtiPeer.balloon.isVisible()) {
476 xtiPeer.balloon.hide();
477 }
478 handleEvent(e);
479 }
480 public void mouseEntered(MouseEvent e) {
481 xtiPeer.tooltip.enter();
482 handleEvent(e);
483 }
484 public void mouseExited(MouseEvent e) {
485 xtiPeer.tooltip.exit();
486 handleEvent(e);
487 }
|
447 return;
448 }
449 Point coord = XBaseWindow.toOtherWindow(xtiPeer.getWindow(),
450 XToolkit.getDefaultRootWindow(),
451 e.getX(), e.getY());
452
453 if (e.isPopupTrigger()) {
454 xtiPeer.showPopupMenu(coord.x, coord.y);
455 }
456
457 e.translatePoint(coord.x - e.getX(), coord.y - e.getY());
458 // This is a hack in order to set non-Component source to MouseEvent
459 // instance.
460 // In some cases this could lead to unpredictable result (e.g. when
461 // other class tries to cast source field to Component).
462 // We already filter DRAG events out (CR 6565779).
463 e.setSource(xtiPeer.target);
464 XToolkit.postEvent(XToolkit.targetToAppContext(e.getSource()), e);
465 }
466 public void mouseClicked(MouseEvent e) {
467 if ((e.getClickCount() == 1 || xtiPeer.balloon.isVisible()) &&
468 e.getButton() == MouseEvent.BUTTON1)
469 {
470 ActionEvent aev = new ActionEvent(xtiPeer.target, ActionEvent.ACTION_PERFORMED,
471 xtiPeer.target.getActionCommand(), e.getWhen(),
472 e.getModifiers());
473 XToolkit.postEvent(XToolkit.targetToAppContext(aev.getSource()), aev);
474 }
475 if (xtiPeer.balloon.isVisible()) {
476 xtiPeer.balloon.hide();
477 }
478 handleEvent(e);
479 }
480 public void mouseEntered(MouseEvent e) {
481 xtiPeer.tooltip.enter();
482 handleEvent(e);
483 }
484 public void mouseExited(MouseEvent e) {
485 xtiPeer.tooltip.exit();
486 handleEvent(e);
487 }
|