com.qoppa.pdfViewer
Class AnnotationManager

java.lang.Object
  extended bycom.qoppa.pdfViewer.AnnotationManager
All Implemented Interfaces:
ActionListener, EventListener, IDocumentListener, KeyListener, MouseListener
Direct Known Subclasses:
AnnotationManagerNotes

public class AnnotationManager
extends Object
implements MouseListener, KeyListener, IDocumentListener, ActionListener

This object manages the selection cycle for annotations. The class implements listeners to handle mouse and key events so that it can clear and set the selected annotations(s). The class also provides method to drive annotation selection through the API.

Author:
Qoppa Software

Constructor Summary
AnnotationManager(PDFViewerBean bean)
          Construct a new annotation manager.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void addAnnotToSelection(AnnotationComponent ac)
          Adds an annotation component to the list of selected annotations.
 void addSelectionListener(IAnnotSelectionListener listener)
          Adds a selection listener to the manager.
 void addWidgetToSelection(AnnotationComponent ac)
          Adds a widget component to the list of selected components.
 void clearSelection()
          Clears the current annotation selection.
 void deselectAnnotation(AnnotationComponent ac)
          De-selects a specific annotation.
 void documentChanged(DocumentEvent de)
          Method to fulfill the IDocumentListener interface.
 Vector getSelectedAnnots()
          Returns a list of annotations that are selected.
 Vector getSelectedWidgets()
          Returns a list of selected widgets.
 boolean isSelected(AnnotationComponent ac)
          Returns a flag that indicates whether the selection component is selected.
 void keyPressed(KeyEvent e)
           
 void keyReleased(KeyEvent e)
           
 void keyTyped(KeyEvent e)
           
 void mouseClicked(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void selectAnnot(AnnotationComponent ac)
          Selects an annotation.
 void selectAnnots(AnnotationComponent[] acs)
          Selects a list of annotations.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationManager

public AnnotationManager(PDFViewerBean bean)
Construct a new annotation manager.

Parameters:
bean - The PDFViewerBean that this annotation manager is tied to.
Method Detail

addSelectionListener

public void addSelectionListener(IAnnotSelectionListener listener)
Adds a selection listener to the manager. Selection listeners will be notified when any annotations are selected or deselected.

Parameters:
listener - The new listener.

addWidgetToSelection

public void addWidgetToSelection(AnnotationComponent ac)
Adds a widget component to the list of selected components.

Parameters:
ac - The widget component

addAnnotToSelection

public void addAnnotToSelection(AnnotationComponent ac)
Adds an annotation component to the list of selected annotations.

Parameters:
ac - The annotation component to add.

clearSelection

public void clearSelection()
Clears the current annotation selection. Any annotations that are selected will be deselected.


deselectAnnotation

public void deselectAnnotation(AnnotationComponent ac)
De-selects a specific annotation.

Parameters:
ac - The

getSelectedAnnots

public Vector getSelectedAnnots()
Returns a list of annotations that are selected. the list contains objects that implement AnnotationComponent.

Returns:
a list of selected annotations.

getSelectedWidgets

public Vector getSelectedWidgets()
Returns a list of selected widgets.

Returns:
a list of selected widgets.

isSelected

public boolean isSelected(AnnotationComponent ac)
Returns a flag that indicates whether the selection component is selected.

Parameters:
ac - The annotation component
Returns:
true if selected, false otherwise

selectAnnot

public void selectAnnot(AnnotationComponent ac)
Selects an annotation.

Parameters:
ac - The annotation to select.

selectAnnots

public void selectAnnots(AnnotationComponent[] acs)
Selects a list of annotations.

Parameters:
acs - The annotations to select

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

documentChanged

public void documentChanged(DocumentEvent de)
Method to fulfill the IDocumentListener interface. This object needs to be notified when the document changes to handle bookkeeping of annotations.

Specified by:
documentChanged in interface IDocumentListener

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

keyReleased

public void keyReleased(KeyEvent e)
Specified by:
keyReleased in interface KeyListener

keyTyped

public void keyTyped(KeyEvent e)
Specified by:
keyTyped in interface KeyListener

keyPressed

public void keyPressed(KeyEvent e)
Specified by:
keyPressed in interface KeyListener