es.prodevelop.gvsig.mobile.gui.tool.behavior
Class RectangleBehavior

java.lang.Object
  extended byes.prodevelop.gvsig.mobile.gui.tool.behavior.Behavior
      extended byes.prodevelop.gvsig.mobile.gui.tool.behavior.RectangleBehavior
All Implemented Interfaces:
java.util.EventListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener

public class RectangleBehavior
extends Behavior

This behavior class is used when the tool needs to know the rectangle defined with a drag and drop process. So it applies to tools like zoom to rectangle or select by rectangle.

Author:
jldominguez
See Also:
RectangleToolListener

Constructor Summary
RectangleBehavior(RectangleToolListener l)
          COnstructor.
 
Method Summary
 java.awt.Cursor getCursor()
          Overrides ancestor method in case another cursor has to be used when the asscodiated tool is in use.
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
          This behavior class has to remember the starting point of drag and drop processes.
 void mousePressed(java.awt.event.MouseEvent e)
          This behavior class has to remember the starting point of drag and drop processes.
 void mouseReleased(java.awt.event.MouseEvent e)
          This behavior class has to remember the starting point of drag and drop processes.
 
Methods inherited from class es.prodevelop.gvsig.mobile.gui.tool.behavior.Behavior
mouseEntered, mouseExited, mouseMoved
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RectangleBehavior

public RectangleBehavior(RectangleToolListener l)
COnstructor.

Parameters:
l - the listener which will be notified with rectangle-like events.
Method Detail

getCursor

public java.awt.Cursor getCursor()
Overrides ancestor method in case another cursor has to be used when the asscodiated tool is in use.

Overrides:
getCursor in class Behavior
Returns:
the default cursor icon to be used when this tool is active.

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
This behavior class has to remember the starting point of drag and drop processes.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class Behavior
Parameters:
e - the mouse event that could be the start of a drag and drop process.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class Behavior

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
This behavior class has to remember the starting point of drag and drop processes. When the mouse-up event happens, a rectangle-like event is created and notified to its listener.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class Behavior
Parameters:
e - the mouse event that could be the end of a drag and drop process.

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
This behavior class has to remember the starting point of drag and drop processes. When the mouse-up event happens, a rectangle-like event is created and notified to its listener. this drag event is in the middle of the process and could be useful for the listener.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Overrides:
mouseDragged in class Behavior
Parameters:
e - a mouse event in the middle of a drag and drop process.