Methods Summary |
---|
protected javax.swing.event.ChangeListener | createChangeListener()
return getHandler();
|
protected java.awt.event.ContainerListener | createContainerListener()
return getHandler();
|
public static javax.swing.plaf.ComponentUI | createUI(javax.swing.JComponent x)
return new BasicMenuBarUI();
|
private javax.swing.plaf.basic.BasicMenuBarUI$Handler | getHandler()
if (handler == null) {
handler = new Handler();
}
return handler;
|
javax.swing.InputMap | getInputMap(int condition)
if (condition == JComponent.WHEN_IN_FOCUSED_WINDOW) {
Object[] bindings = (Object[])DefaultLookup.get
(menuBar, this, "MenuBar.windowBindings");
if (bindings != null) {
return LookAndFeel.makeComponentInputMap(menuBar, bindings);
}
}
return null;
|
public java.awt.Dimension | getMaximumSize(javax.swing.JComponent c)
return null;
|
public java.awt.Dimension | getMinimumSize(javax.swing.JComponent c)
return null;
|
protected void | installDefaults()
if (menuBar.getLayout() == null ||
menuBar.getLayout() instanceof UIResource) {
menuBar.setLayout(new DefaultMenuLayout(menuBar,BoxLayout.LINE_AXIS));
}
LookAndFeel.installProperty(menuBar, "opaque", Boolean.TRUE);
LookAndFeel.installBorder(menuBar,"MenuBar.border");
LookAndFeel.installColorsAndFont(menuBar,
"MenuBar.background",
"MenuBar.foreground",
"MenuBar.font");
|
protected void | installKeyboardActions()
InputMap inputMap = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
SwingUtilities.replaceUIInputMap(menuBar,
JComponent.WHEN_IN_FOCUSED_WINDOW, inputMap);
LazyActionMap.installLazyActionMap(menuBar, BasicMenuBarUI.class,
"MenuBar.actionMap");
|
protected void | installListeners()
containerListener = createContainerListener();
changeListener = createChangeListener();
for (int i = 0; i < menuBar.getMenuCount(); i++) {
JMenu menu = menuBar.getMenu(i);
if (menu!=null)
menu.getModel().addChangeListener(changeListener);
}
menuBar.addContainerListener(containerListener);
|
public void | installUI(javax.swing.JComponent c)
menuBar = (JMenuBar) c;
installDefaults();
installListeners();
installKeyboardActions();
|
static void | loadActionMap(javax.swing.plaf.basic.LazyActionMap map)
map.put(new Actions(Actions.TAKE_FOCUS));
|
protected void | uninstallDefaults()
if (menuBar!=null) {
LookAndFeel.uninstallBorder(menuBar);
}
|
protected void | uninstallKeyboardActions()
SwingUtilities.replaceUIInputMap(menuBar, JComponent.
WHEN_IN_FOCUSED_WINDOW, null);
SwingUtilities.replaceUIActionMap(menuBar, null);
|
protected void | uninstallListeners()
menuBar.removeContainerListener(containerListener);
for (int i = 0; i < menuBar.getMenuCount(); i++) {
JMenu menu = menuBar.getMenu(i);
if (menu !=null)
menu.getModel().removeChangeListener(changeListener);
}
containerListener = null;
changeListener = null;
handler = null;
|
public void | uninstallUI(javax.swing.JComponent c)
uninstallDefaults();
uninstallListeners();
uninstallKeyboardActions();
menuBar = null;
|