public class SubMenuChuiImpl extends SubMenu<ChuiOutputManager>
Sub-menu CHUI client implementation class.| Modifier and Type | Field and Description |
|---|---|
private Border<ChuiOutputManager> |
border
Border around the panel.
|
listeners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
SubMenuChuiImpl(WidgetId id,
SubMenuConfig cfg)
Special constructor used to restore component using given configuration.
|
| Modifier and Type | Method and Description |
|---|---|
protected Dimension |
bodyDimension()
Calculates body dimension
|
protected Point |
bodyLocation()
Get location of SUB-MENU body, relative to container.
|
Point |
childrenLocation(Widget<ChuiOutputManager> child)
Get children location for one child.
|
Dimension |
dimension()
Replace original version to take into account P2J specific behavior.
|
private Dimension |
dimension(boolean includeNested,
boolean includeTitle)
Replace original version to take into account P2J specific behavior.
|
void |
doLayout()
Lay out container.
|
void |
draw()
Draw the peer container.
|
void |
drawPanel()
Drawing worker method.
|
private void |
drawTitle(Point p)
Draws menu-item title, drawing mnemonic character as underlined.
|
static int |
getLongestItemAccelWidth(Container<?> menu)
Calculates max menu/sub-menu item accelerator width.
|
static int |
getLongestItemTitleWidth(Container<?> menu,
Widget<?> exclude)
Calculates max menu/sub-menu item title (config's) width.
|
static double |
getMaxItemHeight(AbstractContainer<?> menu,
boolean includeNested)
Calculates a max height of specified Menu or SubMenu.
|
static double |
getMaxItemWidth(Container<?> menu,
boolean includeNested)
Calculates max menu/sub-menu item width with borders.
|
java.util.List<Widget<ChuiOutputManager>> |
getTabItemList()
Returns the tab item list for this container.
|
double |
height()
Get sub-menu height.
|
protected void |
menuDropEvents(boolean fromMnemonic)
Raise the MENU-DROP 4GL events.
|
protected java.util.List<Widget<ChuiOutputManager>> |
prepareWidgets(java.util.List<Widget<ChuiOutputManager>> widgets)
Prepare widgets before drawing
|
protected Point |
prepParentLocation(Widget<?> parent)
Trick, that lets to correct parent location in cases, when it needed,
for example for menus.
|
double |
titleHeight()
Gets sub-menu title height
|
double |
titleWidth()
Gets sub-menu title width (with '->' if sub-menu is in other sub-menu or in popup menu)
|
double |
width()
Get widget width with borders.
|
afterConfigUpdate, ancestor, config, createLabelInfo, currentFocus, defaultFocus, focusTraversable, focusWorker, forceCursorOnFocus, getFirstFocusableItem, getFocusedChild, getLastFocusableItem, getPreparedLabel, getPreparedTitle, hasChildSubmenu, hideBody, initialize, isEnabled, isShowBody, manageSystemActions, processKeyEvent, processMnemonicEvent, repaint, requestFocus, setInitialFocus, setVisible, showBodyadd, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, clipping, clipRectangle, copyState, currentFocus, cycleFocus, deregisterSelectedWidget, destroy, detach, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, hasFocusable, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prevFocus, reflectAncestorChange, reflectLocationChanged, registerSelectedWidget, remove, removeContainerStateListener, replace, requestFocus, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setPhysicalDimensionInt, setSize, setSize, setTabItemList, setWidth, startSizeChange, swap, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, widgetStateChanged_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetParentMenu, getParentMenuContainer, getParentSubMenu, getParentSubMenuBody, getRootSubMenuacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestorId, bounds, canMovetoTop, clearWidget, completeTrigger, defaultMousePtr, destroy, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, insets, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isDroppable, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, minimumSize, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, requestFocus, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setWindow, show, startTrigger, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unrealize, unregisterWidgetListener, validateDisplayValue, widgetStateChanged, windowmouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleasedwidgetsAsListprivate Border<ChuiOutputManager> border
public SubMenuChuiImpl(WidgetId id, SubMenuConfig cfg)
id - The widget's ID.cfg - Configuration data.public static int getLongestItemAccelWidth(Container<?> menu)
public static int getLongestItemTitleWidth(Container<?> menu, Widget<?> exclude)
menu - Parent container: MENU or SUB-MENU.exclude - Current item, to exclude from processing.public static double getMaxItemHeight(AbstractContainer<?> menu, boolean includeNested)
menu - Menu or SubMenu.includeNested - true process nested sub-menus.public static double getMaxItemWidth(Container<?> menu, boolean includeNested)
menu - MENU or SUB-MENUincludeNested - true means, that we should process nested sub-menus,
false otherwise.public void drawPanel()
public void doLayout()
doLayout in interface Container<ChuiOutputManager>doLayout in class AbstractContainer<ChuiOutputManager>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 AbstractContainer<ChuiOutputManager>public Dimension dimension()
dimension in interface Widget<ChuiOutputManager>dimension in class AbstractContainer<ChuiOutputManager>Widget.dimension()public Point childrenLocation(Widget<ChuiOutputManager> child)
childrenLocation in interface Container<ChuiOutputManager>childrenLocation in class AbstractContainer<ChuiOutputManager>child - Child component.public double width()
width in interface Widget<ChuiOutputManager>width in class AbstractContainer<ChuiOutputManager>public double titleWidth()
titleWidth in class SubMenu<ChuiOutputManager>public double titleHeight()
public double height()
height in interface Widget<ChuiOutputManager>height in class AbstractContainer<ChuiOutputManager>public java.util.List<Widget<ChuiOutputManager>> getTabItemList()
getTabItemList in interface Container<ChuiOutputManager>getTabItemList in class AbstractContainer<ChuiOutputManager>protected void menuDropEvents(boolean fromMnemonic)
menuDropEvents in class SubMenu<ChuiOutputManager>fromMnemonic - Flag which indicates that the generated menu drop event is caused my a key event
(mnemonic). This is used by the event processor to detect if the first element
of the menu should be focused or not.protected java.util.List<Widget<ChuiOutputManager>> prepareWidgets(java.util.List<Widget<ChuiOutputManager>> widgets)
prepareWidgets in class AbstractContainer<ChuiOutputManager>widgets - Container children.protected Point bodyLocation()
bodyLocation in class SubMenu<ChuiOutputManager>protected Dimension bodyDimension()
bodyDimension in class SubMenu<ChuiOutputManager>protected Point prepParentLocation(Widget<?> parent)
prepParentLocation in class AbstractWidget<ChuiOutputManager>parent - Parent component.private void drawTitle(Point p)
p - Title point.private Dimension dimension(boolean includeNested, boolean includeTitle)
includeNested - true calculates dimension processing nested sub-menus.includeTitle - true add title height (1).Widget.dimension()