es.prodevelop.gvsig.mobile.gui.tool.event
Class RectangleEvent

java.lang.Object
  extended byes.prodevelop.gvsig.mobile.gui.tool.event.RectangleEvent

public class RectangleEvent
extends java.lang.Object

Utility class to encapsulate mouse events, used to send info between behavior classes and tool listeners.

Author:
jldominguez
See Also:
RectangleBehavior, RectangleToolListener

Constructor Summary
RectangleEvent(java.awt.Point p1, java.awt.Point p2, java.awt.event.MouseEvent e)
          Constructor.
 
Method Summary
 java.awt.event.MouseEvent getEvent()
          Gets the original mouse event.
 java.awt.Rectangle getRectangle()
          Gets the rectangle defined by the start and end points.
 void setEndPoint(java.awt.Point p)
          Sets the final point.
 void setStartPoint(java.awt.Point p)
          Sets the initial point.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RectangleEvent

public RectangleEvent(java.awt.Point p1,
                      java.awt.Point p2,
                      java.awt.event.MouseEvent e)
Constructor.

Parameters:
p1 - the starting point on which the user has clicked
p2 - the final point, when the user has lifted the mouse
e - the original java mouse event.
Method Detail

getRectangle

public java.awt.Rectangle getRectangle()
Gets the rectangle defined by the start and end points.

Returns:
the rectangle defined by the start and end points.

setStartPoint

public void setStartPoint(java.awt.Point p)
Sets the initial point.

Parameters:
p - the initial point where the user has clicked.

setEndPoint

public void setEndPoint(java.awt.Point p)
Sets the final point.

Parameters:
p - the final point where the user has lifted the mouse.

getEvent

public java.awt.event.MouseEvent getEvent()
Gets the original mouse event.

Returns:
the original mouse event.