public static class SearchPanel.Results extends JPanel implements SidePanel, DocumentPanelListener, PropertyChangeListener
JPanel.AccessibleJPanel
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
Results()
Create a new Results object.
|
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener listener)
Add a
ChangeListener to this panel. |
void |
addResult(PageExtractor.Text text)
Add the specified
PageExtractor.Text to the list of results |
void |
cancel()
Cancel any currently running search
|
void |
clearResults()
Clear the list of results
|
void |
documentUpdated(DocumentPanelEvent event)
Called when an
DocumentPanelEvent is raised |
Icon |
getIcon()
Return the Icon to use when displaying this SidePanel
|
String |
getName()
Return the name of this tab - "Find"
|
float |
getSearchProgress()
Return the progress of the current search.
|
protected void |
indexPage(int pagenumber,
PageExtractor extractor)
Index the page.
|
protected boolean |
mayContain(int pagenumber,
String value)
Return whether the specified text may be found on the specified pagenumber.
|
void |
panelHidden()
Called when the panel is made hidden
|
void |
panelVisible()
Called when the panel is made visible
|
void |
propertyChange(PropertyChangeEvent event) |
void |
removeChangeListener(ChangeListener listener)
Remove a
ChangeListener from this panel. |
void |
search(String text)
Search for an item of text in the PDF currently displayed in this
DocumentPanel . |
void |
setDocumentPanel(DocumentPanel docpanel)
Set the
DocumentPanel this SidePanel is a member of. |
void |
setTextTool(TextTool selection)
Set the
TextTool object this object will highlight its results
on. |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public String getName()
public Icon getIcon()
SidePanel
public void setTextTool(TextTool selection)
TextTool
object this object will highlight its results
on.public void addResult(PageExtractor.Text text)
PageExtractor.Text
to the list of resultspublic void clearResults()
public void addChangeListener(ChangeListener listener)
ChangeListener
to this panel. A ChangeEvent
will be raised when the status of the search is updated.public void removeChangeListener(ChangeListener listener)
ChangeListener
from this panel.public void search(String text)
DocumentPanel
.
If a search is currently running it is interrupted, and any previously found results
are cleared.text
- the text to search forpublic void cancel()
public float getSearchProgress()
protected void indexPage(int pagenumber, PageExtractor extractor)
mayContain(int, java.lang.String)
pagenumber
- the page numberextractor
- the extractor for that pageprotected boolean mayContain(int pagenumber, String value)
PageExtractor.getMatchingText(java.lang.String)
run on it to find and (possibly) return matching values. Although this method
could theoretically use some sort of index created in indexPage(int, org.faceless.pdf2.PageExtractor)
to narrow down
which pages to search, but the default implementation always returns true.pagenumber
- the pagenumber to searchvalue
- the text to search forpublic void setDocumentPanel(DocumentPanel docpanel)
SidePanel
DocumentPanel
this SidePanel is a member of. This method
is called every time the DocumentPanel has it's document changed - the
SidePanel should be reinitialized in this call. If the SidePanel
is removed, this method will be called with null
as it's
argument.setDocumentPanel
in interface SidePanel
public void documentUpdated(DocumentPanelEvent event)
DocumentPanelListener
DocumentPanelEvent
is raiseddocumentUpdated
in interface DocumentPanelListener
public void propertyChange(PropertyChangeEvent event)
propertyChange
in interface PropertyChangeListener
public void panelVisible()
SidePanel
panelVisible
in interface SidePanel
public void panelHidden()
SidePanel
panelHidden
in interface SidePanel
Copyright © 2001-2017 Big Faceless Organization