| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private Rectangle | bounds
Rectangle occupied by menu item in container's coordinates. |
| private XBaseMenuWindow | container
Window that this item belongs to. |
| private static final int | |
| private static final int | |
| private MenuItem | target
Target MenuItem. |
| private XMenuItemPeer. | textMetrics
Text metrics are filled in calcTextMetrics function and reset in resetTextMetrics function. |
| private Point | textOrigin
Point in container's coordinate system used as origin by drawText. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | action(long
the timestamp of action event when, int modifiers)This function is invoked when the user clicks on menu item. |
| pack-priv XMenuItemPeer. | |
| public void | |
| pack-priv Rectangle | |
| pack-priv XBaseMenuWindow | |
| pack-priv String | |
| pack-priv MenuItem | |
| pack-priv String | |
| pack-priv Font | |
| pack-priv String | |
| pack-priv MenuShortcut | |
| pack-priv XMenuItemPeer. | |
| pack-priv Point | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv boolean | |
| pack-priv boolean | isTargetItemEnabled()
Returns true if item and all its parents are enabled This function is used to fix 6184485: Popup menu is not disabled on XToolkit even when calling setEnabled (false) |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | |
| pack-priv void | setContainer(XBaseMenuWindow
the window that this item belongs to. container)This function is called when filling item vectors in XMenuWindow & XMenuBar. |
| public void | setEnabled(boolean enabled)
Implements java. Enables or disables the menu item. |
| public void | setFont(Font font)
Implements java. Sets the font for the menu component. |
| public void | setLabel(String label)
Implements java. Sets the label to be displayed in this menu item. |
| bounds | back to summary |
|---|---|
| private Rectangle bounds Rectangle occupied by menu item in container's coordinates. Filled by map(...) function from XBaseMenuWindow.map() | |
| container | back to summary |
|---|---|
| private XBaseMenuWindow container Window that this item belongs to. | |
| SEPARATOR_HEIGHT | back to summary |
|---|---|
| private static final int SEPARATOR_HEIGHT | |
| SEPARATOR_WIDTH | back to summary |
|---|---|
| private static final int SEPARATOR_WIDTH | |
| target | back to summary |
|---|---|
| private MenuItem target Target MenuItem. Note that 'target' member in XWindow is required for dispatching events. This member is only used for accessing its fields and firing ActionEvent & ItemEvent | |
| textMetrics | back to summary |
|---|---|
| private XMenuItemPeer. Text metrics are filled in calcTextMetrics function and reset in resetTextMetrics function. Text metrics contain calculated dimensions of various components of menu item. | |
| textOrigin | back to summary |
|---|---|
| private Point textOrigin Point in container's coordinate system used as origin by drawText. | |
| XMenuItemPeer | back to summary |
|---|---|
| pack-priv XMenuItemPeer(MenuItem target) Construction | |
| action | back to summary |
|---|---|
| pack-priv void action(long when, int modifiers) This function is invoked when the user clicks on menu item.
| |
| calcTextMetrics | back to summary |
|---|---|
| pack-priv XMenuItemPeer. Returns width of item's shortcut label, 0 if item has no shortcut. The height of shortcut can be determined from text dimensions. This function does not use any locks and is guaranteed to return some value (possibly actual, possibly expired) | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements java. Implementation of interface methods
| |
| getBounds | back to summary |
|---|---|
| pack-priv Rectangle getBounds() returns bounds of item that were previously set by map() function | |
| getContainer | back to summary |
|---|---|
| pack-priv XBaseMenuWindow getContainer() returns the window that this item belongs to | |
| getShortcutText | back to summary |
|---|---|
| pack-priv String getShortcutText() | |
| getTarget | back to summary |
|---|---|
| pack-priv MenuItem getTarget() Access to target's fields | |
| getTargetActionCommand | back to summary |
|---|---|
| pack-priv String getTargetActionCommand() | |
| getTargetFont | back to summary |
|---|---|
| pack-priv Font getTargetFont() | |
| getTargetLabel | back to summary |
|---|---|
| pack-priv String getTargetLabel() | |
| getTargetShortcut | back to summary |
|---|---|
| pack-priv MenuShortcut getTargetShortcut() | |
| getTextMetrics | back to summary |
|---|---|
| pack-priv XMenuItemPeer. Returns text metrics of menu item. This function does not use any locks and is guaranteed to return some value (possibly actual, possibly expired) | |
| getTextOrigin | back to summary |
|---|---|
| pack-priv Point getTextOrigin() returns origin of item's text that was previously set by map() function | |
| isContainerShowing | back to summary |
|---|---|
| pack-priv boolean isContainerShowing() Returns true if container exists and is showing | |
| isSeparator | back to summary |
|---|---|
| pack-priv boolean isSeparator() This function should be overridden simply to return false in inherited classes. | |
| isTargetEnabled | back to summary |
|---|---|
| pack-priv boolean isTargetEnabled() | |
| isTargetItemEnabled | back to summary |
|---|---|
| pack-priv boolean isTargetItemEnabled() Returns true if item and all its parents are enabled This function is used to fix 6184485: Popup menu is not disabled on XToolkit even when calling setEnabled (false) | |
| map | back to summary |
|---|---|
| pack-priv void map(Rectangle bounds, Point textOrigin) Sets mapping of item to window.
| |
| repaintIfShowing | back to summary |
|---|---|
| pack-priv void repaintIfShowing() Repaints item if it is showing | |
| resetTextMetrics | back to summary |
|---|---|
| pack-priv void resetTextMetrics() | |
| setContainer | back to summary |
|---|---|
| pack-priv void setContainer(XBaseMenuWindow container) This function is called when filling item vectors in XMenuWindow & XMenuBar. We need it because peers are created earlier than windows.
| |
| setEnabled | back to summary |
|---|---|
| public void setEnabled(boolean enabled) Implements java. Doc from java. Enables or disables the menu item.
| |
| setFont | back to summary |
|---|---|
| public void setFont(Font font) Implements java. Doc from java. Sets the font for the menu component.
| |
| setLabel | back to summary |
|---|---|
| public void setLabel(String label) Implements java. Doc from java. Sets the label to be displayed in this menu item.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private int | |
| private Dimension |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| pack-priv int | |
| pack-priv int | |
| pack-priv Dimension |
| shortcutWidth | back to summary |
|---|---|
| private int shortcutWidth | |
| textBaseline | back to summary |
|---|---|
| private int textBaseline | |
| textDimension | back to summary |
|---|---|
| private Dimension textDimension | |
| TextMetrics | back to summary |
|---|---|
| pack-priv TextMetrics(Dimension textDimension, int shortcutWidth, int textBaseline) | |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| getShortcutWidth | back to summary |
|---|---|
| pack-priv int getShortcutWidth() | |
| getTextBaseline | back to summary |
|---|---|
| pack-priv int getTextBaseline() | |
| getTextDimension | back to summary |
|---|---|
| pack-priv Dimension getTextDimension() | |