public abstract class DriverWidgetHost<C extends BaseConfig> extends AbstractContainer<GuiOutputManager> implements WidgetWithConfig<C>
| Modifier and Type | Field and Description |
|---|---|
private C |
config
Associated config instance
|
private boolean |
destroyed
Flag indicating the widget has been destroyed, so consume any other posted events.
|
private GuiColorResolver |
gc
Color resolver
|
protected GuiDriver |
gd
Screen driver
|
private GuiFontResolver |
gf
Font resolver
|
private WidgetId |
id
Widget id
|
private NativeRectangle |
lastViewport
Bounds of the last calculated viewport
|
private boolean |
lastVisible |
private boolean |
placeWidget
Flag indicating the widget needs to be placed (as its location has changed).
|
private boolean |
sensitivityChanged
Flag indicating the widget's sensitivity has changed.
|
private boolean |
updateLocationScheduled
Indicates location update is scheduled
|
private WindowSizeMoveListener |
windowSizeMoveListener
Window size-move listener
|
listeners, location, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
DriverWidgetHost(WidgetId id,
C cfg)
Construtor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterConfigUpdate(C beforeUpdate)
The method is called after the configuration associated with the
owner changes.
|
private NativeRectangle |
calcViewport()
Calculates the widget's visible area on the window screen.
|
C |
config()
Get externalizable widget config which can be used to restore widget
state after via network.
|
Widget<GuiOutputManager> |
currentFocus()
Gets the widget currently having focus within curent container.
|
void |
destroy()
Destroy this widget.
|
void |
draw()
Draw the widget.
|
boolean |
focusTraversable()
Checks if the current container support focus traversing.
|
WidgetId |
getId()
Widget ID.
|
double |
height()
Get widget height.
|
void |
initialize(WidgetId id,
C 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.
|
boolean |
isTotallyObscured()
Check if widget is totally obscured.
|
protected int[] |
mouseActions()
Determine the mouse actions processed by this widget.
|
void |
processKeyEvent(KeyInput event)
Process key event.
|
void |
reflectAncestorChange()
Called when any of the widget's ancestors gets re-assigned.
|
void |
reflectLocationChanged()
Called when the widget's location changes.
|
private void |
scheduleUpdateLocationState()
Schedules update of location and visibility state with the GUI driver.
|
void |
triggerEvent(byte eventId,
byte[] paramsData)
Called by the driver to notify about a triggered high-level widget specific event.
|
private void |
updateLocationState()
Updates location and visibility state with the GUI driver.
|
void |
webMessageHandler(java.lang.String url,
java.lang.String data)
The method is called when a message is sent by the JS side of the driver widget.
|
void |
widgetContentLoaded(java.lang.String url)
Called when the driver widget has fully loaded at the JS side.
|
void |
widgetStateChanged()
Notification that this widget's state has changed (visibility, sensitivity, z-order).
|
double |
width()
Get widget width.
|
add, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, cycleFocus, defaultFocus, deregisterSelectedWidget, detach, dimension, doLayout, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, hasFocusable, insets, lastFocus, minimumSize, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, prevFocus, 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_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, 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, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isVisible, isVisible, location, manageSystemActions, 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, waitwidgetsAsListacceptsEscAsAnyKey, acceptTrigger, addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, completeTrigger, defaultMousePtr, displayPhysicalLocation, drawCaret, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getIdForTrigger, getLegacyWidget, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hasTooltip, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, isCurrent, isCurrent, isDirectManipulable, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDisplayed, isDroppable, isEnabled, isFocusable, isHeader, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isVisible, isVisible, location, maySwitchFocus, 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, 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, unregisterWidgetListener, validateDisplayValue, windowprivate WidgetId id
private C extends BaseConfig config
protected GuiDriver gd
private GuiFontResolver gf
private GuiColorResolver gc
private boolean placeWidget
private boolean sensitivityChanged
private boolean destroyed
private WindowSizeMoveListener windowSizeMoveListener
private NativeRectangle lastViewport
private boolean lastVisible
private boolean updateLocationScheduled
public void initialize(WidgetId id, C cfg)
This API is called after the widget is created and added to the registry.
initialize in interface WidgetWithConfig<C extends BaseConfig>id - The widget's ID.cfg - Config instance.public WidgetId getId()
getId in interface Widget<GuiOutputManager>getId in class AbstractWidget<GuiOutputManager>public C config()
Note that only very limited set of widgets actually have config. By default widget has no config.
config in interface Widget<GuiOutputManager>config in interface ConfigOwner<C extends BaseConfig>config in class AbstractWidget<GuiOutputManager>public void afterConfigUpdate(C beforeUpdate)
The implemented logic must be idempotent - the method must produce the same results if executed once or multiple times not relying on any particular call sequence or related state. This is necessary so that the method can be repeated or retried as often as necessary without causing unintended effects
afterConfigUpdate in interface ConfigOwner<C extends BaseConfig>beforeUpdate - Config reference capturing the iconfig state before the owner's config was modified.public double width()
width in interface Widget<GuiOutputManager>width in class AbstractContainer<GuiOutputManager>public double height()
height in interface Widget<GuiOutputManager>height in class AbstractContainer<GuiOutputManager>public void reflectLocationChanged()
reflectLocationChanged in class AbstractContainer<GuiOutputManager>public void reflectAncestorChange()
reflectAncestorChange in class AbstractContainer<GuiOutputManager>public void widgetStateChanged()
widgetStateChanged in interface Widget<GuiOutputManager>widgetStateChanged in class AbstractContainer<GuiOutputManager>public boolean isTotallyObscured()
isTotallyObscured in interface Widget<GuiOutputManager>isTotallyObscured in class AbstractWidget<GuiOutputManager>true if widget is totally obscured.public void destroy()
destroy in interface Widget<GuiOutputManager>destroy in class AbstractContainer<GuiOutputManager>public void processKeyEvent(KeyInput event)
processKeyEvent in interface Widget<GuiOutputManager>processKeyEvent in class AbstractContainer<GuiOutputManager>event - Key event to process.public void draw()
draw in interface Widget<GuiOutputManager>draw in class AbstractContainer<GuiOutputManager>public void triggerEvent(byte eventId,
byte[] paramsData)
eventId - Event id.paramsData - Parameters data.public void webMessageHandler(java.lang.String url,
java.lang.String data)
url - The message URL. Specific to the concrete driver widget.data - The message data. Specific to the concrete driver widget.public void widgetContentLoaded(java.lang.String url)
url - The URL of the content of the driver widget.protected int[] mouseActions()
mouseActions in class AbstractWidget<GuiOutputManager>public Widget<GuiOutputManager> currentFocus()
currentFocus in interface Container<GuiOutputManager>currentFocus in class AbstractContainer<GuiOutputManager>public boolean focusTraversable()
focusTraversable in interface Widget<GuiOutputManager>focusTraversable in class AbstractContainer<GuiOutputManager>true if focus traversable in this container.private NativeRectangle calcViewport()
null.private void scheduleUpdateLocationState()
private void updateLocationState()