com.lizardtech.djvubean.anno
Class AnnoManager

java.lang.Object
  extended by java.awt.event.MouseAdapter
      extended by com.lizardtech.djvubean.anno.AnnoManager
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class AnnoManager
extends java.awt.event.MouseAdapter
implements java.awt.event.MouseMotionListener

Author:
docbill

Field Summary
protected  DjVuBean djvuBean
          DjVuBean to use.
 
Constructor Summary
AnnoManager(DjVuBean bean)
          Creates a new AnnoManager object.
 
Method Summary
 void draw(java.awt.Graphics g)
          Called to draw the Rects.
 java.util.Vector getMapArea()
          Query the vector of GRectMap objects.
 Rect getMapArea(int x, int y)
          Optains a MapArea which contains the specified coordinates.
 Rect getMapRect()
          Obtain the current GMapRect, normally set by the mouse listener as the hyperlink the mouse is currently over.
 void mouseClicked(java.awt.event.MouseEvent event)
          Submit the Rect if right clicked.
 void mouseDragged(java.awt.event.MouseEvent event)
          Event indicating the mouse was dragged.
 void mouseMoved(java.awt.event.MouseEvent event)
          Event indicating the mouse was moved.
 void setMapRect(Rect mapRect)
          Set the current GMapRect, normally set by the mouse listener as the hyperlink the mouse is currently over.
 
Methods inherited from class java.awt.event.MouseAdapter
mouseEntered, mouseExited, mousePressed, mouseReleased
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

djvuBean

protected final DjVuBean djvuBean
DjVuBean to use.

Constructor Detail

AnnoManager

public AnnoManager(DjVuBean bean)
Creates a new AnnoManager object.

Parameters:
bean - DjVuBean to use.
Method Detail

getMapArea

public Rect getMapArea(int x,
                       int y)
Optains a MapArea which contains the specified coordinates.

Parameters:
x - position along the X axis.
y - position along the Y axis.
Returns:
the corresponding GMapRect, or null.

getMapArea

public java.util.Vector getMapArea()
Query the vector of GRectMap objects.

Returns:
vector of GRectMap objects.

draw

public void draw(java.awt.Graphics g)
Called to draw the Rects.

Parameters:
g - graphics area to draw with.

getMapRect

public Rect getMapRect()
Obtain the current GMapRect, normally set by the mouse listener as the hyperlink the mouse is currently over.

Returns:
the current Rect.

setMapRect

public void setMapRect(Rect mapRect)
Set the current GMapRect, normally set by the mouse listener as the hyperlink the mouse is currently over.

Parameters:
mapRect - the current Rect.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
Submit the Rect if right clicked.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class java.awt.event.MouseAdapter
Parameters:
event - describing the mouse action.

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent event)
Event indicating the mouse was dragged. Performs no operation.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
event - describing the mouse action.

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent event)
Event indicating the mouse was moved. Used to display Rects that require the mouse to be over the Rect to display.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
event - describing the mouse action.