public class MessageAreaImpl extends AbstractWidget<ChuiOutputManager> implements MessageArea<ChuiOutputManager>, WidgetWithConfig<BaseConfig>
For ChUI clients, it always holds 2 message lines.
Widget.ZOrderClass
Modifier and Type | Field and Description |
---|---|
protected BaseConfig |
config
Widget configuration
|
private int |
lines
The number of lines in this message area.
|
protected java.util.List<StatusLine<ChuiOutputManager>> |
messageLines
Two lines which render message text.
|
insets, location, LOG, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
MessageAreaImpl(WidgetId id,
int lines)
Initialize this message-area.
|
Modifier and Type | Method and Description |
---|---|
void |
afterConfigUpdate(BaseConfig beforeUpdate)
The method is called after the configuration associated with
the implementor changes.
|
void |
attach(Window<ChuiOutputManager> window)
Attach this widget to the specified window.
|
void |
clearMessagesNoPause()
Clear the message content and make sure that the message area displays the cleared
space without pausing.
|
BaseConfig |
config()
Get the widget config.
|
Dimension |
dimension()
This is a no-op, and it must not be called for ChUI clients.
|
void |
draw()
This is a no-op, and it must not be called for ChUI clients.
|
boolean |
focusTraversable()
This component will not receive focus when Tab or Shift-Tab is pressed.
|
void |
forceVisibility(boolean visibility)
Force widget visibility change without associated repainting.
|
Color[] |
getMessageColors()
Get all the message colors in this message-area.
|
java.lang.String[] |
getMessageTexts()
Get all the message texts in this message-area.
|
double |
height()
This is a no-op, and it must not be called for ChUI clients.
|
void |
initialize(WidgetId id,
BaseConfig 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.
|
Dimension |
minimumSize()
This is a no-op, and it must not be called for ChUI clients.
|
void |
setMessageText(java.lang.String[] message,
Color[] cs)
Shows the new message text.
|
void |
setMessageText(java.lang.String[] msg,
Color[] cs,
boolean force)
Set message main worker routine.
|
double |
width()
This is a no-op, and it must not be called for ChUI clients.
|
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, createMouseHoverAction, deactivateDirectManipulation, debug, destroy, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, findMouseSource, forceCursorOnFocus, 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, insets, isDirectManipulationCapable, isDirectManipulationRequired, isDisplayed, isEnabled, isFocusable, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, manageSystemActions, mouseActions, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, repaint, requestFocus, 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, unrealize, updateSizeWorker, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
defaultMousePtr, enforceDefaultMousePtr, getLegacyWidget, isDirectManipulable
protected java.util.List<StatusLine<ChuiOutputManager>> messageLines
private int lines
protected BaseConfig config
public MessageAreaImpl(WidgetId id, int lines)
id
- The widget's ID.lines
- Number of lines in message area.public void initialize(WidgetId id, BaseConfig cfg)
This API is called after the widget is created and added to the registry.
initialize
in interface WidgetWithConfig<BaseConfig>
id
- The widget's ID.cfg
- The config used to initialize this widget.public BaseConfig config()
config
in interface Widget<ChuiOutputManager>
config
in interface ConfigOwner<BaseConfig>
config
in class AbstractWidget<ChuiOutputManager>
public void afterConfigUpdate(BaseConfig beforeUpdate)
afterConfigUpdate
in interface ConfigOwner<BaseConfig>
beforeUpdate
- public void attach(Window<ChuiOutputManager> window)
attach
in interface MessageArea<ChuiOutputManager>
window
- The parent window.public java.lang.String[] getMessageTexts()
getMessageTexts
in interface MessageArea<ChuiOutputManager>
public Color[] getMessageColors()
getMessageColors
in interface MessageArea<ChuiOutputManager>
public void forceVisibility(boolean visibility)
forceVisibility
in interface MessageArea<ChuiOutputManager>
forceVisibility
in interface Widget<ChuiOutputManager>
forceVisibility
in class AbstractWidget<ChuiOutputManager>
visibility
- New visibility state.public void clearMessagesNoPause()
In ChUI we must overdraw the message content with spaces.
clearMessagesNoPause
in interface MessageArea<ChuiOutputManager>
public void setMessageText(java.lang.String[] message, Color[] cs)
setMessageText
in interface MessageArea<ChuiOutputManager>
message
- Array of two text message which need to be displayed inside the
message area.cs
- Array of two color specifications.public void setMessageText(java.lang.String[] msg, Color[] cs, boolean force)
setMessageText
in interface MessageArea<ChuiOutputManager>
msg
- Message text array.cs
- Message color array.force
- true
means force redisplaying of messages even
if message text is already null
.public void draw()
draw
in interface Widget<ChuiOutputManager>
draw
in class AbstractWidget<ChuiOutputManager>
public Dimension dimension()
dimension
in interface Widget<ChuiOutputManager>
dimension
in class AbstractWidget<ChuiOutputManager>
public double width()
width
in interface Widget<ChuiOutputManager>
width
in class AbstractWidget<ChuiOutputManager>
public double height()
height
in interface Widget<ChuiOutputManager>
height
in class AbstractWidget<ChuiOutputManager>
public Dimension minimumSize()
minimumSize
in interface Widget<ChuiOutputManager>
minimumSize
in class AbstractWidget<ChuiOutputManager>
public boolean focusTraversable()
focusTraversable
in interface Widget<ChuiOutputManager>
focusTraversable
in class AbstractWidget<ChuiOutputManager>
false