|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectewe.ui.ControlBase
ewe.ui.Control
ewe.ui.EditControl
ewe.ui.Console
A Console is a non-editable text display. It is optimized for fast display and so:
By default the Console will set its font to the font returned by mApp.findFont("fixed") and there is a convenience method to change the size of the font: setFontSize()
The wrapLength variable controls the wrap length of the Console. It should be 0 for no wrapping, -1 for wrapping to the screen size or a positive value for an explicit maximum line width.
| Field Summary | |
protected static ImageBuffer |
blockBuffer
|
protected static char[] |
emptyLine
|
protected static ImageBuffer |
itemBuffer
|
boolean |
localEcho
If this is true then keys pressed are echoed (displayed) on the console. |
int |
maxLines
This is the maximum number of lines to store in the Console. |
boolean |
showCursor
This is true by default. |
int |
spacing
|
int |
wrapLength
This specifies the number of characters allowed per line, or a value of -1 indicates that incoming data should wrap to the screen size, or a value of 0 indicates no line wrapping. |
| Fields inherited from class ewe.ui.EditControl |
blinkId, CASE_LOWER, CASE_NORMAL, CASE_NUMBERS, CASE_SENTENCE, CASE_UPPER, colors, conditionalChar, conditionalCharIndex, doingLocalInput, doingNativeInput, FLAG_INPUT_ON_FOCUS, FLAG_KEEP_FOCUS_AFTER_INPUT, FLAG_PASSIVE, FLAG_USE_NATIVE, inFocus, inputFlags, inputMethod, justGotFocus, oldText, pageColor, startNativeOnPaint, textCase, validator |
| Fields inherited from class ewe.ui.Control |
_debug, backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, DoPaintMethod, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, foreGround, haveNativePaint, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, MyClass, name, next, np, parent, penStatus, popupSound, popupSoundClip, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, standardBorder, standardEdge, startDragResolution, tags, tail, text, toolTip, width, x, y |
| Fields inherited from class ewe.ui.ControlBase |
clipItems, clipObject, clipOwner, curPoint, currentPenEvent, debugControl, debugFlag, DidHoldDown, doubleBuffer, doubleClickTime, firstPress, globalDrawFlat, globalEditable, globalEnabled, globalPalmStyle, globalSmallControls, GotPenDown, PenIsOn, pressPoint, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed, useNativeTextInput |
| Fields inherited from interface ewe.ui.IScroll |
Higher, Horizontal, Lower, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical |
| Fields inherited from interface ewe.ui.UIConstants |
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, 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 |
| Fields inherited from interface ewe.ui.CellConstants |
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST |
| Fields inherited from interface ewe.ui.ControlConstants |
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown |
| Fields inherited from interface ewe.fx.ImageRefresher |
KEEP_VISIBLE |
| Constructor Summary | |
Console()
|
|
| Method Summary | |
void |
append(char[] data,
int start,
int length,
boolean updateDisplay)
|
void |
append(char data,
boolean updateDisplay)
Append a single character to the console. |
void |
append(String data,
boolean updateDisplay)
|
boolean |
canGo(int orientation,
int direction,
int position)
|
boolean |
checkSipCoverage()
|
void |
clear(boolean updateDisplay)
Clear the console text. |
void |
closeIO()
If there are open Writers and Readers for this Console, this call will close them. |
IOHandle[] |
connectTo(Reader reader,
Writer writer)
Connect this console to a Reader and a Writer. |
IOHandle[] |
connectTo(Stream s)
Connect this console to a bi-directional Stream. |
static void |
debug(String data)
Send a line of data to the special debugging/standard IO console. |
boolean |
deleteSelection()
|
void |
doPaint(Graphics g,
Rect area)
|
protected void |
doPaintData(Graphics g)
Repaint the "data" part of the Control. |
void |
doPaintData(Graphics g,
Rect area)
|
void |
doScroll(int which,
int action,
int value)
|
int |
getActual(int direction)
|
static Console |
getAppConsole()
Get a special console used for debugging or standard input/output. |
int |
getCurrent(int direction)
|
char[] |
getLine(int line)
|
int |
getLineLength()
|
int |
getNumLines()
|
Reader |
getReader()
Get a Reader that you can use to read from the console. |
int |
getScreenCols(boolean fullyDisplayed)
Get the number of characters that can be partially or fully displayed on a line. |
int |
getScreenRows(boolean fullyDisplayed)
Get the number of lines that can be partially or fully displayed. |
Object |
getSelection()
|
String |
getText()
|
int |
getVisible(int direction,
int forSize)
|
Writer |
getWriter()
Get a Writer that you can use to write to the console. |
void |
gotFocus(int how)
|
boolean |
hasSelection()
|
protected void |
keyPressed(KeyEvent ev)
This gets called when a valid key is pressed. |
protected char |
keyToChar(KeyEvent key)
This converts a key press to a Unicode character for sending or displaying. |
void |
lostFocus(int how)
|
boolean |
needScrollBar(int direction,
int forSize)
|
boolean |
noSelection()
|
void |
onKeyEvent(KeyEvent ev)
|
protected boolean |
paintConditionalChar(Graphics g,
boolean b)
|
void |
paintLine(Graphics gr,
int line)
|
void |
popupMenuEvent(Object selectedItem)
This is called when the user selects an item from the popup menu. |
void |
refresh()
This will reposition the display to the end of the text and then do a full display refresh. |
boolean |
replaceSelection(Object with)
|
void |
selectAll()
|
void |
sendChar(char key)
This gets called when a key was pressed by the default sendKey() method. |
void |
sendChars(char[] keys,
int offset,
int length)
This gets called by the default sendChar() method and can also be called directly. |
protected void |
sendKey(KeyEvent key)
This gets called when a key was pressed by the default keyPressed() method. |
Control |
setFont(Font f)
Call this to set the Font for the Console, which should be a fixed-width font. |
void |
setFontSize(int size)
Change the size of the font. |
void |
setText(String text)
|
protected void |
updateDisplay()
This does not shift the position to the end of the text, use refresh() that instead. |
void |
updateDisplay(int changedLines)
|
protected boolean |
wantKey(KeyEvent ev)
This is used to decide if you wish to process a key press. |
| Methods inherited from class ewe.ui.EditControl |
acceptsData, checkInputMethod, dataBeingRemoved, dataTransferCancelled, fixCase, getBestPassiveFlags, getColors, hasChanged, keepConditionalChar, onControlEvent, setConditionalChar, setNativeInputFlags, startActiveInput, startLocalInput, startNativeInput, takeData, update, updateData |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode |
| Methods inherited from interface ewe.ui.ScrollClient |
getServer, setServer |
| Field Detail |
public int spacing
public int maxLines
public boolean showCursor
public int wrapLength
protected static ImageBuffer itemBuffer
protected static ImageBuffer blockBuffer
protected static char[] emptyLine
public boolean localEcho
| Constructor Detail |
public Console()
| Method Detail |
public Control setFont(Font f)
setFont in class Controlf - The new Font.
public void setFontSize(int size)
size - The new size of the font.public void gotFocus(int how)
gotFocus in class Controlpublic void lostFocus(int how)
lostFocus in class Controlpublic void selectAll()
selectAll in class EditControlpublic boolean hasSelection()
hasSelection in interface Selectablepublic boolean noSelection()
noSelection in interface Selectablepublic boolean deleteSelection()
deleteSelection in interface Selectablepublic boolean replaceSelection(Object with)
replaceSelection in interface Selectablepublic Object getSelection()
getSelection in interface Selectablepublic void popupMenuEvent(Object selectedItem)
Control
popupMenuEvent in class ControlselectedItem - The item selected.public int getScreenRows(boolean fullyDisplayed)
fullyDisplayed - if this is true then only the number of fully displayed lines are returned.
public int getScreenCols(boolean fullyDisplayed)
fullyDisplayed - if this is true then only the number of fully displayed characters are returned.
public char[] getLine(int line)
protected void updateDisplay()
public void updateDisplay(int changedLines)
public void clear(boolean updateDisplay)
updateDisplay - if this is true a repaint will be done.public String getText()
getText in class Controlpublic void refresh()
public void append(char data,
boolean updateDisplay)
data - The character to append.updateDisplay - true to update the display after.
public void append(char[] data,
int start,
int length,
boolean updateDisplay)
public void append(String data,
boolean updateDisplay)
public void paintLine(Graphics gr,
int line)
public void doPaint(Graphics g,
Rect area)
doPaint in class Control
public void doPaintData(Graphics g,
Rect area)
public void setText(String text)
setText in class Controlprotected void doPaintData(Graphics g)
Control
doPaintData in class Controlg - The Graphics object to paint to.
public void doScroll(int which,
int action,
int value)
doScroll in interface ScrollClientpublic int getLineLength()
public int getNumLines()
public int getActual(int direction)
getActual in interface ScrollClientpublic int getCurrent(int direction)
getCurrent in interface ScrollClient
public int getVisible(int direction,
int forSize)
getVisible in interface ScrollClient
public boolean needScrollBar(int direction,
int forSize)
needScrollBar in interface ScrollClient
public boolean canGo(int orientation,
int direction,
int position)
canGo in interface ScrollClientpublic Writer getWriter()
public Reader getReader()
public void closeIO()
public IOHandle[] connectTo(Reader reader,
Writer writer)
reader - the reader to read characters from to output on the console. If this
is null then no reading is done.writer - the writer to send characters typed on the console to. If this is null
then no writing is done.
public IOHandle[] connectTo(Stream s)
s - the stream to read from and write to.
public void sendChars(char[] keys,
int offset,
int length)
keys - a set of characters.offset - the start of the characters to send.length - the number of characters to send.public void sendChar(char key)
key - The pressed key.protected char keyToChar(KeyEvent key)
key - The pressed key.
protected void sendKey(KeyEvent key)
key - The pressed key event.protected void keyPressed(KeyEvent ev)
ev - The detected key event.protected boolean wantKey(KeyEvent ev)
ev - The key event.
public void onKeyEvent(KeyEvent ev)
onKeyEvent in class Controlpublic static Console getAppConsole()
protected boolean paintConditionalChar(Graphics g,
boolean b)
paintConditionalChar in class EditControlpublic static void debug(String data)
public boolean checkSipCoverage()
checkSipCoverage in class EditControl
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||