Quaqua 5.4.1 2009-07-14

ch.randelshofer.quaqua
Class QuaquaMenuUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.ButtonUI
          extended by javax.swing.plaf.MenuItemUI
              extended by javax.swing.plaf.basic.BasicMenuItemUI
                  extended by javax.swing.plaf.basic.BasicMenuUI
                      extended by ch.randelshofer.quaqua.QuaquaMenuUI
All Implemented Interfaces:
QuaquaMenuPainterClient

public class QuaquaMenuUI
extends javax.swing.plaf.basic.BasicMenuUI
implements QuaquaMenuPainterClient

A replacement for the AquaMenuUI.

This class does not fix any particular bug in the Mac LAF or the Aqua LAF. It is just here to achieve a consistent look with the other Quaqua menu UI classes.

Version:
1.3 2008-05-04 Added support for background border.
1.2.1 2005-09-25 Method paintBackground() did not always use a texture.
1.2 2005-08-26 Made menu opaque.
1.1.1 2005-04-07 Method paintBackground() did not honour background color of parent component when it is the topLevelMenu.
1.1 2003-10-06 Layout code outplaced into class QuaquaMenuPainter
1.0 2003-06-20 Created.
Author:
Werner Randelshofer

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicMenuUI
javax.swing.plaf.basic.BasicMenuUI.ChangeHandler, javax.swing.plaf.basic.BasicMenuUI.MouseInputHandler
 
Field Summary
 
Fields inherited from class javax.swing.plaf.basic.BasicMenuUI
changeListener, menuListener, propertyChangeListener
 
Fields inherited from class javax.swing.plaf.basic.BasicMenuItemUI
acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, selectionBackground, selectionForeground
 
Constructor Summary
QuaquaMenuUI()
           
 
Method Summary
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent x)
           
protected  java.awt.Dimension getPreferredMenuItemSize(javax.swing.JComponent c, javax.swing.Icon checkIcon, javax.swing.Icon arrowIcon, int defaultTextIconGap)
           
protected  void installDefaults()
           
 void paintBackground(java.awt.Graphics gr, javax.swing.JComponent component, int menuWidth, int menuHeight)
           
protected  void paintMenuItem(java.awt.Graphics g, javax.swing.JComponent c, javax.swing.Icon checkIcon, javax.swing.Icon arrowIcon, java.awt.Color background, java.awt.Color foreground, int defaultTextIconGap)
           
 
Methods inherited from class javax.swing.plaf.basic.BasicMenuUI
createChangeListener, createMenuDragMouseListener, createMenuKeyListener, createMenuListener, createMouseInputListener, createPropertyChangeListener, getMaximumSize, getPropertyPrefix, installKeyboardActions, installListeners, setupPostTimer, uninstallDefaults, uninstallKeyboardActions, uninstallListeners
 
Methods inherited from class javax.swing.plaf.basic.BasicMenuItemUI
doClick, getMinimumSize, getPath, getPreferredSize, installComponents, installUI, paint, paintBackground, paintText, uninstallComponents, uninstallUI, update
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuaquaMenuUI

public QuaquaMenuUI()
Method Detail

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent x)

installDefaults

protected void installDefaults()
Overrides:
installDefaults in class javax.swing.plaf.basic.BasicMenuUI

paintMenuItem

protected void paintMenuItem(java.awt.Graphics g,
                             javax.swing.JComponent c,
                             javax.swing.Icon checkIcon,
                             javax.swing.Icon arrowIcon,
                             java.awt.Color background,
                             java.awt.Color foreground,
                             int defaultTextIconGap)
Overrides:
paintMenuItem in class javax.swing.plaf.basic.BasicMenuItemUI

getPreferredMenuItemSize

protected java.awt.Dimension getPreferredMenuItemSize(javax.swing.JComponent c,
                                                      javax.swing.Icon checkIcon,
                                                      javax.swing.Icon arrowIcon,
                                                      int defaultTextIconGap)
Overrides:
getPreferredMenuItemSize in class javax.swing.plaf.basic.BasicMenuItemUI

paintBackground

public void paintBackground(java.awt.Graphics gr,
                            javax.swing.JComponent component,
                            int menuWidth,
                            int menuHeight)
Specified by:
paintBackground in interface QuaquaMenuPainterClient

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.