|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object processing.app.syntax.TokenMarker
public abstract class TokenMarker
A token marker that splits lines of text into tokens. Each token carries a length field and an indentification tag that can be mapped to a color for painting that token.
For performance reasons, the linked list of tokens is reused after each
line is tokenized. Therefore, the return value of markTokens
should only be used for immediate painting. Notably, it cannot be
cached.
Nested Class Summary | |
---|---|
class |
TokenMarker.LineInfo
Inner class for storing information about tokenized lines. |
Method Summary | |
---|---|
void |
deleteLines(int index,
int lines)
Informs the token marker that line have been deleted from the document. |
int |
getLineCount()
Returns the number of lines in this token marker. |
void |
insertLines(int index,
int lines)
Informs the token marker that lines have been inserted into the document. |
boolean |
isNextLineRequested()
Returns true if the next line should be repainted. |
Token |
markTokens(javax.swing.text.Segment line,
int lineIndex)
A wrapper for the lower-level markTokensImpl method
that is called to split a line up into tokens. |
boolean |
supportsMultilineTokens()
Returns if the token marker supports tokens that span multiple lines. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public Token markTokens(javax.swing.text.Segment line, int lineIndex)
markTokensImpl
method
that is called to split a line up into tokens.
line
- The linelineIndex
- The line numberpublic boolean supportsMultilineTokens()
markTokens()
method (in turn).The default implementation returns true; it should be overridden to return false on simpler token markers for increased speed.
public void insertLines(int index, int lines)
lineInfo
array.
index
- The first line numberlines
- The number of linespublic void deleteLines(int index, int lines)
lineInfo
array.
index
- The first line numberlines
- The number of linespublic int getLineCount()
public boolean isNextLineRequested()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |