public class MenuItemChuiImpl extends MenuItem<ChuiOutputManager>
Menu
CHUI client implementation class.Widget.ZOrderClass
Modifier and Type | Field and Description |
---|---|
private static int |
ACCEL_PAD
menu-item accelerator left padding in a sub-menu body or in a MENUBAR in characters.
|
private static int |
LEFT_PAD
This menu-item left padding in a sub-menu body or in a MENUBAR in pixels.
|
private static int |
RIGHT_PAD
This menu-item right padding in a sub-menu body or in a MENUBAR in pixels.
|
private static int |
SM_ARROW_PAD
Sub-menu arrow left padding in characters.
|
private static int |
SM_ARROW_WIDTH
Sub-menu arrow width (for toggle-box) in characters.
|
insets, location, LOG, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
MenuItemChuiImpl(WidgetId id,
MenuItemConfig cfg)
Special constructor used to restore component using given configuration.
|
Modifier and Type | Method and Description |
---|---|
Dimension |
dimension()
Get widget dimension.
|
void |
draw()
Draw the peer container.
|
private void |
drawTitle(Point p,
Color dColor)
Draws menu-item title, drawing mnemonic character as underlined.
|
boolean |
focusTraversable()
Check if widget is focus traversable.
|
double |
height()
Get widget height.
|
Dimension |
minimumSize()
Get widget minimum size.
|
protected Point |
prepParentLocation(Widget<?> parent)
Trick, that lets to correct parent location in cases, when it needed,
for example for menus.
|
protected void |
selectMenuItem()
Process an event which trigger selection of this menu-item, depending if the item is a
toggle-box or not.
|
double |
width()
Get widget width.
|
afterConfigUpdate, config, createLabelInfo, forceCursorOnFocus, getPreparedLabel, getPreparedTitle, initialize, isInitDisabled, isNormal, isRule, isSkip, processKeyEvent, setTitle
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, createMouseHoverAction, deactivateDirectManipulation, debug, destroy, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, findMouseSource, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, ignoreAction, insets, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, unrealize, updateSizeWorker, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getParentMenu, getParentMenuContainer, getParentSubMenu
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, defaultMousePtr, destroy, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, insets, isDirectManipulable, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, repaint, requestFocus, requestSync, resizeTo, screen, screenLocation, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, supportsCustomMousePointer, topLevelWindow, unrealize, window
private static final int LEFT_PAD
private static final int RIGHT_PAD
private static final int SM_ARROW_PAD
private static final int ACCEL_PAD
private static final int SM_ARROW_WIDTH
public MenuItemChuiImpl(WidgetId id, MenuItemConfig cfg)
id
- The widget's ID.cfg
- Configuration data.public void draw()
Drawing for the redirected terminal differs. Labels/headers are drawn only once per page, instead of the usual once per menu.
draw
in interface Widget<ChuiOutputManager>
draw
in class AbstractWidget<ChuiOutputManager>
public Dimension dimension()
dimension
in interface Widget<ChuiOutputManager>
dimension
in class AbstractWidget<ChuiOutputManager>
public double height()
height
in interface Widget<ChuiOutputManager>
height
in class AbstractWidget<ChuiOutputManager>
public Dimension minimumSize()
minimumSize
in interface Widget<ChuiOutputManager>
minimumSize
in class AbstractWidget<ChuiOutputManager>
public double width()
width
in interface Widget<ChuiOutputManager>
width
in class AbstractWidget<ChuiOutputManager>
public boolean focusTraversable()
focusTraversable
in interface Widget<ChuiOutputManager>
focusTraversable
in class AbstractWidget<ChuiOutputManager>
true
if widget is focus traversable.protected Point prepParentLocation(Widget<?> parent)
prepParentLocation
in class AbstractWidget<ChuiOutputManager>
parent
- Parent component.protected void selectMenuItem()
selectMenuItem
in class MenuItem<ChuiOutputManager>