|
||||||||||
| 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.ViewerWidget
org.faceless.pdf2.viewer2.ToggleViewerWidget
org.faceless.pdf2.viewer2.feature.TextTool
public class TextTool
This widget allows the document to be dragged and scrolled. This widget is selected by default if no other items in its group are selected.
This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.
| Field Summary | |
|---|---|
static int |
TYPE_BLOCK
A parameter to setHighlightColor(java.awt.Paint, int) which will highlight the selected
text using a solid block of (usually translucent) color |
| Constructor Summary | |
|---|---|
TextTool()
Create a new TextTool object |
|
| Method Summary | |
|---|---|
void |
action(ViewerEvent event)
Toggle the active state of this widget by calling ToggleViewerWidget.setSelected(boolean) |
void |
copy()
Copy the selected text (if any) to the System clipboard |
void |
documentUpdated(DocumentPanelEvent event)
Called when an DocumentPanelEvent is raised |
void |
focusGained(FocusEvent event)
|
void |
focusLost(FocusEvent event)
|
void |
initialize(PDFViewer viewer)
Called when the feature is first added to a viewer |
void |
pageAction(PagePanelInteractionEvent event)
Handle mousePressed, mouseDragged and mouseMoved events on this page, which are used to select text. |
void |
pageUpdated(PagePanelEvent event)
Called when a PagePanelEvent is raised |
void |
select(PageExtractor.Text text)
Select the specified text. |
void |
selectAll()
Select all the text on the page |
void |
setDraggable(boolean draggable)
|
void |
setHighlightColor(Paint color,
int type)
Set the color of the selected text. |
protected void |
updateViewport(DocumentViewport vp,
boolean selected)
Called from ToggleViewerWidget.setSelected(boolean), this method is called in each
viewport in use by the PDFViewer or DocumentPanel so
it can update its status. |
| Methods inherited from class org.faceless.pdf2.viewer2.ToggleViewerWidget |
|---|
getGroupName, getGroupOwner, getGroupSelection, getWidgets, isSelected, setGroupOwner, setSelected |
| Methods inherited from class org.faceless.pdf2.viewer2.ViewerWidget |
|---|
getComponent, getViewer, isButtonEnabledByDefault, isMenuEnabledByDefault, setButton, setComponent, setDocumentRequired, setMenu, setMenu, setToolBarEnabled, setToolBarEnabledAlways, setToolBarFloatable, setToolBarFloating, toString |
| Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature |
|---|
getAllFeatures, getName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int TYPE_BLOCK
setHighlightColor(java.awt.Paint, int) which will highlight the selected
text using a solid block of (usually translucent) color
| Constructor Detail |
|---|
public TextTool()
| Method Detail |
|---|
public void setHighlightColor(Paint color,
int type)
public void setDraggable(boolean draggable)
public void initialize(PDFViewer viewer)
ViewerFeature
initialize in class ToggleViewerWidgetpublic void action(ViewerEvent event)
ToggleViewerWidgetToggleViewerWidget.setSelected(boolean)
action in class ToggleViewerWidget
protected void updateViewport(DocumentViewport vp,
boolean selected)
ToggleViewerWidgetToggleViewerWidget.setSelected(boolean), this method is called in each
viewport in use by the PDFViewer or DocumentPanel so
it can update its status. By default it is a no-op.
updateViewport in class ToggleViewerWidgetpublic void focusGained(FocusEvent event)
focusGained in interface FocusListenerpublic void focusLost(FocusEvent event)
focusLost in interface FocusListenerpublic void documentUpdated(DocumentPanelEvent event)
DocumentPanelListenerDocumentPanelEvent is raised
documentUpdated in interface DocumentPanelListenerpublic void pageUpdated(PagePanelEvent event)
PagePanelListenerPagePanelEvent is raised
pageUpdated in interface PagePanelListenerpublic void copy()
public void selectAll()
public void select(PageExtractor.Text text)
text - the Text item to display, or null to select no text
IllegalArgumentException - if the text item is from a different PDFpublic void pageAction(PagePanelInteractionEvent event)
pageAction in interface PagePanelInteractionListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||