public class ScrollableListGuiImpl extends DefaultList<java.lang.String,GuiOutputManager> implements WidgetWithConfig<BaseConfig>
Widget.ZOrderClass
Modifier and Type | Field and Description |
---|---|
private boolean |
allowDeselect
Flag indicating if the list elements can be unselected.
|
private BaseConfig |
config
Widget configuration
|
private GuiColorResolver |
gc
Color resolver
|
private GuiDriver |
gd
Screen driver
|
private GuiFontResolver |
gf
Font resolver
|
private boolean |
inheritHeight
Inherit parent height
|
private boolean |
inheritWidth
Inherit parent width
|
private int |
rowHeight
Row height
|
insets, location, LOG, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
ScrollableListGuiImpl(WidgetId id,
ListModel<java.lang.String> model,
boolean allowDeselect)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
addItem(java.lang.String item)
Add new item to list.
|
void |
afterConfigUpdate(BaseConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
BaseConfig |
config()
Get the widget config.
|
void |
deleteItems()
Delete all items.
|
void |
draw()
Draw widget.
|
private GuiFontResolver.FontCache |
font()
Resolve font.
|
double |
height()
Get widget height.
|
void |
initialize(WidgetId id,
BaseConfig cfg)
Replacement API for the logic which should exist in the widget's c'tor, but the logic
can't be executed as it depends on the widget being registered into the official registry.
|
protected int[] |
mouseActions()
Determine the mouse actions processed by this widget.
|
void |
mouseClicked(java.awt.event.MouseEvent e)
Notification of a mouse clicked event occurred for this widget.
|
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Notification of a mouse wheel moved event occurred for this widget.
|
void |
processKeyEvent(KeyInput event)
Process key event.
|
void |
setInheritHeight(boolean inheritHeight)
Set if width is inherited from parent widget.
|
void |
setInheritWidth(boolean inheritWidth)
Set if width is inherited from parent widget.
|
double |
width()
Get widget width.
|
addScrollListener, addSelectionListener, allowDeselect, calculateScrollYPosition, clear, currentRow, deselect, dimension, ensureRowVisible, ensureRowVisible, first, getColumns, getScrollDimension, getScrollStep, getVisibleDimension, index, isScrollPopupSupported, minimumSize, model, postScrollEvent, processKey, redraw, scroll, select, select, selected, selection, selectionMode, selectItem, setColumns, setSelectionMode, setVisibleRows, shiftCurrentRow, value, visibleRows
_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, focusTraversable, forceCursorOnFocus, 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, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, 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
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, defaultMousePtr, destroy, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, findMouseSource, focusTraversable, forceCursorOnFocus, 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 GuiDriver gd
private BaseConfig config
private GuiColorResolver gc
private GuiFontResolver gf
private int rowHeight
private final boolean allowDeselect
private boolean inheritWidth
private boolean inheritHeight
public void initialize(WidgetId id, BaseConfig cfg)
This API is called after the widget is created and added to the registry.
initialize
in interface WidgetWithConfig<BaseConfig>
id
- The widget's ID.cfg
- The config used to initialize this widget.public BaseConfig config()
config
in interface Widget<GuiOutputManager>
config
in interface ConfigOwner<BaseConfig>
config
in class AbstractWidget<GuiOutputManager>
public void afterConfigUpdate(BaseConfig beforeUpdate)
afterConfigUpdate
in interface ConfigOwner<BaseConfig>
beforeUpdate
- Config reference capturing the config state before the owner's config was modified.public void setInheritWidth(boolean inheritWidth)
inheritWidth
- true
if width is inherited from parent.public void setInheritHeight(boolean inheritHeight)
inheritHeight
- true
if height is inherited from parent.public double width()
width
in interface Widget<GuiOutputManager>
width
in class DefaultList<java.lang.String,GuiOutputManager>
public double height()
height
in interface Widget<GuiOutputManager>
height
in class DefaultList<java.lang.String,GuiOutputManager>
public void draw()
draw
in interface Widget<GuiOutputManager>
draw
in class AbstractWidget<GuiOutputManager>
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
mouseWheelMoved
in class AbstractWidget<GuiOutputManager>
e
- The mouse event.public void processKeyEvent(KeyInput event)
processKeyEvent
in interface Widget<GuiOutputManager>
processKeyEvent
in class DefaultList<java.lang.String,GuiOutputManager>
event
- Key event to process.public int addItem(java.lang.String item)
item
- Item to add.public void deleteItems()
protected int[] mouseActions()
mouseActions
in class AbstractWidget<GuiOutputManager>
private GuiFontResolver.FontCache font()