public class TextDisplay extends TextPad implements ImageRefresher
Modifier and Type | Class and Description |
---|---|
class |
TextDisplay.HotSpotEvent |
Modifier and Type | Field and Description |
---|---|
Color |
hotColor
The color for hot spots.
|
static int |
LINES_SPLIT
This is a type of Control event.
|
protected TextFormatter |
mouseOver |
allowOverwrite, amScrolling, backgroundImage, charWidth, curState, disableCursor, disableTextChanges, dls, dontWantPopup, extraLineSpacing, fitExactNumLines, forcedActualWidth, format, inputState, leftMargin, lineHeight, lines, minXScroll, minYScroll, moreMessage, noCursorMovement, numLines, rightMargin, selectAllOnFocus, spacing, STATE_AUTOTAB, STATE_OVERWRITE, wantReturn, wantTab, wrapToScreenSize
actAsLabel, blinkId, CASE_LOWER, CASE_NORMAL, CASE_NUMBERS, CASE_SENTENCE, CASE_UPPER, colors, conditionalChar, conditionalCharIndex, defaultInputFlags, doingLocalInput, doingNativeInput, FLAG_INPUT_ON_FOCUS, FLAG_KEEP_FOCUS_AFTER_INPUT, FLAG_NEED_FULL_ACTION, FLAG_PASSIVE, FLAG_USE_NATIVE, inFocus, inputFlags, inputMethod, justGotFocus, nothingEnteredText, oldText, pageColor, startNativeOnPaint, textCase, validator
backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, curFont, debugModify, debugRepaintNow, disabledBackground, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, fontChange, fontFrom, foreGround, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, lockPaint, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, name, next, parent, penStatus, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, startDragResolution, tags, tail, text, toolTip, width, x, y
clipItems, clipObject, clipOwner, debugControl, debugFlag, doubleBuffer, doubleClickTime, doubleSizedFontHeight, firstPress, globalEditable, globalEnabled, PEN_STATUS_DID_HOLD_DOWN, PEN_STATUS_GOT_PEN_DOWN, PEN_STATUS_PEN_IS_ON, TAG_BOOLEAN_KEEP_BELOW_SIP, TAG_HOVER_TIME_INT, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed
KEEP_VISIBLE
GoHigher, GoLower, Horizontal, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_ABUT_ANY, BF_ABUT_BOTTOM, BF_ABUT_LEFT, BF_ABUT_RIGHT, BF_ABUT_TOP, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
ALWAYS_STRETCHABLE, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_HIDDEN, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BUSY_DISPLAY, TAG_COLORS, TAG_CONTROL_PAINTER, TAG_EXPOSE_GROUP, TAG_FIXEDSIZE, TAG_GRAY_BACKGROUND, TAG_HIDE_CONTROL_OBJECT, TAG_HIDE_PARENT, TAG_INNER_TEXT_INSETS, TAG_INPUT_STACK_PARENT, TAG_INSETS, TAG_MAKE_VISIBLE, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PAINT_CONTROL_LIST, TAG_PREFERRED_TEXT_SIZE, TAG_PREFERRED_TEXT_SIZE_HEIGHT, TAG_PREFERRED_TEXT_SIZE_WIDTH, TAG_PREFERREDSIZE, TAG_RECT, TAG_SHADOW_INSETS, TAG_SPAN, TAG_SWIPER, TAG_TEMPORARY_ERROR, TAG_TEXT_INSETS, TAG_TEXTSIZE, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, ContainerDontPaintChildren, Disabled, DisablePopupMenu, DisplayOnly, DontBuffer, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, ModifiersInheritedFromWindow, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpUIEvents, ShowSIP, ShrinkToNothing, SmallControl, TakeChildUIEvents, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
Constructor and Description |
---|
TextDisplay() |
TextDisplay(int rows,
int columns) |
Modifier and Type | Method and Description |
---|---|
TextFormatter |
addTextFormatter(int lineIndex,
int numLines,
int fontFlags,
int lineFlags) |
TextFormatter |
addTextFormatter(int lineIndex,
int characterIndex,
int length,
int fontFlags,
int lineFlags) |
TextFormatter |
addTextFormatter(int lineIndex,
int characterIndex,
int length,
TextFormatter dest) |
TextFormatter |
addTextFormatter(int indexInFullText,
int length,
TextFormatter dest) |
TextFormatter |
addTextFormatter(TextFormatter formatter) |
protected void |
applySpecialFormat(int formatIndex,
int lineIndex,
DisplayLine theLine,
FormattedTextSpecs format) |
void |
clearHistory()
Clear the goBack history.
|
void |
clearTextFormatters() |
void |
deleteLastHistory() |
void |
displayPropertiesChanged()
Call this to indicate that something about the display has changed.
|
protected void |
drawSpecialFormat(int formatIndex,
int lineIndex,
DisplayLine theLine,
FormattedTextSpecs format,
Graphics g,
Color background) |
void |
formattersSet()
This tells the TextDisplay that formatters have been set and so it can optimize
itself based on this.
|
void |
formClosing()
This is called to indicate that the Form is about to close and it causes a FormClosed event to be posted.
|
protected void |
getColors(boolean hasFocus,
int flags)
Provides the colors to be used for the text and background colors.
|
static TextDisplay |
getDisplay(String display,
int lineWidth) |
protected FontMetrics |
getFontMetricsForSizeCalculations() |
protected int |
getSpecialFormatCount(int lineIndex,
DisplayLine theLine) |
TextFormatter |
getTextFormatter(Point onControl) |
Vector |
getTextFormatter(Point onControl,
Vector dest) |
Iterator |
getTextFormatters() |
Object |
getToolTip(int x,
int y)
This should return an acceptable ToolTip object.
|
void |
goBack()
This goes back one place in the saved states for the HtmlDisplay.
|
boolean |
goToAnchor(String anchorName)
This tells the display to go to the specified anchor.
|
boolean |
goToLine(int line)
Scroll to the specified line.
|
protected boolean |
hotspotPressed(HotSpot hs,
Point where) |
void |
imageSet(TextFormatter formatter) |
void |
markHistory()
Mark the current location in the goBack history.
|
protected void |
mouseMovedOnOff(TextFormatter tf,
boolean movedOn) |
void |
onPenEvent(PenEvent ev) |
void |
penPressed(Point where)
Called when the Pen or Mouse button is pressed on the control.
|
void |
refresh(IImage image,
int options)
The default version of this method simpy repaints the control - however for controls
which may display multiple images a better refresh scheme would be needed.
|
void |
repaintDataNow()
Repaint the "data" part of the Control now.
|
TextDisplay |
setTextAndPreferredTextWidth(String text,
int textWidth) |
protected void |
splitLines(int width) |
void |
stopAniImages() |
acceptsData, addDisplayLine, addDisplayLines, appendText, autoTab, breakLineBefore, calculateSizes, canGo, checkScrolls, checkSipCoverage, clearCursor, clearSelection, countLines, countSplitLines, dataAccepted, dataDraggedOff, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deleteSelection, displayLinesChanged, doPaint, doPaintData, doPaintData, doScroll, doShowMenu, dragged, ensureBlankLines, fix, fixText, getActual, getAvailableWidth, getBaselineHeight, getBestScrollingControl, getCharAt, getCharAt, getCharRect, getCurrent, getCursorPosition, getCursorRect, getFontMetricsForSplitting, getHeightForLines, getIndexLocation, getLeftPosition, getLine, getLine, getLineAt, getLineAt, getLineHeight, getLineLength, getLines, getNumLines, getPenChar, getScreenRows, getScrollablePanel, getSelection, getSelectionRange, getState, getText, getTextPadMenu, getTextPositions, getTextPositions, getTextWidth, getTopLine, getTrueCharIndex, getTrueCharIndex, getVisible, gotFocus, hasSelection, lostFocus, needScrollBar, newCursorPos, newCursorPos, noSelection, onEvent, onKeyEvent, paintConditionalChar, paintCursor, paintCursor, paintLastChar, paintLastChar, paintLine, paintLine, paintLine, paintLines, paintLinesFrom, penDoubleClicked, penReleased, popupMenuClosed, popupMenuEvent, pushDisplayLine, rearrange, removeDisplayLine, removeSelection, replaceDisplayLines, replaceLines, replaceSelection, resizeTo, resplit, scrollTo, selectAll, setAsStaticDisplay, setNativeInputFlags, setSelectionRange, setSelectionRange, setState, setText, splitLines, splitLines, splitLines, splitLines, startDragging, ticked, update, update, updateScrolls
calculateInputFlags, checkInputMethod, dataBeingRemoved, fixCase, getBestPassiveFlags, getNativeInputParameters, hasChanged, inActivePassiveInput, isLabel, keepConditionalChar, nativeInputStopped, onControlEvent, setAsLabel, setConditionalChar, showHoldDownIndicator, startActiveInput, startLocalInput, startNativeInput, takeData, updateData, verifyWantDrag, verifyWantHoldDown
activate, addListener, amOnTopFrame, applyFontChange, baseOnPenEvent, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, bufferGraphics, cache, calculatedSizes, calculateTextSize, calculateTextSize, calculateTextSize, cancelHoldDown, cancelPenPress, canEdit, change, changeDimension, changeTag, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkParentInterceptsUIEvent, checkPenTransparent, childrenPainted, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createNewMenu, dataDraggedOver, deactivate, defaultTo, deferInWindowThread, doAction, doActionKey, doBackground, doBorder, doHotKey, doMenu, dontAcceptDrop, doPaintChildren, doPaintData, draw, draw, draw, exitEntry, fillBackground, fillBackgroundNotInFrame, findTagInParents, fontChanged, free, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getAncestor, getAncestor, getAncestorProperty, getBackground, getCached, getCachedChildren, getCachedDim, getCachedDim, getCachedRect, getCachedRect, getCachedSubControls, getChildAnchor, getChildren, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getContentsInsets, getContentsInsets, getContentsRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFieldTransfer, getFont, getFontMetrics, getFontMetrics, getForeground, getFrame, getFrameOrContainer, getGraphics, getGraphics, getHeight, getHideParent, getImage, getLastSelected, getLocation, getLock, getMaximumSize, getMenu, getMinimumSize, getModifiedBorderFlags, getModifiers, getNext, getNextKeyFocus, getPaintParameters, getParent, getParent, getParent, getParentOrListener, getPasswordCharacter, getPosInFrame, getPosInFrame, getPosInParent, getPosInParent, getPreferredSize, getPreferredSizeByParent, getPreferredTextSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getSubControls, getTag, getWidth, getWindow, getWindowGraphics, hasModifier, hasPopupFormAttached, hasTag, hide, inheritModifiers, insetToContents, interceptChildUIEvent, isChildOf, isDirectChildOfWindow, isHidden, isModal, isOnMe, isOnMe, isOnMe, isSomeonesHotKey, make, makeFrameTopMost, makeHot, makeHot, makeInvisible, makeVisible, markAsTemporaryError, menuIsActive, menuStateChanged, modify, modifyAll, modifyAll, modifyFlags, mouseHover, newEventThread, notifyAction, notifyDataChange, notifyDataChange, notifyMenuItemSelected, notifyStructureChanged, onLabelPenEvent, paintBackground, paintWithControlPainter, pauseEventThread, penClicked, penHeld, penRightReleased, popupBeep, popupMenuEvent, postEvent, postInWindowThread, postUIEvent, putInside, queueKeyEvent, queuePenEvent, readLock, recalculatePreferredSize, redisplay, releaseBufferedGraphics, removed, removeListener, repaint, repaint, repaintInWindowThread, repaintInWindowThread, repaintNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetAllCachedProperties, resetCachedProperties, resetRect, restore, restoreBorderModifiers, restoreFlags, resumeEventThread, scrollAndRepaint, sendToListeners, set, setAllFonts, setBackgroundImage, setBorder, setBorderModifiers, setCell, setChildAnchor, setClipObject, setControl, setCursor, setFieldTransfer, setFixedSize, setFont, setFontChange, setFreeDragging, setHidden, setHiddenParent, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPreferredTextSize, setPreferredTextSize, setPromptControl, setRect, setRect, setScaledBackgroundImage, setServer, setShadow, setSwiping, setTag, setTags, setTextSize, setTiledBackgroundImage, setToolTip, shown, simulateClickOn, simulateKeyPresses, simulateKeyType, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, stopDragging, takeFocus, takeFromClipboard, takePromptControl, testInWindowThread, tipIsDisplayed, toClipboard, toField, toField, toIDString, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryGetGraphics, tryNext, tryStartMenu, unhide, unlock, updateDCDuringDD, updateFrom, updateTo, waitEventThread, willAcceptDrop, willShowFrame, windowHasFloatingControls, writeLock
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getServer, setServer
public Color hotColor
protected TextFormatter mouseOver
public static final int LINES_SPLIT
public TextDisplay()
public TextDisplay(int rows, int columns)
public void repaintDataNow()
Control
repaintDataNow
in class Control
protected int getSpecialFormatCount(int lineIndex, DisplayLine theLine)
getSpecialFormatCount
in class TextPad
protected FontMetrics getFontMetricsForSizeCalculations()
getFontMetricsForSizeCalculations
in class Control
public TextFormatter getTextFormatter(Point onControl)
protected void applySpecialFormat(int formatIndex, int lineIndex, DisplayLine theLine, FormattedTextSpecs format)
applySpecialFormat
in class TextPad
protected void drawSpecialFormat(int formatIndex, int lineIndex, DisplayLine theLine, FormattedTextSpecs format, Graphics g, Color background)
drawSpecialFormat
in class TextPad
public void refresh(IImage image, int options)
Control
refresh
in interface ImageRefresher
refresh
in class Control
image
- the image to refresh.options
- refresh options.public void stopAniImages()
public void formClosing()
Control
formClosing
in class Control
public void imageSet(TextFormatter formatter)
public TextFormatter addTextFormatter(TextFormatter formatter)
public TextFormatter addTextFormatter(int lineIndex, int characterIndex, int length, TextFormatter dest)
public TextFormatter addTextFormatter(int lineIndex, int characterIndex, int length, int fontFlags, int lineFlags)
public TextFormatter addTextFormatter(int lineIndex, int numLines, int fontFlags, int lineFlags)
public void clearTextFormatters()
public Iterator getTextFormatters()
public TextFormatter addTextFormatter(int indexInFullText, int length, TextFormatter dest)
protected void splitLines(int width)
splitLines
in class TextPad
public void formattersSet()
protected void getColors(boolean hasFocus, int flags)
EditControl
getColors
in class EditControl
hasFocus
- True if the control currently has the focus.flags
- This is the result of a call to getFlags(true) - which provides an OR'ing of all the flags
of this control and all its parents.protected void mouseMovedOnOff(TextFormatter tf, boolean movedOn)
public void onPenEvent(PenEvent ev)
onPenEvent
in class TextPad
public boolean goToAnchor(String anchorName)
anchorName
- The name of the anchor.public boolean goToLine(int line)
line
- The line to go to.public void clearHistory()
public void markHistory()
public void deleteLastHistory()
public void goBack()
public void penPressed(Point where)
Control
Within this method you can use the Control.Gui.currentPenPress() value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.
penPressed
in class TextPad
where
- The point on the Control where the pen was pressed.public Object getToolTip(int x, int y)
Control
getToolTip
in class Control
x
- The x location of the mouse in this control.y
- The y location of the mouse in this control.public void displayPropertiesChanged()
public static TextDisplay getDisplay(String display, int lineWidth)
public TextDisplay setTextAndPreferredTextWidth(String text, int textWidth)