public class SimpleLabel extends AbstractWidget implements ConfigOwner
javax.swing.JLabel does. It is not
linked to any other widget.| Modifier and Type | Field and Description |
|---|---|
private boolean |
centerAligned
If
true then the label is center-aligned. |
private LabelConfig |
config
The configuration.
|
private GuiDriver |
gd
Screen driver
|
private GuiFontResolver |
gf
Font resolver
|
private boolean |
opaque
Opacity flag.
|
private java.lang.String |
text
The text to be displayed on the label
|
insets, listeners, location, LOG, mousePtr, nativeInsets, physicalLocation| Constructor and Description |
|---|
SimpleLabel(java.lang.String text)
Simple constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterConfigUpdate(WidgetConfig beforeUpdate)
The method is called after the configuration associated with the owner changes.
|
WidgetConfig |
config()
Returns config instance associated with this instance.
|
Dimension |
dimension()
Get widget dimension.
|
void |
draw()
Draw widget.
|
boolean |
focusTraversable()
This component will not receive an input focus when Tab or Shift-Tab is pressed.
|
java.lang.String |
getText()
Obtain the text this label displays.
|
double |
height()
Get widget height.
|
Dimension |
minimumSize()
Get widget minimum size.
|
void |
setCenterAligned()
Center-align the label.
|
void |
setOpaque()
Mark the label as being opaque.
|
void |
setSize(Dimension dim)
Sets a fixed size for the label.
|
void |
setText(java.lang.String text)
Configures the text to be displayed on the label.
|
double |
width()
Get widget width.
|
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, copyColors, copyState, createMouseHoverAction, deactivateDirectManipulation, debug, destroy, disable, disableTooltip, displayPhysicalLocation, drawCaret, enable, enableTooltip, enclosingFrame, findMouseSource, 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, hasTooltip, hidden, hide, highlighted, ignoreAction, initialHeight, initialWidth, insets, isCurrent, isDirectManipulationActive, isDirectManipulationActiveOrInUIB, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isMouseDrag, isRealized, isRepaintDisabled, isRMBEntrySupported, 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, processKeyEvent, processKeyEventForSelectableWidget, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectAncestorChange, reflectLocationChanged, reflectSizeChanged, refresh, registerWidgetListener, repaint, repaint, repaint, requestFocus, requestSync, resetBitmap, resizeTo, resolveFont, resolvePopupMenuId, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setCachedScreenLocation, setCachedScreenPhysicalLocation, setDirectManipulationActive, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setMousePointer, setParent, setPhysicalDimensionInt, setPhysicalLocation, setSensitiveForUIB, setState, setVisible, setWindow, show, showPopupMenu, supportsCustomMousePointer, sync, topLevelWindow, toString, translate, triggerLocationChanged, unrealize, unregisterWidgetListener, updateSizeWorker, updateSystemParent, widgetRealized, widgetStateChanged, windowclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitacceptsEscAsAnyKey, acceptTrigger, canMovetoTop, completeTrigger, defaultMousePtr, enforceDefaultMousePtr, getIdForTrigger, getLegacyWidget, getTriggerWidget, getTriggerWidget, hasFocus, ignoreEnable, isCurrent, isDirectManipulable, isDroppable, isInitialValueLayout, isLegacyFocus, isProcessProgressEvent, maySwitchFocus, parent, refreshWidget, requestFocus, requestFocus, startTrigger, systemFocusGrabbed, validateDisplayValueprivate GuiDriver gd
private GuiFontResolver gf
private java.lang.String text
private LabelConfig config
private boolean opaque
private boolean centerAligned
true then the label is center-aligned.public SimpleLabel(java.lang.String text)
text - The text to be displayed.public Dimension dimension()
dimension in interface Widgetdimension in class AbstractWidgetpublic void setSize(Dimension dim)
dim - The new dimension of the label.public void draw()
draw in interface Widgetdraw in class AbstractWidgetpublic double height()
height in interface Widgetheight in class AbstractWidgetpublic Dimension minimumSize()
minimumSize in interface WidgetminimumSize in class AbstractWidgetpublic double width()
width in interface Widgetwidth in class AbstractWidgetpublic java.lang.String getText()
public void setOpaque()
public void setText(java.lang.String text)
text - The new text to be displayed.public boolean focusTraversable()
focusTraversable in interface WidgetfocusTraversable in class AbstractWidgetfalse.public WidgetConfig config()
config in interface Widgetconfig in interface ConfigOwnerconfig in class AbstractWidgetpublic void afterConfigUpdate(WidgetConfig beforeUpdate)
afterConfigUpdate in interface ConfigOwnerbeforeUpdate - Config reference capturing the config state before the owner's config was modified.public void setCenterAligned()