Package hipp.com.wappedidpadpro2
Class DocumentParser
java.lang.Object
hipp.com.wappedidpadpro2.DocumentParser
public class DocumentParser
extends java.lang.Object
DocumentParser
parses the given text document by WAppProTextPane for tokens and their colors
parses the given text document by WAppProTextPane for tokens and their colors
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
DocumentParser.HighLightTask
this class sets or removes higlights within the textDocument -
Field Summary
Fields Modifier and Type Field Description (package private) java.util.ResourceBundle
bundle
private java.util.Map<java.lang.String,java.awt.Color>
colors
private java.util.Vector<java.awt.Color>
colVec
private long
docLength
protected javax.swing.JTextPane
jtxt
private javax.swing.text.Highlighter.HighlightPainter
myHighlightPainter
private static java.lang.String
test
(package private) java.util.Set<java.lang.String>
tokensSet
private long
usedTime
-
Constructor Summary
Constructors Constructor Description DocumentParser()
this constructor is only for testsDocumentParser(javax.swing.JTextPane _jtxt)
parses given text documents for tokens and their colors -
Method Summary
Modifier and Type Method Description void
highlightDoc()
this methode will be called from the class HighLightTask and set the highlightsprivate void
initData()
initiates the data, reads the resources for the tokens and the associated colorsstatic void
main(java.lang.String[] args)
private javax.swing.JPanel
makeMenu(java.util.ResourceBundle bundle, java.util.Set<java.lang.String> set)
void
removehighlightDoc()
this methode will be called from the class HighLightTaskvoid
removeHighlights()
removes any highlights done by method highlightDoc()
-
Field Details
-
jtxt
protected javax.swing.JTextPane jtxt -
myHighlightPainter
private javax.swing.text.Highlighter.HighlightPainter myHighlightPainter -
colVec
private java.util.Vector<java.awt.Color> colVec -
colors
private java.util.Map<java.lang.String,java.awt.Color> colors -
usedTime
private long usedTime -
docLength
private long docLength -
tokensSet
java.util.Set<java.lang.String> tokensSet -
bundle
java.util.ResourceBundle bundle -
test
private static java.lang.String test
-
-
Constructor Details
-
DocumentParser
public DocumentParser()this constructor is only for tests -
DocumentParser
public DocumentParser(javax.swing.JTextPane _jtxt)parses given text documents for tokens and their colors- Parameters:
_jtxt
-javax.swing.JTextPane
holds the TextDocument to parsejavax.swing.JTextPane
-
-
Method Details
-
removeHighlights
public void removeHighlights()removes any highlights done by method highlightDoc() -
initData
private void initData()initiates the data, reads the resources for the tokens and the associated colors -
makeMenu
private javax.swing.JPanel makeMenu(java.util.ResourceBundle bundle, java.util.Set<java.lang.String> set) -
removehighlightDoc
public void removehighlightDoc()this methode will be called from the class HighLightTask -
highlightDoc
public void highlightDoc()this methode will be called from the class HighLightTask and set the highlights -
main
public static void main(java.lang.String[] args)
-