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

public Class XMenuWindow

extends XBaseMenuWindow
Class Inheritance
Known Direct Subclasses
sun.awt.X11.XPopupMenuPeer
Imports
java.awt.Dimension, .Graphics, .MenuItem, .Point, .Rectangle, .Toolkit, .Window, java.util.Vector, sun.awt.SunToolkit, sun.util.logging.PlatformLogger, javax.swing.SwingUtilities

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private static final int
private static final int[]
private static final int[]
private static PlatformLogger
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 static final int
Inherited from sun.awt.X11.XBaseMenuWindow:
grabInputPointhasPointerMoved

Constructor Summary

AccessConstructor and Description
pack-priv
XMenuWindow(XMenuPeer menuPeer)

Constructs XMenuWindow for specified XMenuPeer null for XPopupMenuWindow

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
ensureCreated()

Performs delayed creation of menu window if necessary

protected Dimension
getCaptionSize()

Returns size of menu window's caption or null if window has no caption.

pack-priv Dimension
getDesiredSize()

Returns desired size calculated while mapping

pack-priv XMenuPeer
getMenuPeer()

Returns corresponding menu peer

protected Window
pack-priv Vector<MenuItem>
getMenuTargetItems()

Reads vector of items from target This function is overridden in XPopupMenuPeer

protected XBaseMenuWindow
getParentMenuWindow()

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

Returns parent menu window (not the X-hierarchy parent window)

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.

pack-priv void
hide()

Hides menu window

pack-priv boolean
isCreated()

Checks if menu window is created

protected XMenuWindow.MappingData
map()

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

Performs mapping of items in window.

protected void
paintCaption(Graphics g, Rectangle rect)

Paints menu window's caption.

public void
paintPeer(Graphics g)

Overrides sun.awt.X11.XWindow.paintPeer.

Paints menu window

pack-priv void
pack-priv void
show(Rectangle
bounding rectangle of window in global coordinates
bounds
)

Init window if it's not inited yet and show it at specified coordinates

protected void
updateSize()

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

It's likely that size of items was changed invoke resizing of window on eventHandlerThread

Inherited from sun.awt.X11.XBaseMenuWindow:
addItemcopyItemsdelItemdisposedoDisposedoHandleJavaKeyEventdoHandleJavaMouseEventdoHandleJavaPaintEventdraw3DRectfitWindowAbovefitWindowBelowfitWindowLeftfitWindowRightfitWindowToScreengetBackgroundColorgetCurrentGraphicsConfigurationgetDarkShadowColorgetDisabledColorgetFirstSelectableItemgetForegroundColorgetItemgetItemFromPointgetLightShadowColorgetMappingDatagetMenuTreeLockgetMenuWindowFromPointgetNextSelectableItemgetPrevSelectableItemgetRootMenuWindowgetSelectedColorgetSelectedItemgetShowingLeafgetShowingSubmenugrabInputhandleEventinstantPreInitisEventDisabledpostEventpostPaintEventreloadItemsreplaceColorsresetColorsresetMappingselectItemsetItemsFont

Field Detail

CHECKMARK_SIZEback to summary
private static final int CHECKMARK_SIZE
CHECKMARK_Xback to summary
private static final int[] CHECKMARK_X
CHECKMARK_Yback to summary
private static final int[] CHECKMARK_Y
logback to summary
private static PlatformLogger log

Hides sun.awt.X11.XBaseMenuWindow.log.

Data members

WINDOW_ITEM_INDENTback to summary
private static final int WINDOW_ITEM_INDENT
WINDOW_ITEM_MARGIN_BOTTOMback to summary
private static final int WINDOW_ITEM_MARGIN_BOTTOM
WINDOW_ITEM_MARGIN_LEFTback to summary
private static final int WINDOW_ITEM_MARGIN_LEFT
WINDOW_ITEM_MARGIN_RIGHTback to summary
private static final int WINDOW_ITEM_MARGIN_RIGHT
WINDOW_ITEM_MARGIN_TOPback to summary
private static final int WINDOW_ITEM_MARGIN_TOP
WINDOW_SHORTCUT_SPACINGback to summary
private static final int WINDOW_SHORTCUT_SPACING
WINDOW_SPACING_BOTTOMback to summary
private static final int WINDOW_SPACING_BOTTOM
WINDOW_SPACING_LEFTback to summary
private static final int WINDOW_SPACING_LEFT
WINDOW_SPACING_RIGHTback to summary
private static final int WINDOW_SPACING_RIGHT
WINDOW_SPACING_TOPback to summary
private static final int WINDOW_SPACING_TOP

Constructor Detail

XMenuWindowback to summary
pack-priv XMenuWindow(XMenuPeer menuPeer)

Constructs XMenuWindow for specified XMenuPeer null for XPopupMenuWindow

Method Detail

ensureCreatedback to summary
pack-priv boolean ensureCreated()

Performs delayed creation of menu window if necessary

getCaptionSizeback to summary
protected Dimension getCaptionSize()

Returns size of menu window's caption or null if window has no caption. Can be overridden for popup menus and tear-off menus

getDesiredSizeback to summary
pack-priv Dimension getDesiredSize()

Returns desired size calculated while mapping

getMenuPeerback to summary
pack-priv XMenuPeer getMenuPeer()

Returns corresponding menu peer

getMenuTargetback to summary
protected Window getMenuTarget()
getMenuTargetItemsback to summary
pack-priv Vector<MenuItem> getMenuTargetItems()

Reads vector of items from target This function is overridden in XPopupMenuPeer

getParentMenuWindowback to summary
protected XBaseMenuWindow getParentMenuWindow()

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

Doc from sun.awt.X11.XBaseMenuWindow.getParentMenuWindow.

Returns parent menu window (not the X-hierarchy parent window)

Annotations
@Override
See Also
XBaseMenuWindow#getParentMenuWindow()
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
hideback to summary
pack-priv void hide()

Hides menu window

isCreatedback to summary
pack-priv boolean isCreated()

Checks if menu window is created

mapback to summary
protected XMenuWindow.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()
paintCaptionback to summary
protected void paintCaption(Graphics g, Rectangle rect)

Paints menu window's caption. Can be overridden for popup menus and tear-off menus. Default implementation does nothing

paintPeerback to summary
public void paintPeer(Graphics g)

Overrides sun.awt.X11.XWindow.paintPeer.

Paints menu window

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

Overrides sun.awt.X11.XWindow.postInit.

Initialization

Annotations
@Override
showback to summary
pack-priv void show(Rectangle bounds)

Init window if it's not inited yet and show it at specified coordinates

Parameters
bounds:Rectangle

bounding rectangle of window in global coordinates

updateSizeback to summary
protected void updateSize()

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

It's likely that size of items was changed invoke resizing of window on eventHandlerThread

Annotations
@Override
sun.awt.X11 back to summary

pack-priv final Class XMenuWindow.MappingData

extends MappingData
Class Inheritance

Mapping data

Field Summary

Modifier and TypeField and Description
private Rectangle
captionRect

Rectangle for the caption Necessary to fix 6267144: PIT: Popup menu label is not shown, XToolkit

private Dimension
desiredSize

Desired size of menu window

private int
leftMarkWidth

Width of largest checkmark At the same time the left origin of all item's text

private int
rightMarkOrigin

The origin of right mark (submenu's arrow)

private int
shortcutOrigin

Left origin of all shortcut labels

Constructor Summary

AccessConstructor and Description
pack-priv
MappingData(XMenuItemPeer[] items, Rectangle captionRect, Dimension desiredSize, int leftMarkWidth, int shortcutOrigin, int rightMarkOrigin)

pack-priv
MappingData()

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

Method Summary

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

Field Detail

captionRectback to summary
private Rectangle captionRect

Rectangle for the caption Necessary to fix 6267144: PIT: Popup menu label is not shown, XToolkit

desiredSizeback to summary
private Dimension desiredSize

Desired size of menu window

leftMarkWidthback to summary
private int leftMarkWidth

Width of largest checkmark At the same time the left origin of all item's text

rightMarkOriginback to summary
private int rightMarkOrigin

The origin of right mark (submenu's arrow)

shortcutOriginback to summary
private int shortcutOrigin

Left origin of all shortcut labels

Constructor Detail

MappingDataback to summary
pack-priv MappingData(XMenuItemPeer[] items, Rectangle captionRect, Dimension desiredSize, int leftMarkWidth, int shortcutOrigin, int rightMarkOrigin)
MappingDataback to summary
pack-priv MappingData()

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

Method Detail

getCaptionRectback to summary
public Rectangle getCaptionRect()
getDesiredSizeback to summary
public Dimension getDesiredSize()
getLeftMarkWidthback to summary
public int getLeftMarkWidth()
getRightMarkOriginback to summary
public int getRightMarkOrigin()
getShortcutOriginback to summary
public int getShortcutOrigin()