1. /*
  2. * @(#)PopupMenuUI.java 1.15 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package javax.swing.plaf;
  8. import java.awt.event.MouseEvent;
  9. import javax.swing.Popup;
  10. import javax.swing.PopupFactory;
  11. import javax.swing.JPopupMenu;
  12. /**
  13. * Pluggable look and feel interface for JPopupMenu.
  14. *
  15. * @version 1.15 01/23/03
  16. * @author Georges Saab
  17. * @author David Karlton
  18. */
  19. public abstract class PopupMenuUI extends ComponentUI {
  20. /**
  21. * @since 1.3
  22. */
  23. public boolean isPopupTrigger(MouseEvent e) {
  24. return e.isPopupTrigger();
  25. }
  26. /**
  27. * Returns the <code>Popup</code> that will be responsible for
  28. * displaying the <code>JPopupMenu</code>.
  29. *
  30. * @param popup JPopupMenu requesting Popup
  31. * @param x Screen x location Popup is to be shown at
  32. * @param y Screen y location Popup is to be shown at.
  33. * @return Popup that will show the JPopupMenu
  34. * @since 1.4
  35. */
  36. public Popup getPopup(JPopupMenu popup, int x, int y) {
  37. PopupFactory popupFactory = PopupFactory.getSharedInstance();
  38. return popupFactory.getPopup(popup.getInvoker(), popup, x, y);
  39. }
  40. }