|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.faceless.pdf2.viewer2.ViewerFeature
org.faceless.pdf2.viewer2.feature.TextHighlighter
public class TextHighlighter
A feature that allows the highlighting of text in the viewer. The name of this feature is "TextHighlighter".
| Field Summary | |
|---|---|
static int |
TYPE_FILL
A parameter to setHighlightType() that will cause the highlight to be filled. |
static int |
TYPE_OUTLINE
A parameter to setHighlightType() that will cause the highlight to be outlined. |
static int |
TYPE_UNDERLINE
A parameter to setHighlightType() that will cause the highlight to be outlined. |
| Constructor Summary | |
|---|---|
TextHighlighter()
Create a new TextHighlighter |
|
| Method Summary | |
|---|---|
void |
addWord(String word)
Add a word to highlight to this TextHighlighter. |
void |
documentUpdated(DocumentPanelEvent event)
Called when an DocumentPanelEvent is raised |
void |
drawHighlight(Graphics2D g,
int width,
int height)
Draw the highlight. |
void |
initialize(PDFViewer viewer)
Called when the feature is first added to a viewer |
void |
pageUpdated(PagePanelEvent event)
Called when a PagePanelEvent is raised |
void |
setHighlightType(int type,
Paint color,
Stroke stroke,
float margin)
Set the type of Highlight to use |
| Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature |
|---|
getAllFeatures, getName, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int TYPE_FILL
setHighlightType() that will cause the highlight to be filled.
An example would be setHighlightType(TYPE_FILL, new Color(0x70FFFF00, true), null, 0),
to highlight the text with a translucent yellow (the default).
public static final int TYPE_OUTLINE
setHighlightType() that will cause the highlight to be outlined.
An example would be setHighlightType(TYPE_OUTLINE, Color.red, new BasicStroke(), 2) to draw
a solid red outline around the text with a 2 point margin
public static final int TYPE_UNDERLINE
setHighlightType() that will cause the highlight to be outlined.
An example would be setHighlightType(TYPE_UNDERLINE, Color.red, new BasicStroke(), 2) to draw
a solid red underline two points below the text.
| Constructor Detail |
|---|
public TextHighlighter()
| Method Detail |
|---|
public void addWord(String word)
word - the word to highlight if foundpublic void initialize(PDFViewer viewer)
ViewerFeature
initialize in class ViewerFeaturepublic void documentUpdated(DocumentPanelEvent event)
DocumentPanelListenerDocumentPanelEvent is raised
documentUpdated in interface DocumentPanelListener
public void setHighlightType(int type,
Paint color,
Stroke stroke,
float margin)
type - one of TYPE_FILL, TYPE_OUTLINE or TYPE_UNDERLINEcolor - the color to use - must not be nullstroke - the stroke to use for outline or underlining. May be null.margin - how many points around the text to use as a margin
public void drawHighlight(Graphics2D g,
int width,
int height)
g - the Graphics object to paint towidth - the width of the objectheight - the height of the objectpublic void pageUpdated(PagePanelEvent event)
PagePanelListenerPagePanelEvent is raised
pageUpdated in interface PagePanelListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||