public abstract class Label<O extends OutputManager<?>> extends FixedSizeContainer<O> implements WidgetWithConfig<LabelConfig>
Widget.ZOrderClass
Modifier and Type | Field and Description |
---|---|
protected LabelConfig |
config
Component attribute container.
|
private boolean |
delimiter
Flag the special case of use as a separator line.
|
protected boolean |
disableEmptyMode
Prepare for disabling empty mode.
|
protected boolean |
emptyMode
If it is
true , empty string is displayed. |
private boolean |
forcedSize
Widget's size which is set by
setSize method. |
protected double |
offset
Label right shift offset.
|
protected boolean |
rightAligned
Make label aligned to right boundary.
|
protected Widget<O> |
sideWidget
The side-widget associated with this label, if this is a side-label.
|
protected boolean |
underlined
Display additional line
|
location, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
Label(WidgetId id,
Label<O> label)
Create a copy of the label.
|
Label(WidgetId id,
Label<O> label,
int frameId)
Create a copy of the label.
|
Label(WidgetId id,
java.lang.String text,
int frameId)
Constructs label with given text.
|
Modifier and Type | Method and Description |
---|---|
void |
_setVisible(boolean visible)
Update the
AbstractWidget.visible flag in the configuration and in the widget's state. |
void |
afterConfigUpdate(LabelConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
LabelConfig |
config()
Provide access to the attributes stored in the widget.
|
abstract void |
draw()
Draws text.
|
void |
drawCaret()
Sets position of terminal's cursor.
|
boolean |
focusTraversable()
This component will not receive an input focus when Tab or Shift-Tab is
pressed.
|
Widget<O> |
getLegacyWidget()
The method returns the legacy widget representing this widget.
|
Widget<O> |
getSideWidget()
Get the side-widget associated with this label.
|
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.
|
boolean |
isDelimiter()
Gets the flag that marks this label as one used to draw a separator
line for header widgets.
|
boolean |
isDirectManipulable()
Check the direct manipulation capability of the widget.
|
boolean |
isFocusable()
Checks whether this attribute container can receive focus generally.
|
boolean |
isForcedSize()
Get the state of the
forcedSize flag. |
boolean |
isRightAligned()
Get current value of the alignment.
|
boolean |
isUnderlined()
Get current value of the underlining flag.
|
void |
linkTo(int frameId,
int serverSideId)
Process this label so that it's linked with the server-side widget represented by the
serverSideId . |
java.lang.String |
name()
Get widget name.
|
protected abstract int |
nativeHeight()
Retrieve the widget's height in native units.
|
protected abstract int |
nativeWidth()
Retrieve the widget's width in native units.
|
void |
postprocessConfig()
Additional processing required when widget configuration is updated AFTER the frame layout
has been performed.
|
protected void |
postprocessConfig(LabeledWidget<O> widget)
Additional processing required when widget configuration is updated AFTER the frame layout
has been performed.
|
void |
setDelimiter(boolean delimiter)
Marks this label as one used to draw a separator line for header
widgets.
|
void |
setEmptyModeOff()
Disable empty label mode.
|
void |
setEmptyModeOn()
Enable empty mode.
|
void |
setForcedSize(boolean forcedSize)
Set the
forcedSize flag to the specified state. |
void |
setHeight(double height)
Set widget height.
|
void |
setName(java.lang.String name)
Sets the name of the label.
|
void |
setOffset(double offset)
Set extra offset for label.
|
void |
setRightAligned(boolean rightAligned)
Activate or deactivate right alignment of the text.
|
void |
setSideWidget(Widget<O> widget)
Set the specified widget as this side-label's
sideWidget . |
void |
setSize(double width,
double height)
Sets new widget's size.
|
void |
setUnderlined(boolean b)
Set underlining mode.
|
void |
setWidth(double width)
Set widget width.
|
protected void |
updateSize()
Synchronizes the actual size with the default size.
|
minimumSize, requestFocus
add, add, add, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, currentFocus, currentFocus, cycleFocus, defaultFocus, destroy, detach, dimension, doLayout, endSizeChange, findMouseSource, firstFocus, focus, focusWorker, get, getClipRect, getEffectiveScrollableSize, getFocusInt, getIgnoreFocus, getLayout, getScrollableSize, getWidgetsList, hasFocusable, height, insets, lastFocus, moveAfterTabItem, moveBeforeTabItem, moveToBottom, moveToBottomInClass, moveToTop, moveToTopInClass, moveToZpos, nextFocus, normalizeZOrder, prepareWidgets, prevFocus, processKeyEvent, remove, repaint, replace, setFocus, setFocusInt, setIgnoreFocus, setInsets, setLayout, setSize, startSizeChange, unrealize, updateSizeWorker, widgets, width
_setHidden, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, enable, enclosingFrame, 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, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, prepParentLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, 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, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, defaultMousePtr, displayPhysicalLocation, enclosingFrame, enforceDefaultMousePtr, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getEffectiveMousePointer, getId, getLoadedMousePointer, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, isDisplayed, isEnabled, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, moveToBottom, moveToTop, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, requestSync, resizeTo, screen, screenLocation, screenPhysicalLocation, setEnabled, setHidden, setHighlighted, setLocation, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, supportsCustomMousePointer, topLevelWindow, window
private boolean forcedSize
setSize
method.protected LabelConfig config
protected boolean rightAligned
protected boolean underlined
private boolean delimiter
protected double offset
protected boolean emptyMode
true
, empty string is displayed.protected boolean disableEmptyMode
protected Widget<O extends OutputManager<?>> sideWidget
public Label(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.public Label(WidgetId id, Label<O> label, int frameId)
id
- The widget's ID.label
- 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.protected abstract int nativeWidth()
protected abstract int nativeHeight()
public void setSideWidget(Widget<O> widget)
sideWidget
.widget
- The side-widget for this label.public Widget<O> getSideWidget()
sideWidget
.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>
id
- The widget's ID.cfg
- The config used to initialize this widget.public LabelConfig config()
config
in interface Widget<O extends OutputManager<?>>
config
in interface ConfigOwner<LabelConfig>
config
in class AbstractWidget<O extends OutputManager<?>>
public void setDelimiter(boolean delimiter)
delimiter
- true
to set this as a separator line.public boolean isDelimiter()
true
if this label is a separator line.public abstract void draw()
draw
in interface Widget<O extends OutputManager<?>>
draw
in class AbstractContainer<O extends OutputManager<?>>
public void drawCaret()
drawCaret
in interface Widget<O extends OutputManager<?>>
drawCaret
in class AbstractWidget<O extends OutputManager<?>>
public void setSize(double width, double height)
setSize
in interface Container<O extends OutputManager<?>>
setSize
in class AbstractContainer<O extends OutputManager<?>>
width
- New widget width.height
- New widget height.public void setWidth(double width)
setWidth
in interface Container<O extends OutputManager<?>>
setWidth
in class AbstractContainer<O extends OutputManager<?>>
width
- New widget width.public void setHeight(double height)
setHeight
in interface Container<O extends OutputManager<?>>
setHeight
in class AbstractContainer<O extends OutputManager<?>>
height
- New widget height.public boolean focusTraversable()
focusTraversable
in interface Widget<O extends OutputManager<?>>
focusTraversable
in class AbstractContainer<O extends OutputManager<?>>
false
.public boolean isFocusable()
isFocusable
in interface Widget<O extends OutputManager<?>>
isFocusable
in class AbstractWidget<O extends OutputManager<?>>
true
if this container can be focused under
certain conditions. false
if, and only if, this
attribute container can never receive focus.protected void updateSize()
public void setUnderlined(boolean b)
b
- New value for the mode.public boolean isUnderlined()
true
if label is underlined.public boolean isRightAligned()
true
if right alignment is active.public void setRightAligned(boolean rightAligned)
rightAligned
- true
activate right alignment,
false
- deactivate.public void setName(java.lang.String name)
name
- New name of the component.public java.lang.String name()
name
in interface Widget<O extends OutputManager<?>>
name
in class AbstractWidget<O extends OutputManager<?>>
public void setOffset(double offset)
offset
- Size of the shift.public void setEmptyModeOff()
draw()
call.public void setEmptyModeOn()
public void linkTo(int frameId, int serverSideId)
serverSideId
.frameId
- The ID of the frame to which this label belongs.serverSideId
- The server-side ID of this label.public void _setVisible(boolean visible)
AbstractWidget.visible
flag in the configuration and in the widget's state.
If the widget has just been realized and its width has not yet been set, it will be computed now.
_setVisible
in class AbstractWidget<O extends OutputManager<?>>
visible
- The widget's visible state.public boolean isForcedSize()
forcedSize
flag.public void setForcedSize(boolean forcedSize)
forcedSize
flag to the specified state.forcedSize
- The new state for the forcedSize
flag.public void afterConfigUpdate(LabelConfig beforeUpdate)
afterConfigUpdate
in interface ConfigOwner<LabelConfig>
beforeUpdate
- public void postprocessConfig()
postprocessConfig
in interface Widget<O extends OutputManager<?>>
postprocessConfig
in class AbstractWidget<O extends OutputManager<?>>
public Widget<O> getLegacyWidget()
getLegacyWidget
in interface Widget<O extends OutputManager<?>>
null
if none found.protected void postprocessConfig(LabeledWidget<O> widget)
widget
- The widget to which this side-labe is attached.public boolean isDirectManipulable()
isDirectManipulable
in interface Widget<O extends OutputManager<?>>
TRUE
if the widget is able to be directly manipulated,
FALSE
otherwise.