public class ButtonListGuiImpl.Items extends BorderedPanelGuiImpl implements ScrollableWidget<GuiOutputManager>
| Modifier and Type | Field and Description |
|---|---|
private ButtonListGroupItemConfig[] |
configs
The array of item's configurations
|
private int |
heightInPixels
The height of this widget given in pixel units
|
private int |
itemHeightInPixels
The height of an item calculated in pixels
|
private int |
itemIndexOffset
The index of the first visible item in the view
|
private int |
numberOfAllItems
The number of all items
|
private int |
numberOfVisibleItems
The number of items in the viewport
|
private int |
widthInPixels
The width of this widget given in pixel units
|
borderlisteners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
Items(WidgetId id,
ButtonListGroupItemConfig[] configs)
Creates the widget that represents the group button.
|
| Modifier and Type | Method and Description |
|---|---|
Dimension |
calculateVisibleDimension()
Calculates the visible size of this widget in character units.
|
boolean |
canBeScrolledDown()
Tests if the items can be scrolled an item down.
|
boolean |
canBeScrolledUp()
Tests if the items can be scrolled an item up.
|
Dimension |
dimension()
Calculates the size of this widget in character units.
|
Widget<GuiOutputManager> |
findMouseSource(NativePoint p)
Find the item under the mouse pointer.
|
int |
getItemHeight()
Gets an item's height in pixels.
|
int |
getItemWidth()
Gets an item's width in pixels.
|
NativeDimension |
getScrollDimension()
Calculates the scroll size of this widget given in pixel units.
|
NativeDimension |
getScrollStep()
Returns the minimum scroll step.
|
NativeDimension |
getVisibleDimension()
Returns the visible size of this widget in pixel units.
|
double |
height()
Returns the height of this widget.
|
int |
indexOf(ButtonListGuiImpl.Item item)
Get the item's index assigned by this item's container.
|
boolean |
isScrollPopupSupported()
Tests if this widget supports a scroll popup.
|
Dimension |
minimumSize()
Returns the minimum size of this widget.
|
void |
onHide()
Setup its initial location.
|
private void |
onResize()
Update the number of visible items and reset the index of the first visible item
in the view on resize, and reset its relative location.
|
void |
onShow()
Shows this widget and recalculates its native dimension.
|
void |
scroll(java.lang.Integer newXPosition,
java.lang.Integer newYPosition)
Scrolls the widget's content according to the given physical translation.
|
void |
updateFont(int font)
Updates the current item font.
|
void |
updateItems(ButtonListGroupItemConfig[] configs)
Updates items list.
|
double |
width()
Returns the width of this widget.
|
draw, drawPanel, getId, is3DBorder, isRMBEntrySupported, set3DBorder, setColorResolver, setCustomDraw, setId, setOptionalDrawborder, insets, isTransparent, setBorder, setTransparentadd, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, currentFocus, cycleFocus, defaultFocus, deregisterSelectedWidget, destroy, detach, doLayout, dumpCurrentWidgets, dumpWidgets, endSizeChange, firstFocus, focus, focusTraversable, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, hasFocusable, lastFocus, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, prevFocus, processKeyEvent, reflectAncestorChange, reflectLocationChanged, registerSelectedWidget, remove, removeContainerStateListener, repaint, 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, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, config, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, 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, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, 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, prepParentLocation, 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, setVisible, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unregisterWidgetListener, updateSystemParent, widgetRealized, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, completeTrigger, config, defaultMousePtr, destroy, displayPhysicalLocation, draw, drawCaret, enclosingFrame, enforceDefaultMousePtr, focusTraversable, forceCursorOnFocus, 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, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, moveToBottom, moveToTop, name, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, startTrigger, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unrealize, unregisterWidgetListener, validateDisplayValue, widgetStateChanged, windowmouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleasedwidgetsAsListprivate int widthInPixels
private int heightInPixels
private ButtonListGroupItemConfig[] configs
private int numberOfVisibleItems
private int numberOfAllItems
private int itemIndexOffset
private int itemHeightInPixels
public Items(WidgetId id, ButtonListGroupItemConfig[] configs)
id - The given widget's id.configs - The array of item's configurationspublic void updateItems(ButtonListGroupItemConfig[] configs)
configs - The array of item's configurationspublic int indexOf(ButtonListGuiImpl.Item item)
item - The target itempublic void onShow()
private void onResize()
public void updateFont(int font)
font - The new fontpublic void onHide()
public NativeDimension getScrollDimension()
getScrollDimension in interface ScrollableWidget<GuiOutputManager>public NativeDimension getVisibleDimension()
getVisibleDimension in interface ScrollableWidget<GuiOutputManager>public NativeDimension getScrollStep()
getScrollStep in interface ScrollableWidget<GuiOutputManager>public boolean canBeScrolledUp()
public boolean canBeScrolledDown()
public int getItemHeight()
public int getItemWidth()
public void scroll(java.lang.Integer newXPosition,
java.lang.Integer newYPosition)
scroll in interface ScrollableWidget<GuiOutputManager>newXPosition - The given translation along a horizontal in pixel unitsnewYPosition - The given translation along a vertical in pixel unitspublic boolean isScrollPopupSupported()
isScrollPopupSupported in interface ScrollableWidget<GuiOutputManager>public Dimension dimension()
dimension in interface Widget<GuiOutputManager>dimension in class AbstractContainer<GuiOutputManager>public Dimension calculateVisibleDimension()
public double height()
height in interface Widget<GuiOutputManager>height in class AbstractContainer<GuiOutputManager>public Dimension minimumSize()
minimumSize in interface Widget<GuiOutputManager>minimumSize in class AbstractContainer<GuiOutputManager>public double width()
width in interface Widget<GuiOutputManager>width in class AbstractContainer<GuiOutputManager>public Widget<GuiOutputManager> findMouseSource(NativePoint p)
findMouseSource in interface Widget<GuiOutputManager>findMouseSource in class AbstractContainer<GuiOutputManager>p - The mouse coordinates relative to its parent container