javax.swing.plaf.basic
Class BasicPopupMenuUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.PopupMenuUI
          extended by javax.swing.plaf.basic.BasicPopupMenuUI

public class BasicPopupMenuUI
extends PopupMenuUI

UI Delegate for JPopupMenu


Field Summary
protected  JPopupMenu popupMenu
           
 
Constructor Summary
BasicPopupMenuUI()
          Creates a new BasicPopupMenuUI object.
 
Method Summary
static ComponentUI createUI(JComponent x)
          Factory method to create a BasicPopupMenuUI for the given JComponent, which should be a JMenuItem.
 Dimension getMaximumSize(JComponent c)
          This method returns the minimum size of the JPopupMenu.
 Dimension getMinimumSize(JComponent c)
          This method returns the minimum size of the JPopupMenu.
 Dimension getPreferredSize(JComponent c)
          This method returns the preferred size of the JPopupMenu.
 void installDefaults()
          This method installs the defaults that are defined in the Basic look and feel for this JPopupMenu.
protected  void installKeyboardActions()
          This method installs the keyboard actions for this JPopupMenu.
protected  void installListeners()
          This method installs the listeners for the JMenuItem.
 void installUI(JComponent c)
          Installs and initializes all fields for this UI delegate.
 boolean isPopupTrigger(MouseEvent e)
          Return true if given mouse event is a platform popup trigger, and false otherwise
protected  void uninstallDefaults()
          This method uninstalls the defaults and sets any objects created during install to null
protected  void uninstallKeyboardActions()
          Uninstalls any keyboard actions.
protected  void uninstallListeners()
          Unregisters all the listeners that this UI delegate was using.
 void uninstallUI(JComponent c)
          Performs the opposite of installUI.
 
Methods inherited from class javax.swing.plaf.PopupMenuUI
getPopup
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, paint, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

popupMenu

protected JPopupMenu popupMenu
Constructor Detail

BasicPopupMenuUI

public BasicPopupMenuUI()
Creates a new BasicPopupMenuUI object.

Method Detail

createUI

public static ComponentUI createUI(JComponent x)
Factory method to create a BasicPopupMenuUI for the given JComponent, which should be a JMenuItem.

Parameters:
x - The JComponent a UI is being created for.
Returns:
A BasicPopupMenuUI for the JComponent.

installUI

public void installUI(JComponent c)
Installs and initializes all fields for this UI delegate. Any properties of the UI that need to be initialized and/or set to defaults will be done now. It will also install any listeners necessary.

Overrides:
installUI in class ComponentUI
Parameters:
c - The JComponent that is having this UI installed.
See Also:
ComponentUI.uninstallUI(javax.swing.JComponent), JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()

installDefaults

public void installDefaults()
This method installs the defaults that are defined in the Basic look and feel for this JPopupMenu.


installListeners

protected void installListeners()
This method installs the listeners for the JMenuItem.


installKeyboardActions

protected void installKeyboardActions()
This method installs the keyboard actions for this JPopupMenu.


uninstallUI

public void uninstallUI(JComponent c)
Performs the opposite of installUI. Any properties or resources that need to be cleaned up will be done now. It will also uninstall any listeners it has. In addition, any properties of this UI will be nulled.

Overrides:
uninstallUI in class ComponentUI
Parameters:
c - The JComponent that is having this UI uninstalled.
See Also:
ComponentUI.installUI(javax.swing.JComponent), JComponent.setUI(javax.swing.plaf.ComponentUI), JComponent.updateUI()

uninstallDefaults

protected void uninstallDefaults()
This method uninstalls the defaults and sets any objects created during install to null


uninstallListeners

protected void uninstallListeners()
Unregisters all the listeners that this UI delegate was using.


uninstallKeyboardActions

protected void uninstallKeyboardActions()
Uninstalls any keyboard actions.


getMinimumSize

public Dimension getMinimumSize(JComponent c)
This method returns the minimum size of the JPopupMenu.

Overrides:
getMinimumSize in class ComponentUI
Parameters:
c - The JComponent to find a size for.
Returns:
The minimum size.

getPreferredSize

public Dimension getPreferredSize(JComponent c)
This method returns the preferred size of the JPopupMenu.

Overrides:
getPreferredSize in class ComponentUI
Parameters:
c - The JComponent to find a size for.
Returns:
The preferred size.

getMaximumSize

public Dimension getMaximumSize(JComponent c)
This method returns the minimum size of the JPopupMenu.

Overrides:
getMaximumSize in class ComponentUI
Parameters:
c - The JComponent to find a size for.
Returns:
The minimum size.

isPopupTrigger

public boolean isPopupTrigger(MouseEvent e)
Return true if given mouse event is a platform popup trigger, and false otherwise

Overrides:
isPopupTrigger in class PopupMenuUI
Parameters:
e - MouseEvent that is to be checked for popup trigger event
Returns:
true if given mouse event is a platform popup trigger, and false otherwise