Package docking.menu
Class DockingMenuItemUI
- java.lang.Object
-
- javax.swing.plaf.ComponentUI
-
- javax.swing.plaf.ButtonUI
-
- javax.swing.plaf.MenuItemUI
-
- docking.menu.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DockingMenuItemUI.MenuTabulator
static class
DockingMenuItemUI.SwitchGraphics2D
-
Field Summary
Fields Modifier and Type Field Description protected javax.swing.plaf.MenuItemUI
ui
-
Constructor Summary
Constructors Constructor Description DockingMenuItemUI()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(javax.swing.JComponent c, int x, int y)
static javax.swing.plaf.ComponentUI
createUI(javax.swing.JComponent c)
javax.accessibility.Accessible
getAccessibleChild(javax.swing.JComponent c, int i)
int
getAccessibleChildrenCount(javax.swing.JComponent c)
int
getBaseline(javax.swing.JComponent c, int width, int height)
java.awt.Component.BaselineResizeBehavior
getBaselineResizeBehavior(javax.swing.JComponent c)
java.awt.Dimension
getMaximumSize(javax.swing.JComponent c)
java.awt.Dimension
getMinimumSize(javax.swing.JComponent c)
java.awt.Dimension
getPreferredSize(javax.swing.JComponent c)
void
installUI(javax.swing.JComponent c)
void
paint(java.awt.Graphics g, javax.swing.JComponent c)
void
paintText(DockingMenuItemUI.SwitchGraphics2D sg, javax.swing.JMenuItem c, DockingMenuItemUI.MenuTabulator t)
void
uninstallUI(javax.swing.JComponent c)
void
update(java.awt.Graphics g, javax.swing.JComponent c)
-
-
-
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 classjavax.swing.plaf.ComponentUI
-
uninstallUI
public void uninstallUI(javax.swing.JComponent c)
- Overrides:
uninstallUI
in classjavax.swing.plaf.ComponentUI
-
paint
public void paint(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
paint
in classjavax.swing.plaf.ComponentUI
-
update
public void update(java.awt.Graphics g, javax.swing.JComponent c)
- Overrides:
update
in classjavax.swing.plaf.ComponentUI
-
paintText
public void paintText(DockingMenuItemUI.SwitchGraphics2D sg, javax.swing.JMenuItem c, DockingMenuItemUI.MenuTabulator t)
-
getPreferredSize
public java.awt.Dimension getPreferredSize(javax.swing.JComponent c)
- Overrides:
getPreferredSize
in classjavax.swing.plaf.ComponentUI
-
getMinimumSize
public java.awt.Dimension getMinimumSize(javax.swing.JComponent c)
- Overrides:
getMinimumSize
in classjavax.swing.plaf.ComponentUI
-
getMaximumSize
public java.awt.Dimension getMaximumSize(javax.swing.JComponent c)
- Overrides:
getMaximumSize
in classjavax.swing.plaf.ComponentUI
-
contains
public boolean contains(javax.swing.JComponent c, int x, int y)
- Overrides:
contains
in classjavax.swing.plaf.ComponentUI
-
getBaseline
public int getBaseline(javax.swing.JComponent c, int width, int height)
- Overrides:
getBaseline
in classjavax.swing.plaf.ComponentUI
-
getBaselineResizeBehavior
public java.awt.Component.BaselineResizeBehavior getBaselineResizeBehavior(javax.swing.JComponent c)
- Overrides:
getBaselineResizeBehavior
in classjavax.swing.plaf.ComponentUI
-
getAccessibleChildrenCount
public int getAccessibleChildrenCount(javax.swing.JComponent c)
- Overrides:
getAccessibleChildrenCount
in classjavax.swing.plaf.ComponentUI
-
getAccessibleChild
public javax.accessibility.Accessible getAccessibleChild(javax.swing.JComponent c, int i)
- Overrides:
getAccessibleChild
in classjavax.swing.plaf.ComponentUI
-
-