KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > swing > plaf > PopupMenuUI


1 /*
2  * @(#)PopupMenuUI.java 1.16 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.swing.plaf;
9
10 import java.awt.event.MouseEvent JavaDoc;
11 import javax.swing.Popup JavaDoc;
12 import javax.swing.PopupFactory JavaDoc;
13 import javax.swing.JPopupMenu JavaDoc;
14
15 /**
16  * Pluggable look and feel interface for JPopupMenu.
17  *
18  * @version 1.16 12/19/03
19  * @author Georges Saab
20  * @author David Karlton
21  */

22
23 public abstract class PopupMenuUI extends ComponentUI JavaDoc {
24     /**
25      * @since 1.3
26      */

27     public boolean isPopupTrigger(MouseEvent JavaDoc e) {
28     return e.isPopupTrigger();
29     }
30
31     /**
32      * Returns the <code>Popup</code> that will be responsible for
33      * displaying the <code>JPopupMenu</code>.
34      *
35      * @param popup JPopupMenu requesting Popup
36      * @param x Screen x location Popup is to be shown at
37      * @param y Screen y location Popup is to be shown at.
38      * @return Popup that will show the JPopupMenu
39      * @since 1.4
40      */

41     public Popup JavaDoc getPopup(JPopupMenu JavaDoc popup, int x, int y) {
42         PopupFactory JavaDoc popupFactory = PopupFactory.getSharedInstance();
43
44         return popupFactory.getPopup(popup.getInvoker(), popup, x, y);
45     }
46 }
47
48
Popular Tags