Package docking.menu

Class DockingMenuItemUI

  • Direct Known Subclasses:
    DockingCheckboxMenuItemUI, DockingMenuUI

    public class DockingMenuItemUI
    extends javax.swing.plaf.MenuItemUI
    This class exists to make menu items display content with proper alignment whether or not they are displaying an icon. That is, this class will introduce padding for absent icons within menu items so that the item lines up with those items that do contain icons.

    This class has an additional feature that allows clients to display menu item content in a tabular fashion. A menu item using this UI can contain some combination of the of the following items, in the given order:

     [Checkbox][Icon][Menu Item Content][Menu Pull-right/Accelerator Text]
     
    To display the Menu Item Content in a tabular fashion, use the '\t' character to delimit the data into columns. This class will align all menu items in the given menu based upon the largest number of columns in the group and the largest width for each column.
    • Field Detail

      • ui

        protected javax.swing.plaf.MenuItemUI ui
    • Constructor Detail

      • DockingMenuItemUI

        public DockingMenuItemUI()
    • Method Detail

      • createUI

        public static javax.swing.plaf.ComponentUI createUI​(javax.swing.JComponent c)
      • installUI

        public void installUI​(javax.swing.JComponent c)
        Overrides:
        installUI in class javax.swing.plaf.ComponentUI
      • uninstallUI

        public void uninstallUI​(javax.swing.JComponent c)
        Overrides:
        uninstallUI in class javax.swing.plaf.ComponentUI
      • paint

        public void paint​(java.awt.Graphics g,
                          javax.swing.JComponent c)
        Overrides:
        paint in class javax.swing.plaf.ComponentUI
      • update

        public void update​(java.awt.Graphics g,
                           javax.swing.JComponent c)
        Overrides:
        update in class javax.swing.plaf.ComponentUI
      • getPreferredSize

        public java.awt.Dimension getPreferredSize​(javax.swing.JComponent c)
        Overrides:
        getPreferredSize in class javax.swing.plaf.ComponentUI
      • getMinimumSize

        public java.awt.Dimension getMinimumSize​(javax.swing.JComponent c)
        Overrides:
        getMinimumSize in class javax.swing.plaf.ComponentUI
      • getMaximumSize

        public java.awt.Dimension getMaximumSize​(javax.swing.JComponent c)
        Overrides:
        getMaximumSize in class javax.swing.plaf.ComponentUI
      • contains

        public boolean contains​(javax.swing.JComponent c,
                                int x,
                                int y)
        Overrides:
        contains in class javax.swing.plaf.ComponentUI
      • getBaseline

        public int getBaseline​(javax.swing.JComponent c,
                               int width,
                               int height)
        Overrides:
        getBaseline in class javax.swing.plaf.ComponentUI
      • getBaselineResizeBehavior

        public java.awt.Component.BaselineResizeBehavior getBaselineResizeBehavior​(javax.swing.JComponent c)
        Overrides:
        getBaselineResizeBehavior in class javax.swing.plaf.ComponentUI
      • getAccessibleChildrenCount

        public int getAccessibleChildrenCount​(javax.swing.JComponent c)
        Overrides:
        getAccessibleChildrenCount in class javax.swing.plaf.ComponentUI
      • getAccessibleChild

        public javax.accessibility.Accessible getAccessibleChild​(javax.swing.JComponent c,
                                                                 int i)
        Overrides:
        getAccessibleChild in class javax.swing.plaf.ComponentUI