javax.swing.plaf.basic
public class BasicMenuBarUI extends MenuBarUI
Modifier and Type | Field and Description |
---|---|
protected ChangeListener |
changeListener |
protected ContainerListener |
containerListener |
protected JMenuBar |
menuBar |
Constructor and Description |
---|
BasicMenuBarUI()
Creates a new BasicMenuBarUI object.
|
Modifier and Type | Method and Description |
---|---|
protected ChangeListener |
createChangeListener()
Creates ChangeListener
|
protected ContainerListener |
createContainerListener()
Creates ContainerListener() to listen for ContainerEvents
fired by JMenuBar.
|
static ComponentUI |
createUI(JComponent x)
Factory method to create a BasicMenuBarUI for the given
JComponent , which should be a JMenuBar . |
Dimension |
getMaximumSize(JComponent c)
Returns maximum size for the specified menu bar
|
Dimension |
getMinimumSize(JComponent c)
Returns maximum allowed size of JMenuBar.
|
Dimension |
getPreferredSize(JComponent c)
Returns preferred size of JMenuBar.
|
protected void |
installDefaults()
Initializes any default properties that this UI has from the defaults for
the Basic look and feel.
|
protected void |
installKeyboardActions()
This method installs the keyboard actions for the JMenuBar.
|
protected void |
installListeners()
This method installs the listeners needed for this UI to function.
|
void |
installUI(JComponent c)
Installs and initializes all fields for this UI delegate.
|
protected void |
uninstallDefaults()
This method uninstalls the defaults and nulls any objects created during
install.
|
protected void |
uninstallKeyboardActions()
This method reverses the work done in installKeyboardActions.
|
protected void |
uninstallListeners()
Unregisters all the listeners that this UI delegate was using.
|
void |
uninstallUI(JComponent c)
Performs the opposite of installUI.
|
contains, getAccessibleChild, getAccessibleChildrenCount, paint, update
protected ChangeListener changeListener
protected ContainerListener containerListener
public BasicMenuBarUI()
protected ChangeListener createChangeListener()
protected ContainerListener createContainerListener()
public static ComponentUI createUI(JComponent x)
JComponent
, which should be a JMenuBar
.x
- The JComponent
a UI is being created for.JComponent
.public Dimension getMaximumSize(JComponent c)
getMaximumSize
in class ComponentUI
c
- component for which to get maximum sizepublic Dimension getMinimumSize(JComponent c)
getMinimumSize
in class ComponentUI
c
- menuBar for which to return maximum sizepublic Dimension getPreferredSize(JComponent c)
getPreferredSize
in class ComponentUI
c
- menuBar for which to return preferred sizeprotected void installDefaults()
protected void installKeyboardActions()
protected void installListeners()
public void installUI(JComponent c)
installUI
in class ComponentUI
c
- The JComponent
that is having this UI installed.ComponentUI.uninstallUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
protected void uninstallDefaults()
protected void uninstallKeyboardActions()
protected void uninstallListeners()
public void uninstallUI(JComponent c)
uninstallUI
in class ComponentUI
c
- The JComponent
that is having this UI uninstalled.ComponentUI.installUI(javax.swing.JComponent)
,
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()