APIdia Launch Partner
Top Inners Fields Constructors Methods
sun.awt.X11

public final Class XMenuBarPeer

extends XBaseMenuWindow
implements MenuBarPeer
Class Inheritance
All Implemented Interfaces
java.awt.peer.MenuBarPeer, java.awt.peer.MenuComponentPeer
Imports
java.awt.*, java.awt.peer.*, java.awt.event.*, java.util.Vector, sun.util.logging.PlatformLogger, sun.awt.AWTAccessor

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
XMenuBarPeer.MappingData

XBaseMenuWindow's mappingData is extended with desired height of menu bar

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private XFramePeer
pack-priv static final int
private XMenuPeer
private static PlatformLogger
pack-priv static final int
Inherited from sun.awt.X11.XBaseMenuWindow:
grabInputPointhasPointerMoved

Constructor Summary

AccessConstructor and Description
pack-priv
XMenuBarPeer(MenuBar menuBarTarget)

Construction

Method Summary

Modifier and TypeMethod and Description
public void
addHelpMenu(Menu m)

Implements java.awt.peer.MenuBarPeer.addHelpMenu.

Adds a help menu to the menu bar.

public void
addMenu(Menu m)

Implements java.awt.peer.MenuBarPeer.addMenu.

Adds a menu to the menu bar.

public void
delMenu(int index)

Implements java.awt.peer.MenuBarPeer.delMenu.

Deletes a menu from the menu bar.

protected void
doDispose()

Overrides sun.awt.X11.XBaseMenuWindow.doDispose.

Performs disposal of menu window.

pack-priv int
getDesiredHeight()

Returns desired height of menu bar

protected XBaseMenuWindow
getParentMenuWindow()

Implements abstract sun.awt.X11.XBaseMenuWindow.getParentMenuWindow.

Menu bar is always root window in menu window's hierarchy

protected Rectangle
getSubmenuBounds(Rectangle itemBounds, Dimension windowSize)

Implements abstract sun.awt.X11.XBaseMenuWindow.getSubmenuBounds.

Calculates placement of submenu window given bounds of item with submenu and size of submenu window.

protected void
handleEvent(AWTEvent event)

Overrides sun.awt.X11.XBaseMenuWindow.handleEvent.

Overridden XBaseMenuWindow event handling

pack-priv void
handleF10KeyPress(KeyEvent event)

Overridden XWindow keyboard processing

public void
public void
init(Frame frame)

called from XFramePeer.setMenuBar

pack-priv boolean
isFramePeerEnabled()

Returns true if framePeer is not null and is enabled Used to fix 6185057: Disabling a frame does not disable the menus on the frame, on solaris/linux

protected XMenuBarPeer.MappingData
map()

Implements abstract sun.awt.X11.XBaseMenuWindow.map.

Performs mapping of items in window.

public void
paintPeer(Graphics g)

Overrides sun.awt.X11.XWindow.paintPeer.

Overridden XWindow painting & printing

pack-priv void
postInit(XCreateWindowParams params)

Overrides sun.awt.X11.XWindow.postInit.

Overridden initialization

public void
reshape(int x, int y, int width, int height)

Overrides sun.awt.X11.XWindow.reshape.

For menu bars this function is called from framePeer's reshape(...) and updateChildrenSizes()

public void
setFont(Font f)

Implements java.awt.peer.MenuComponentPeer.setFont.

Implementation of interface methods

pack-priv void
ungrabInputImpl()

Overrides sun.awt.X11.XBaseWindow.ungrabInputImpl.

Performs ungrabbing of input

protected void
updateSize()

Implements abstract sun.awt.X11.XBaseMenuWindow.updateSize.

This function is called when it's likely that size of items has changed.

Inherited from sun.awt.X11.XBaseMenuWindow:
addItemcopyItemsdelItemdisposedoHandleJavaKeyEventdoHandleJavaMouseEventdoHandleJavaPaintEventdraw3DRectfitWindowAbovefitWindowBelowfitWindowLeftfitWindowRightfitWindowToScreengetBackgroundColorgetCurrentGraphicsConfigurationgetDarkShadowColorgetDisabledColorgetFirstSelectableItemgetForegroundColorgetItemgetItemFromPointgetLightShadowColorgetMappingDatagetMenuTreeLockgetMenuWindowFromPointgetNextSelectableItemgetPrevSelectableItemgetRootMenuWindowgetSelectedColorgetSelectedItemgetShowingLeafgetShowingSubmenugrabInputinstantPreInitisEventDisabledpostEventpostPaintEventreloadItemsreplaceColorsresetColorsresetMappingselectItemsetItemsFont

Field Detail

BAR_ITEM_MARGIN_BOTTOMback to summary
private static final int BAR_ITEM_MARGIN_BOTTOM
BAR_ITEM_MARGIN_LEFTback to summary
private static final int BAR_ITEM_MARGIN_LEFT
BAR_ITEM_MARGIN_RIGHTback to summary
private static final int BAR_ITEM_MARGIN_RIGHT
BAR_ITEM_MARGIN_TOPback to summary
private static final int BAR_ITEM_MARGIN_TOP
BAR_ITEM_SPACINGback to summary
private static final int BAR_ITEM_SPACING
BAR_SPACING_BOTTOMback to summary
private static final int BAR_SPACING_BOTTOM
BAR_SPACING_LEFTback to summary
private static final int BAR_SPACING_LEFT
BAR_SPACING_RIGHTback to summary
private static final int BAR_SPACING_RIGHT
BAR_SPACING_TOPback to summary
private static final int BAR_SPACING_TOP
framePeerback to summary
private XFramePeer framePeer
H_DIFFback to summary
pack-priv static final int H_DIFF
helpMenuback to summary
private XMenuPeer helpMenu
logback to summary
private static PlatformLogger log

Hides sun.awt.X11.XBaseMenuWindow.log.

Data members

W_DIFFback to summary
pack-priv static final int W_DIFF

Constructor Detail

XMenuBarPeerback to summary
pack-priv XMenuBarPeer(MenuBar menuBarTarget)

Construction

Method Detail

addHelpMenuback to summary
public void addHelpMenu(Menu m)

Implements java.awt.peer.MenuBarPeer.addHelpMenu.

Doc from java.awt.peer.MenuBarPeer.addHelpMenu.

Adds a help menu to the menu bar.

Annotations
@Override
addMenuback to summary
public void addMenu(Menu m)

Implements java.awt.peer.MenuBarPeer.addMenu.

Doc from java.awt.peer.MenuBarPeer.addMenu.

Adds a menu to the menu bar.

Annotations
@Override
delMenuback to summary
public void delMenu(int index)

Implements java.awt.peer.MenuBarPeer.delMenu.

Doc from java.awt.peer.MenuBarPeer.delMenu.

Deletes a menu from the menu bar.

Annotations
@Override
doDisposeback to summary
protected void doDispose()

Overrides sun.awt.X11.XBaseMenuWindow.doDispose.

Doc from sun.awt.X11.XBaseMenuWindow.doDispose.

Performs disposal of menu window. Should be called only on eventHandlerThread

Annotations
@Override
See Also
XBaseMenuWindow#doDispose()
getDesiredHeightback to summary
pack-priv int getDesiredHeight()

Returns desired height of menu bar

getParentMenuWindowback to summary
protected XBaseMenuWindow getParentMenuWindow()

Implements abstract sun.awt.X11.XBaseMenuWindow.getParentMenuWindow.

Menu bar is always root window in menu window's hierarchy

Annotations
@Override
getSubmenuBoundsback to summary
protected Rectangle getSubmenuBounds(Rectangle itemBounds, Dimension windowSize)

Implements abstract sun.awt.X11.XBaseMenuWindow.getSubmenuBounds.

Doc from sun.awt.X11.XBaseMenuWindow.getSubmenuBounds.

Calculates placement of submenu window given bounds of item with submenu and size of submenu window. Returns suggested rectangle for submenu window in global coordinates

Annotations
@Override
See Also
XBaseMenuWindow#getSubmenuBounds
handleEventback to summary
protected void handleEvent(AWTEvent event)

Overrides sun.awt.X11.XBaseMenuWindow.handleEvent.

Overridden XBaseMenuWindow event handling

Annotations
@Override
handleF10KeyPressback to summary
pack-priv void handleF10KeyPress(KeyEvent event)

Overridden XWindow keyboard processing

Annotations
@SuppressWarnings:deprecation
handleKeyPressback to summary
public void handleKeyPress(XEvent xev)

Overrides sun.awt.X11.XWindow.handleKeyPress.

Annotations
@Override
initback to summary
public void init(Frame frame)

called from XFramePeer.setMenuBar

isFramePeerEnabledback to summary
pack-priv boolean isFramePeerEnabled()

Returns true if framePeer is not null and is enabled Used to fix 6185057: Disabling a frame does not disable the menus on the frame, on solaris/linux

mapback to summary
protected XMenuBarPeer.MappingData map()

Implements abstract sun.awt.X11.XBaseMenuWindow.map.

Doc from sun.awt.X11.XBaseMenuWindow.map.

Performs mapping of items in window. This function creates and fills specific descendant of MappingData and sets mapping coordinates of items This function should return default menu data if errors occur

Annotations
@Override
See Also
XBaseMenuWindow#map
paintPeerback to summary
public void paintPeer(Graphics g)

Overrides sun.awt.X11.XWindow.paintPeer.

Overridden XWindow painting & printing

Annotations
@Override
postInitback to summary
pack-priv void postInit(XCreateWindowParams params)

Overrides sun.awt.X11.XWindow.postInit.

Overridden initialization

Annotations
@Override
reshapeback to summary
public void reshape(int x, int y, int width, int height)

Overrides sun.awt.X11.XWindow.reshape.

For menu bars this function is called from framePeer's reshape(...) and updateChildrenSizes()

Annotations
@Override
setFontback to summary
public void setFont(Font f)

Implements java.awt.peer.MenuComponentPeer.setFont.

Implementation of interface methods

Annotations
@Override
ungrabInputImplback to summary
pack-priv void ungrabInputImpl()

Overrides sun.awt.X11.XBaseWindow.ungrabInputImpl.

Performs ungrabbing of input

Annotations
@Override
See Also
XBaseWindow#ungrabInputImpl()
updateSizeback to summary
protected void updateSize()

Implements abstract sun.awt.X11.XBaseMenuWindow.updateSize.

This function is called when it's likely that size of items has changed. Invokes framePeer's updateChildrenSizes()

Annotations
@Override
sun.awt.X11 back to summary

pack-priv final Class XMenuBarPeer.MappingData

extends MappingData
Class Inheritance

XBaseMenuWindow's mappingData is extended with desired height of menu bar

Field Summary

Modifier and TypeField and Description
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
MappingData(XMenuItemPeer[] items, int desiredHeight)

pack-priv
MappingData()

Constructs MappingData without items This constructor should be used in case of errors

Method Summary

Modifier and TypeMethod and Description
public int
Inherited from sun.awt.X11.XBaseMenuWindow.MappingData:
clonegetItems

Field Detail

desiredHeightback to summary
pack-priv int desiredHeight

Constructor Detail

MappingDataback to summary
pack-priv MappingData(XMenuItemPeer[] items, int desiredHeight)
MappingDataback to summary
pack-priv MappingData()

Constructs MappingData without items This constructor should be used in case of errors

Method Detail

getDesiredHeightback to summary
public int getDesiredHeight()