public class LabelGuiImpl extends ClientDrivenLabel<GuiOutputManager>
Modifier and Type | Field and Description |
---|---|
private GuiDriver |
gd
Screen driver
|
private GuiFontResolver |
gf
Font resolver
|
config, disableEmptyMode, emptyMode, offset, rightAligned, sideWidget, underlined
location, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
LabelGuiImpl(WidgetId id,
ClientDrivenLabel<GuiOutputManager> labelInstance,
int frameId)
Create a copy of the label.
|
LabelGuiImpl(WidgetId id,
java.lang.String text,
int frameId)
Constructs label with given text.
|
Modifier and Type | Method and Description |
---|---|
void |
afterConfigUpdate(LabelConfig beforeUpdate)
The method is called after the configuration associated with the implementor changes.
|
void |
draw()
Draws text.
|
double |
height()
Compute the label's height.
|
void |
initialize(WidgetId id,
LabelConfig 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 |
nativeHeight()
Retrieve the widget's height in native units.
|
protected int |
nativeWidth()
Retrieve the widget's width in native units.
|
NativeDimension |
physicalDimension()
Get widget physical dimension, expressed in units native to UI type.
|
double |
width()
Compute the label's width.
|
_setVisible, config, drawCaret, focusTraversable, getLegacyWidget, getSideWidget, isDelimiter, isDirectManipulable, isFocusable, isForcedSize, isRightAligned, isUnderlined, linkTo, name, postprocessConfig, postprocessConfig, setDelimiter, setEmptyModeOff, setEmptyModeOn, setForcedSize, setHeight, setName, setOffset, setRightAligned, setSideWidget, setSize, setUnderlined, setWidth, updateSize
minimumSize, requestFocus, requestFocus
add, add, add, addContainerStateListener, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, copyState, currentFocus, currentFocus, cycleFocus, defaultFocus, deregisterSelectedWidget, destroy, detach, dimension, doLayout, dumpCurrentWidgets, dumpWidgets, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, formatDump, get, getAllSelectedWidgets, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getTabItemList, hasFocusable, insets, lastFocus, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, onWidgetAdded, onWidgetRemoved, paintOnTop, parentOf, prepareWidgets, prevFocus, processKeyEvent, reflectAncestorChange, reflectLocationChange, registerSelectedWidget, remove, removeContainerStateListener, repaint, replace, requestFocus, setFocus, setFocusInt, setIgnoreFocus, setInsets, setLayout, setSize, setTabItemList, startSizeChange, triggerContainerStateRedrawEnabled, unrealize, updateSizeWorker, widgets, widgetsAsList, widgetStateChanged
_setHidden, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, createMouseHoverAction, deactivateDirectManipulation, debug, disable, disableTooltip, displayPhysicalLocation, enable, enableTooltip, enclosingFrame, forceCursorOnFocus, 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, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, isCurrent, isDirectManipulationActive, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, navigable, oleDoDrop, oleDrag, oleDragging, oleStartDragging, onOleDragging, onOleDropEnd, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalLocation, prepParentLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, unregisterWidgetStateListener, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, canMovetoTop, clearWidget, defaultMousePtr, destroy, dimension, displayPhysicalLocation, enclosingFrame, enforceDefaultMousePtr, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getMousePosition, getSelectedText, getState, getTriggerWidget, getTriggerWidget, getVisiblePart, getZOrderClass, hasFocus, hasFocus, hidden, hide, highlighted, ignoreEnable, initialHeight, initialWidth, insets, isCurrent, isDirectManipulationActive, isDisplayed, isDroppable, isEnabled, isHeader, isInitialValueLayout, isLegacyFocus, isRealized, isRepaintDisabled, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, maySwitchFocus, minimumSize, moveToBottom, moveToTop, navigable, oleDrag, parent, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalLocation, preventFocusWhenMouseDownEventDefined, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, refreshWidget, registerWidgetStateListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestSync, resizeTo, resolvePopupMenuId, screen, screenLocation, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, supportsCustomMousePointer, systemFocusGrabbed, topLevelWindow, unrealize, unregisterWidgetStateListener, validateDisplayValue, widgetStateChanged, window
mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased
widgetsAsList
private GuiFontResolver gf
private GuiDriver gd
public LabelGuiImpl(WidgetId id, ClientDrivenLabel<GuiOutputManager> labelInstance, int frameId)
id
- The widget's ID.labelInstance
- Label to copy parameters from.frameId
- The ID of the frame to which the label belongs, or -1 if unknown at the time of the
creation.public LabelGuiImpl(WidgetId id, java.lang.String text, int frameId)
id
- The widget's ID.text
- Initial text.frameId
- The ID of the frame to which the label belongs, or -1 if unknown at the time of the
creation.protected int nativeWidth()
FrameGuiImpl.getLabelWidth(java.lang.String, com.goldencode.p2j.ui.client.LabeledWidget<com.goldencode.p2j.ui.client.gui.driver.GuiOutputManager>)
, fix this.nativeWidth
in class ClientDrivenLabel<GuiOutputManager>
protected int nativeHeight()
FrameGuiImpl.getLabelHeight(java.lang.String, com.goldencode.p2j.ui.client.LabeledWidget<com.goldencode.p2j.ui.client.gui.driver.GuiOutputManager>, boolean)
, fix this.nativeHeight
in class ClientDrivenLabel<GuiOutputManager>
public void initialize(WidgetId id, LabelConfig cfg)
This API is called after the widget is created and added to the registry.
initialize
in interface WidgetWithConfig<LabelConfig>
initialize
in class ClientDrivenLabel<GuiOutputManager>
id
- The widget's ID.cfg
- The config used to initialize this widget.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 draw()
draw
in interface Widget<GuiOutputManager>
draw
in class ClientDrivenLabel<GuiOutputManager>
public NativeDimension physicalDimension()
physicalDimension
in interface Widget<GuiOutputManager>
physicalDimension
in class AbstractWidget<GuiOutputManager>
public void afterConfigUpdate(LabelConfig beforeUpdate)
For a side-label (is set
, if its X or COLUMN coordinate is set before it gets
realized, it must adjust for the COLON-ALIGNED mode.
afterConfigUpdate
in interface ConfigOwner<LabelConfig>
afterConfigUpdate
in class ClientDrivenLabel<GuiOutputManager>
beforeUpdate
- Config reference capturing the config state before the owner's config was modified.