Class ExtBasicMenuUI

  • Direct Known Subclasses:
    PlasticMenuUI

    public class ExtBasicMenuUI
    extends javax.swing.plaf.basic.BasicMenuUI
    An implementation of MenuUI used by the JGoodies Windows and Plastic looks. Unlike it's superclass, it aligns submenu items.
    Version:
    $Revision: 1.12 $
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      private static class  ExtBasicMenuUI.RolloverHandler  
      • 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 
      Modifier and Type Field Description
      private static java.lang.String MENU_PROPERTY_PREFIX  
      private java.awt.event.MouseListener mouseListener  
      private java.lang.String propertyPrefix  
      private MenuItemRenderer renderer  
      private static java.lang.String SUBMENU_PROPERTY_PREFIX  
      • Fields inherited from class javax.swing.plaf.basic.BasicMenuUI

        changeListener, menuListener
      • Fields inherited from class javax.swing.plaf.basic.BasicMenuItemUI

        acceleratorDelimiter, acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, propertyChangeListener, selectionBackground, selectionForeground
    • Constructor Summary

      Constructors 
      Constructor Description
      ExtBasicMenuUI()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.swing.plaf.ComponentUI createUI​(javax.swing.JComponent b)  
      private void ensureSubMenuInstalled()
      Checks if we have already detected the correct menu type, menu in menu bar vs.
      protected java.awt.Dimension getPreferredMenuItemSize​(javax.swing.JComponent c, javax.swing.Icon aCheckIcon, javax.swing.Icon anArrowIcon, int textIconGap)  
      protected java.lang.String getPropertyPrefix()  
      protected void installDefaults()  
      protected void installListeners()  
      private static boolean isSubMenu​(javax.swing.JMenuItem aMenuItem)  
      protected void paintMenuItem​(java.awt.Graphics g, javax.swing.JComponent c, javax.swing.Icon aCheckIcon, javax.swing.Icon anArrowIcon, java.awt.Color background, java.awt.Color foreground, int textIconGap)  
      protected void uninstallDefaults()  
      protected void uninstallListeners()  
      private void uninstallRolloverListener()  
      • Methods inherited from class javax.swing.plaf.basic.BasicMenuUI

        createChangeListener, createMenuDragMouseListener, createMenuKeyListener, createMenuListener, createMouseInputListener, createPropertyChangeListener, getMaximumSize, getMinimumSize, installKeyboardActions, setupPostTimer, uninstallKeyboardActions
      • Methods inherited from class javax.swing.plaf.basic.BasicMenuItemUI

        doClick, getPath, getPreferredSize, installComponents, installUI, paint, paintBackground, paintText, uninstallComponents, uninstallUI, update
      • Methods inherited from class javax.swing.plaf.ComponentUI

        contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • MENU_PROPERTY_PREFIX

        private static final java.lang.String MENU_PROPERTY_PREFIX
        See Also:
        Constant Field Values
      • SUBMENU_PROPERTY_PREFIX

        private static final java.lang.String SUBMENU_PROPERTY_PREFIX
        See Also:
        Constant Field Values
      • propertyPrefix

        private java.lang.String propertyPrefix
      • mouseListener

        private java.awt.event.MouseListener mouseListener
    • Constructor Detail

      • ExtBasicMenuUI

        public ExtBasicMenuUI()
    • Method Detail

      • createUI

        public static javax.swing.plaf.ComponentUI createUI​(javax.swing.JComponent b)
      • installDefaults

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

        protected void uninstallDefaults()
        Overrides:
        uninstallDefaults in class javax.swing.plaf.basic.BasicMenuUI
      • getPropertyPrefix

        protected java.lang.String getPropertyPrefix()
        Overrides:
        getPropertyPrefix in class javax.swing.plaf.basic.BasicMenuUI
      • getPreferredMenuItemSize

        protected java.awt.Dimension getPreferredMenuItemSize​(javax.swing.JComponent c,
                                                              javax.swing.Icon aCheckIcon,
                                                              javax.swing.Icon anArrowIcon,
                                                              int textIconGap)
        Overrides:
        getPreferredMenuItemSize in class javax.swing.plaf.basic.BasicMenuItemUI
      • paintMenuItem

        protected void paintMenuItem​(java.awt.Graphics g,
                                     javax.swing.JComponent c,
                                     javax.swing.Icon aCheckIcon,
                                     javax.swing.Icon anArrowIcon,
                                     java.awt.Color background,
                                     java.awt.Color foreground,
                                     int textIconGap)
        Overrides:
        paintMenuItem in class javax.swing.plaf.basic.BasicMenuItemUI
      • ensureSubMenuInstalled

        private void ensureSubMenuInstalled()
        Checks if we have already detected the correct menu type, menu in menu bar vs. sub menu; reinstalls if necessary.
      • installListeners

        protected void installListeners()
        Overrides:
        installListeners in class javax.swing.plaf.basic.BasicMenuUI
      • uninstallListeners

        protected void uninstallListeners()
        Overrides:
        uninstallListeners in class javax.swing.plaf.basic.BasicMenuUI
      • uninstallRolloverListener

        private void uninstallRolloverListener()
      • isSubMenu

        private static boolean isSubMenu​(javax.swing.JMenuItem aMenuItem)