de.javasoft.plaf.synthetica
Class SyntheticaMenuItemUI

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 de.javasoft.plaf.synthetica.SyntheticaMenuItemUI
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.plaf.synth.SynthConstants
Direct Known Subclasses:
SyntheticaCheckBoxMenuItemUI, SyntheticaRadioButtonMenuItemUI

public class SyntheticaMenuItemUI
extends javax.swing.plaf.basic.BasicMenuItemUI
implements java.beans.PropertyChangeListener, javax.swing.plaf.synth.SynthConstants

Synthetica MenuItem UI. MenuItemGap (Synth property "MenuItem.textIconGap") defines the horizontal gap between menu items and at the edges, default is 4.

Optional UI-properties:

  • Synthetica.menuItem.textIconGap - Integer, horizontal space between icon and text, default is MenuItemGap.
  • Synthetica.menuItem.acceleratorGap - Integer, horizontal space between text and accelerator, default is MenuItemGap * 4.
  • Synthetica.menuItem.justifySize - Boolean, round up item width and height by 1 to become odd, default is true.
  • Synthetica.menuItem.paintDebugRectangles - Boolean, enable painting rectangles around menu elements for debugging, default is false.
  • Synthetica.menuItem.useMacAcceleratorChars - Boolean, use MAC OS specific chars to display Control, Shift, Option and Command keys, default is false.
  • Synthetica.popupMenu.iconSeparatorGap - Integer, additional horizontal space between icon and menu item text, default is 0.
  • Synthetica.popupMenu.centerText - Boolean, center menu item text, default is false.
  • Synthetica.popupMenu.forceIconSpace - Boolean, force extra space for menu icons, default is false.
  • Synthetica.popupMenu.defaultIconWidth - Integer, used as default if a menu item has no icon and icon space is forced, default is 16.
  • Synthetica.popupMenu.respectTopLevelMenuWidth - Boolean, the minimum toplevel popup menu width is as large as the toplevel menu width, default is true.
  • Synthetica.popupMenu.dynamicItemSupport - Boolean, false means the popup width is based on the largest ever used item, default is false.
  • Version:
    1.31, 26.09.2013

    Nested Class Summary
     
    Nested classes/interfaces inherited from class javax.swing.plaf.basic.BasicMenuItemUI
    javax.swing.plaf.basic.BasicMenuItemUI.MouseInputHandler
     
    Field Summary
     
    Fields inherited from class javax.swing.plaf.basic.BasicMenuItemUI
    acceleratorFont, acceleratorForeground, acceleratorSelectionForeground, arrowIcon, checkIcon, defaultTextIconGap, disabledForeground, menuDragMouseListener, menuItem, menuKeyListener, mouseInputListener, oldBorderPainted, propertyChangeListener, selectionBackground, selectionForeground
     
    Fields inherited from interface javax.swing.plaf.synth.SynthConstants
    DEFAULT, DISABLED, ENABLED, FOCUSED, MOUSE_OVER, PRESSED, SELECTED
     
    Constructor Summary
    SyntheticaMenuItemUI()
               
     
    Method Summary
    static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
               
    protected  java.awt.Dimension getPreferredMenuItemSize(javax.swing.JComponent c, javax.swing.Icon checkIcon, javax.swing.Icon arrowIcon, int defaultTextIconGap)
               
    protected  void installDefaults()
               
    protected  void installListeners()
               
     void paint(java.awt.Graphics g, javax.swing.JComponent c)
               
     void propertyChange(java.beans.PropertyChangeEvent evt)
               
    static void resetPopupMenu(javax.swing.JPopupMenu popup)
              Removes popupMenu related values (like maximum width) from the cache.
    protected  void uninstallDefaults()
               
    protected  void uninstallListeners()
               
     void update(java.awt.Graphics g, javax.swing.JComponent c)
               
     
    Methods inherited from class javax.swing.plaf.basic.BasicMenuItemUI
    createMenuDragMouseListener, createMenuKeyListener, createMouseInputListener, createPropertyChangeListener, doClick, getMaximumSize, getMinimumSize, getPath, getPreferredSize, getPropertyPrefix, installComponents, installKeyboardActions, installUI, paintBackground, paintMenuItem, paintText, uninstallComponents, uninstallKeyboardActions, uninstallUI
     
    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
     

    Constructor Detail

    SyntheticaMenuItemUI

    public SyntheticaMenuItemUI()
    Method Detail

    createUI

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

    installDefaults

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

    installListeners

    protected void installListeners()
    Overrides:
    installListeners in class javax.swing.plaf.basic.BasicMenuItemUI

    uninstallDefaults

    protected void uninstallDefaults()
    Overrides:
    uninstallDefaults in class javax.swing.plaf.basic.BasicMenuItemUI

    uninstallListeners

    protected void uninstallListeners()
    Overrides:
    uninstallListeners 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

    update

    public void update(java.awt.Graphics g,
                       javax.swing.JComponent c)
    Overrides:
    update in class javax.swing.plaf.basic.BasicMenuItemUI

    paint

    public void paint(java.awt.Graphics g,
                      javax.swing.JComponent c)
    Overrides:
    paint in class javax.swing.plaf.basic.BasicMenuItemUI

    resetPopupMenu

    public static void resetPopupMenu(javax.swing.JPopupMenu popup)
    Removes popupMenu related values (like maximum width) from the cache.


    propertyChange

    public void propertyChange(java.beans.PropertyChangeEvent evt)
    Specified by:
    propertyChange in interface java.beans.PropertyChangeListener


    Copyright © 2004-2011 Jyloo Software. All Rights Reserved.