|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.event.MouseAdapter | +--jj2000.disp.ImgMouseListener
This class handles the dragging of an image displayed in an ImgScrollPane. When the mouse is dragged the image scrolls accordingly.
Objects of this class must be registerd as both mouse listener and mouse motion listener.
While the dragging is taking place the cursor is changed to the MOVE_CURSOR type. The original cursor is restored when the mouse is released after the drag.
Field Summary | |
(package private) ImgScrollPane |
isp
The component where the image is displayed |
(package private) java.awt.Cursor |
prevCursor
|
(package private) int |
startMouseX
The horizontal coordinate where the drag starts |
(package private) int |
startMouseY
The vertical coordinate where the drag starts |
(package private) int |
startScrollX
The horizontal scroll position when the drag started |
(package private) int |
startScrollY
The vertical scroll position when the drag started |
Constructor Summary | |
ImgMouseListener(ImgScrollPane isp)
Instantiate a new ImgMouseListener that will work on the specified ImgScrollPane. |
Method Summary | |
void |
mouseDragged(java.awt.event.MouseEvent evt)
|
void |
mouseMoved(java.awt.event.MouseEvent evt)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
Methods inherited from class java.awt.event.MouseAdapter |
mouseClicked, mouseEntered, mouseExited |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
ImgScrollPane isp
int startMouseX
int startMouseY
int startScrollX
int startScrollY
java.awt.Cursor prevCursor
Constructor Detail |
public ImgMouseListener(ImgScrollPane isp)
isp
- The image scroll pane on which the actions should operate.Method Detail |
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class java.awt.event.MouseAdapter
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class java.awt.event.MouseAdapter
public void mouseDragged(java.awt.event.MouseEvent evt)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved
in interface java.awt.event.MouseMotionListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |