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 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, 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 |
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, displayPhysicalLocation, drawCaret, enable, enclosingFrame, findMouseSource, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCachedScreenLocation, getCachedScreenPhysicalLocation, getCustomMousePointer, getDefaultEvent, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getPortableMouseEventCoordinates, getSelectedText, getState, getTextHeight, getTextHeightNative, getTextWidth, getTextWidth, getTextWidthNative, getTextWidthNative, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, ignoreAction, insets, isCurrent, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRepaintDisabled, isRMBEntrySupported, isScreenLocationCached, isTabStop, isThreeD, isTotallyObscured, isVisible, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentObject, parentOrSelf, parentOrSelfObject, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, reflectAncestorChange, reflectLocationChange, refresh, registerWidgetStateListener, repaint, repaint, requestFocus, 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, unrealize, updateSizeWorker, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
defaultMousePtr, enforceDefaultMousePtr, getLegacyWidget, isDirectManipulable, isDroppable, maySwitchFocus, requestFocus
private GuiDriver gd
private GuiFontResolver gf
private java.lang.String text
private LabelConfig config
private boolean opaque
public SimpleLabel(java.lang.String text)
text
- The text to be displayed.public Dimension dimension()
dimension
in interface Widget
dimension
in class AbstractWidget
public void setSize(Dimension dim)
dim
- The new dimension of the label.public void draw()
draw
in interface Widget
draw
in class AbstractWidget
public double height()
height
in interface Widget
height
in class AbstractWidget
public Dimension minimumSize()
minimumSize
in interface Widget
minimumSize
in class AbstractWidget
public double width()
width
in interface Widget
width
in class AbstractWidget
public 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 Widget
focusTraversable
in class AbstractWidget
false
.public WidgetConfig config()
config
in interface Widget
config
in interface ConfigOwner
config
in class AbstractWidget
public void afterConfigUpdate(WidgetConfig beforeUpdate)
afterConfigUpdate
in interface ConfigOwner
beforeUpdate
- Config reference capturing the config state before the owner's config was modified.