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 classDocumentParser.HighLightTaskthis class sets or removes higlights within the textDocument -
Field Summary
Fields Modifier and Type Field Description (package private) java.util.ResourceBundlebundleprivate java.util.Map<java.lang.String,java.awt.Color>colorsprivate java.util.Vector<java.awt.Color>colVecprivate longdocLengthprotected javax.swing.JTextPanejtxtprivate javax.swing.text.Highlighter.HighlightPaintermyHighlightPainterprivate static java.lang.Stringtest(package private) java.util.Set<java.lang.String>tokensSetprivate longusedTime -
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 voidhighlightDoc()this methode will be called from the class HighLightTask and set the highlightsprivate voidinitData()initiates the data, reads the resources for the tokens and the associated colorsstatic voidmain(java.lang.String[] args)private javax.swing.JPanelmakeMenu(java.util.ResourceBundle bundle, java.util.Set<java.lang.String> set)voidremovehighlightDoc()this methode will be called from the class HighLightTaskvoidremoveHighlights()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.JTextPaneholds 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)
-