jadex.swing.util
Class Magnifier

java.lang.Object
  |
  +--jadex.swing.util.Magnifier
All Implemented Interfaces:
java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class Magnifier
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

A mouse listener and mousemotion listener to zoom a range in a JPanel. By using Zoomabl together, a zoomable JPanel can be created. So-called zooming here means a region of map can be magnified by creating a rectangle.


Constructor Summary
Magnifier(Zoomable p)
          constructor to initialize panel
 
Method Summary
 void mouseClicked(java.awt.event.MouseEvent e)
          Zooming in the drawn rectangle by clicking mouse.
 void mouseDragged(java.awt.event.MouseEvent e)
          Create a rectangle by mouse dragging.
 void mouseEntered(java.awt.event.MouseEvent p1)
          Do nothing.
 void mouseExited(java.awt.event.MouseEvent p1)
          Do nothing.
 void mouseMoved(java.awt.event.MouseEvent e)
          Detecting is mouse is in the drawn rectangle by mouse moving.
 void mousePressed(java.awt.event.MouseEvent p1)
          Do nothing.
 void mouseReleased(java.awt.event.MouseEvent p1)
          Do nothing.
 void setVerTicalPosition(float pos)
          Set the vertical position.
 void setZoomable(Zoomable p)
          Set the Zoomable for zooming.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Magnifier

public Magnifier(Zoomable p)
constructor to initialize panel
Method Detail

setZoomable

public void setZoomable(Zoomable p)
Set the Zoomable for zooming.
Parameters:
p - a Zoomable can be magnified.

setVerTicalPosition

public void setVerTicalPosition(float pos)
Set the vertical position. Only a rectangle around this position can be used for zooming.
Parameters:
pos - the vertical position.

mouseReleased

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

mouseEntered

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

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Zooming in the drawn rectangle by clicking mouse.
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

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

mouseExited

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

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Create a rectangle by mouse dragging.
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Detecting is mouse is in the drawn rectangle by mouse moving. If in, the cursor will be changed to indicate a region can be zoomed.
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener