public class MessageAreaGuiImpl extends ScrollPaneGuiImpl implements MessageArea<GuiOutputManager>
ScrollPaneGuiImpl.ShowBars
Widget.ZOrderClass
Modifier and Type | Field and Description |
---|---|
private GuiDriver |
gd
Screen driver
|
private GuiFontResolver |
gf
Font resolver
|
private int |
lines
Message area lines
|
private ScrollableListGuiImpl |
list
Messages
|
private static int |
MAX_LINES
Maximum number of lines in message area
|
private int |
maxTextWidth
Message text maximum width in pixels
|
private Dimension |
textDimChars
Message text width and height in character units
|
private WindowGuiImpl |
window
Ancestor
|
both, gc
config, rootPanel
location, mousePtr, nativeInsets, physicalLocation
Constructor and Description |
---|
MessageAreaGuiImpl(WidgetId id,
int rows)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private int |
addItem(java.lang.String message)
Add new item to message list.
|
void |
addMessage(java.lang.String message)
Add a new message text to message area.
|
void |
attach(Window<GuiOutputManager> window)
Attach widget to window.
|
double |
calculateMessageAreaHeight()
Calculates the height of the Message Area in the characters units.
|
void |
clearMessages()
Clear all messages.
|
void |
clearMessagesNoPause()
Clear the message content and make sure that the message area displays the cleared
space without pausing.
|
void |
doLayout()
Lay out container.
|
void |
draw()
Widget drawing method.
|
boolean |
focusTraversable()
This component will not receive focus when Tab or Shift-Tab is pressed.
|
Color[] |
getMessageColors()
Get all the message colors in this message-area.
|
int |
getMessageLines()
Returns the number of screen lines available for message display.
|
java.lang.String[] |
getMessageTexts()
Get all the message texts in this message-area.
|
private int |
getTextWidth(java.lang.String text)
Get text width.
|
protected int[] |
mouseActions()
Determine the mouse actions processed by this widget.
|
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.
|
private int |
split(java.lang.String text)
Split message.
|
adjustScrollLayout, adjustScrollLayoutImpl, barSizeNative, calcInitialViewportSize, draw, enforceDefaultMousePtr, getEffectiveMousePointer, getLoadedMousePointer, getScrollBar, handleScrollEvent, mouseClicked, mouseMoved, mouseReleased, setEnabled, setHorizBarQuirk, setScrollBarController, setScrollBars, setShowBars, supportsCustomMousePointer, topLevelWindow
afterConfigUpdate, calcHscroll, calcVscroll, config, getBorder, getChild, getRootPanel, initialize, isFocusable, minimumSize, setBorder, setLocation, setSize, viewport
add, add, add, addDirectly, belongsTo, checkWidget, childrenLocation, clipping, clipRectangle, currentFocus, currentFocus, cycleFocus, defaultFocus, destroy, detach, dimension, 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, requestFocus, setFocus, setFocusInt, setHeight, setIgnoreFocus, setInsets, setLayout, setSize, setWidth, startSizeChange, unrealize, updateSizeWorker, widgets, width
_setHidden, _setVisible, activateDirectManipulation, addFocusListener, addKeyListener, afterConfigUpdateBase, ancestor, ancestorId, autoResize, bounds, clear, clearWidget, clipRectangle, clipRectangle, clipWith, createMouseHoverAction, deactivateDirectManipulation, debug, disable, displayPhysicalLocation, drawCaret, enable, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getAndResetBitmap, getAndSetBitmap, getBitmapCopy, getCustomMousePointer, getDefaultEvent, getId, 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, mouseDragged, mouseEntered, mouseExited, mousePressed, mouseWheelMoved, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, prepParentLocation, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, processMnemonicImpl, processSystemKey, raiseLegacyMouseEvents, refresh, registerWidgetStateListener, repaint, requestSync, resetBitmap, resizeTo, resolveFont, resolveTitleFont, screen, screenDimension, screenHeight, screenLocation, screenPhysicalLocation, screenWidth, setBitmap, setHidden, setHighlighted, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, sync, toString, translate, window
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forceVisibility
addFocusListener, addKeyListener, ancestor, ancestorId, bounds, clearWidget, defaultMousePtr, displayPhysicalLocation, drawCaret, enclosingFrame, forceCursorOnFocus, forceVisibility, getActualBounds, getCustomMousePointer, getId, getLegacyWidget, getMenuMouse, getMouseActions, getSelectedText, getState, getVisiblePart, getZOrderClass, hasFocus, hidden, hide, highlighted, isDirectManipulable, isDisplayed, isEnabled, isHeader, isRealized, isRMBEntrySupported, isTabStop, isThreeD, isTotallyObscured, isVisible, location, moveToBottom, moveToTop, name, navigable, parent, parent, parentOrSelf, physicalBounds, physicalDimension, physicalLocation, postprocessConfig, processDirectManipulationEvent, processEvent, processFocusEvent, processKeyListeners, processMnemonic, raiseLegacyMouseEvents, repaint, requestSync, resizeTo, screen, screenLocation, screenPhysicalLocation, setHidden, setHighlighted, setLocation, setMousePointer, setParent, setPhysicalLocation, setState, setVisible, show, window
private static final int MAX_LINES
private WindowGuiImpl window
private GuiDriver gd
private GuiFontResolver gf
private ScrollableListGuiImpl list
private int maxTextWidth
private Dimension textDimChars
private int lines
public MessageAreaGuiImpl(WidgetId id, int rows)
rows
- Number of visible rows.public void draw()
draw
in interface Widget<GuiOutputManager>
draw
in class ScrollPaneGuiImpl
public void attach(Window<GuiOutputManager> window)
attach
in interface MessageArea<GuiOutputManager>
window
- parent window.public void addMessage(java.lang.String message)
message
- Message text.private int addItem(java.lang.String message)
message
- New message.public void clearMessages()
HIDE MESSAGE
public int getMessageLines()
This method corresponds to the Progress built-in function:
MESSAGE-LINES
public void doLayout()
doLayout
in interface Container<GuiOutputManager>
doLayout
in class ScrollPane<GuiOutputManager>
public double calculateMessageAreaHeight()
public java.lang.String[] getMessageTexts()
getMessageTexts
in interface MessageArea<GuiOutputManager>
public void setMessageText(java.lang.String[] msg, Color[] cs, boolean force)
setMessageText
in interface MessageArea<GuiOutputManager>
msg
- Message text array.cs
- Message color array.force
- true
means force redisplaying of messages even
if message text is already null
.public Color[] getMessageColors()
getMessageColors
in interface MessageArea<GuiOutputManager>
public void setMessageText(java.lang.String[] message, Color[] cs)
setMessageText
in interface MessageArea<GuiOutputManager>
message
- Array of two text message which need to be displayed inside the
message area.cs
- Array of two color specifications.public void clearMessagesNoPause()
In GUI, clearing the messages and repainting should be enough since this will not trigger any pausing.
clearMessagesNoPause
in interface MessageArea<GuiOutputManager>
public boolean focusTraversable()
focusTraversable
in interface Widget<GuiOutputManager>
focusTraversable
in class AbstractContainer<GuiOutputManager>
false
protected int[] mouseActions()
mouseActions
in class ScrollPaneGuiImpl
private int split(java.lang.String text)
text
- Text to split.private int getTextWidth(java.lang.String text)
text
- String text.