org.icepdf.ri.common.tools
Class TextSelectionViewHandler

java.lang.Object
  extended by org.icepdf.ri.common.tools.CommonToolHandler
      extended by org.icepdf.ri.common.tools.SelectionBoxHandler
          extended by org.icepdf.ri.common.tools.TextSelection
              extended by org.icepdf.ri.common.tools.TextSelectionViewHandler
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener, javax.swing.event.MouseInputListener, ToolHandler

public class TextSelectionViewHandler
extends TextSelection
implements ToolHandler, java.awt.event.MouseWheelListener

TextSelectionViewHandler propagates text selection events into the the views child page components. This handle is required for multi-page text selection. On mouse click all text selection states are removed.

Since:
5.0

Field Summary
protected  boolean isDragging
           
protected static java.util.logging.Logger logger
           
protected  javax.swing.JComponent parentComponent
           
 
Fields inherited from class org.icepdf.ri.common.tools.TextSelection
bottomMargin, bottomMarginExclusion, enableMarginExclusion, enableMarginExclusionBorder, lastMouseLocation, lastMousePressedLocation, selectedCount, topMargin, topMarginExclusion
 
Fields inherited from class org.icepdf.ri.common.tools.SelectionBoxHandler
currentRect, dash1, previousRectDrawn, rectToDraw, selectionBoxColour, stroke
 
Fields inherited from class org.icepdf.ri.common.tools.CommonToolHandler
documentViewController, documentViewModel, pageViewComponent
 
Constructor Summary
TextSelectionViewHandler(DocumentViewController documentViewController, DocumentViewModel documentViewModel, javax.swing.JComponent parentComponent)
           
 
Method Summary
 void installTool()
          Callback code that allows post construct task to take place when the tool is selected via the AbstractDocumentView.setToolMode(int) call.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
           
 void paintTool(java.awt.Graphics g)
          Paints the tools pre-annotation creation state.
 void setSelectionRectangle(java.awt.Point cursorLocation, java.awt.Rectangle selection)
           
 void uninstallTool()
          Callback code that allows pre destroy task to take place when the tool is unselected via the AbstractDocumentView.setToolMode(int) call.
 
Methods inherited from class org.icepdf.ri.common.tools.TextSelection
calculateTextSelectionExclusion, clearSelection, clearSelectionState, lineSelectHandler, multiLineSelectHandler, paintSelectedText, paintTextBounds, selection, selectionEnd, selectionIcon, selectionStart, setBottomMargin, setTopMargin, wordLineSelection, wordSelectHandler
 
Methods inherited from class org.icepdf.ri.common.tools.SelectionBoxHandler
clearRectangle, getCurrentRect, getRectToDraw, isOverPageComponent, paintSelectionBox, resetRectangle, setCurrentRect, setRectToDraw, setSelectionSize, updateDrawableRect, updateSelectionSize
 
Methods inherited from class org.icepdf.ri.common.tools.CommonToolHandler
convertMouseToPageSpace, convertRectangleToPageSpace, convertToPageSpace, convertToPageSpace, getPageTransform, getPageTransform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static final java.util.logging.Logger logger

parentComponent

protected javax.swing.JComponent parentComponent

isDragging

protected boolean isDragging
Constructor Detail

TextSelectionViewHandler

public TextSelectionViewHandler(DocumentViewController documentViewController,
                                DocumentViewModel documentViewModel,
                                javax.swing.JComponent parentComponent)
Method Detail

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
Specified by:
mouseWheelMoved in interface java.awt.event.MouseWheelListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

paintTool

public void paintTool(java.awt.Graphics g)
Description copied from interface: ToolHandler
Paints the tools pre-annotation creation state.

Specified by:
paintTool in interface ToolHandler
Parameters:
g - graphics context

setSelectionRectangle

public void setSelectionRectangle(java.awt.Point cursorLocation,
                                  java.awt.Rectangle selection)
Overrides:
setSelectionRectangle in class TextSelection

installTool

public void installTool()
Description copied from interface: ToolHandler
Callback code that allows post construct task to take place when the tool is selected via the AbstractDocumentView.setToolMode(int) call.

Specified by:
installTool in interface ToolHandler

uninstallTool

public void uninstallTool()
Description copied from interface: ToolHandler
Callback code that allows pre destroy task to take place when the tool is unselected via the AbstractDocumentView.setToolMode(int) call.

Specified by:
uninstallTool in interface ToolHandler

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener