Esempio n. 1
0
 /**
  * Determines whether or not the given mouse event is actually a popup trigger.
  *
  * @param aPoint the <em>corrected</em> mouse position, where the popup is to be shown, cannot be
  *     <code>null</code>;
  * @param aEvent the mouse event that could be a popup trigger, cannot be <code>null</code>.
  */
 private boolean handlePopupTrigger(final Point aPoint, final MouseEvent aEvent) {
   final boolean popupTrigger = isCursorPopupTrigger(aEvent);
   if (popupTrigger) {
     JPopupMenu contextMenu = createCursorPopup(aPoint, aEvent.getLocationOnScreen());
     if (contextMenu != null) {
       contextMenu.show(aEvent.getComponent(), aEvent.getX(), aEvent.getY());
       // Mark the event as consumed...
       aEvent.consume();
     }
   }
   return popupTrigger;
 }