org.icepdf.core.views.common
Class SelectionBoxHandler

java.lang.Object
  extended by org.icepdf.core.views.common.SelectionBoxHandler
Direct Known Subclasses:
AnnotationHandler, TextSelectionPageHandler

public class SelectionBoxHandler
extends java.lang.Object

Handles the drawing of a selection box commonly used for selection amoung other things.

Since:
4.0

Field Summary
protected  java.awt.Rectangle currentRect
           
protected static float[] dash1
           
protected  java.awt.Rectangle previousRectDrawn
           
protected  java.awt.Rectangle rectToDraw
           
protected  java.awt.Color selectionBoxColour
           
protected static java.awt.BasicStroke stroke
           
 
Constructor Summary
SelectionBoxHandler()
           
 
Method Summary
 void clearRectangle(java.awt.Component component)
           
 java.awt.Rectangle getCurrentRect()
           
 java.awt.Rectangle getRectToDraw()
           
 void paintSelectionBox(java.awt.Graphics g)
           
 void resetRectangle(int x, int y)
           
 void setCurrentRect(java.awt.Rectangle currentRect)
           
 void setRectToDraw(java.awt.Rectangle rectToDraw)
           
 void setSelectionSize(java.awt.Rectangle rect, java.awt.Component component)
           
 void updateDrawableRect(int compWidth, int compHeight)
          Udpate the drawable rectangle so that it does not extend bast the edge of the page.
 void updateSelectionSize(java.awt.event.MouseEvent e, java.awt.Component component)
          Update the size of the selection rectangle.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dash1

protected static float[] dash1

stroke

protected static java.awt.BasicStroke stroke

currentRect

protected java.awt.Rectangle currentRect

rectToDraw

protected java.awt.Rectangle rectToDraw

previousRectDrawn

protected java.awt.Rectangle previousRectDrawn

selectionBoxColour

protected java.awt.Color selectionBoxColour
Constructor Detail

SelectionBoxHandler

public SelectionBoxHandler()
Method Detail

paintSelectionBox

public void paintSelectionBox(java.awt.Graphics g)

resetRectangle

public void resetRectangle(int x,
                           int y)

getCurrentRect

public java.awt.Rectangle getCurrentRect()

setCurrentRect

public void setCurrentRect(java.awt.Rectangle currentRect)

getRectToDraw

public java.awt.Rectangle getRectToDraw()

setRectToDraw

public void setRectToDraw(java.awt.Rectangle rectToDraw)

clearRectangle

public void clearRectangle(java.awt.Component component)

updateSelectionSize

public void updateSelectionSize(java.awt.event.MouseEvent e,
                                java.awt.Component component)
Update the size of the selection rectangle.

Parameters:
e -

setSelectionSize

public void setSelectionSize(java.awt.Rectangle rect,
                             java.awt.Component component)

updateDrawableRect

public void updateDrawableRect(int compWidth,
                               int compHeight)
Udpate the drawable rectangle so that it does not extend bast the edge of the page.

Parameters:
compWidth - width of component being selected
compHeight - height of component being selected.