public class SubMenuChuiImpl extends SubMenu<ChuiOutputManager>
Sub-menu
CHUI client implementation class.Widget.ZOrderClass
Modifier and Type | Field and Description |
---|---|
private Border<ChuiOutputManager> |
border
Border around the panel.
|
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.
|
double |
height()
Get sub-menu height.
|
protected void |
menuDropEvents()
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, defaultFocus, focusTraversable, focusWorker, forceCursorOnFocus, getFirstFocusableItem, getFocusedChild, getPreparedLabel, getPreparedTitle, hasChildSubmenu, hideBody, initialize, manageSystemActions, processKeyEvent, processMnemonicEvent, repaint, setInitialFocus, setVisible, showBody
add, add, add, addDirectly, belongsTo, checkWidget, clipping, clipRectangle, currentFocus, currentFocus, cycleFocus, destroy, detach, endSizeChange, findMouseSource, firstFocus, focus, get, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getWidgetsList, hasFocusable, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, prevFocus, remove, replace, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setSize, setWidth, startSizeChange, unrealize, updateSizeWorker, widgets
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, 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, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, 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, requestSync, resetBitmap, resizeTo, resolveFont, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getParentMenu, getParentMenuContainer, getParentSubMenu
addFocusListener, addKeyListener, 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, minimumSize, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, requestFocus, requestSync, resizeTo, screen, screenLocation, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, show, supportsCustomMousePointer, topLevelWindow, unrealize, window
private 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>
protected void menuDropEvents()
menuDropEvents
in class SubMenu<ChuiOutputManager>
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()