public class MatrixTextDisplay extends MatrixDisplay implements Runnable
MatrixDisplay
with the additional feature
of organising a multi text-line structure and the character display
via DisplayPattern
.Paintable
Modifier and Type | Field and Description |
---|---|
int |
charDist
Character spacing in matrix dots.
|
protected int |
columWidth |
int |
lineDist
Line spacing in matrix dots.
|
protected int |
lineHeight |
int |
nOcols
Number of 5*8 (character) columns.
|
int |
nOlines
Number of 5*8 (character) lines.
|
allXdots, allYdots, background, dots, foreground, marginGround, matDisDim, onRound, SCR_R_X, SCR_R_Y
Modifier | Constructor and Description |
---|---|
protected |
MatrixTextDisplay(int nOlines,
int nOcols,
int charDist,
int lineDist,
MatrixDisplayDim size)
Constructor by all measures / sizes.
|
Modifier and Type | Method and Description |
---|---|
void |
clearLine(int line)
Clear a line.
|
static MatrixTextDisplay |
make(int nOlines,
int nOcols,
int charDist,
int lineDist,
MatrixDisplayDim size)
Making by supplied measures.
|
void |
putC(char c,
int line,
int colmn)
Set one character.
|
void |
putCR(char c,
int line)
Shift in one character from the right.
|
void |
putStringL(String text,
int maxLen,
int line)
Left aligned setting in of a character sequence.
|
void |
putStringR(String text,
int maxLen,
int line)
Right aligned setting in of a character sequence.
|
void |
run()
Running display thread's working method.
|
void |
shiftL(int line)
Left shift a line by one character position.
|
boolean |
startRunText(String text,
Component comp,
int time)
Start the running text display (only for one liners).
|
boolean |
stopRunText()
Stop the running display.
|
clear, getDot, paint, setAllBack, setBackground, setDot, setDots, setForeground, setMarginGround, setShift
public final int nOcols
public final int nOlines
public final int charDist
public final int lineDist
protected final int lineHeight
protected final int columWidth
protected MatrixTextDisplay(int nOlines, int nOcols, int charDist, int lineDist, MatrixDisplayDim size)
size
- herein size.noXdots and size.noYdots are irrelevantpublic static MatrixTextDisplay make(int nOlines, int nOcols, int charDist, int lineDist, MatrixDisplayDim size)
size
- herein size.noXdots and size.noYdots are irrelevant; if null
16 is took for margins and 4 for the dot size.public void clearLine(int line)
charDist
spacing dots and the right scroll reserve will be set to 0 (off, space).line
- 0..nOlines
(line == nOlines is lower scroll reserve)public void putC(char c, int line, int colmn)
public void shiftL(int line)
public void putCR(char c, int line)
putC(c, line, nOcols)
;shiftL(line)
;public void putStringR(String text, int maxLen, int line)
text
- the linemaxLen
- the length / number of charactersline
- the line to modifypublic void putStringL(String text, int maxLen, int line)
text
- the character sequence to set inmaxLen
- the length / number of charactersline
- the line to modifypublic boolean stopRunText()
public boolean startRunText(String text, Component comp, int time)
text
will be set left aligned in line 0.comp
supplied is not null and if the text is longer than the display width,
a thread is started, that will scroll the whole text from left to right
(infinitely until explicitly stopped).text
- the running display text (marquee)comp
- a graphical component, embedding this Paintable object and
accepting repaint requests.time
- the scroll step time in milliseconds 10 .. 2000ms default 44ms