net.refractions.udig.tools.edit
Class MouseTracker

java.lang.Object
  extended by net.refractions.udig.tools.edit.MouseTracker

public class MouseTracker
extends java.lang.Object

Keeps track of the what mouse events have happened. Must be in event thread to call this method.

Since:
1.1.0
Author:
jones

Constructor Summary
MouseTracker(EditToolHandler handler2)
           
 
Method Summary
 Point getCurrentPoint()
          Returns the current location of the mouse.
 Point getDragStarted()
           
protected  java.util.Queue<MapMouseEvent> getModifiablePreviousEvents()
          Returns the previous events queue.
 java.util.Queue<MapMouseEvent> getPreviousEvents()
          This is a copy modifying queue will have no effect on original queue
protected  void setDragStarted(Point dragStarted)
           
protected  void updateState(MapMouseEvent e, EventType type)
          Called by EditToolhandler to updates the state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MouseTracker

public MouseTracker(EditToolHandler handler2)
Method Detail

updateState

protected void updateState(MapMouseEvent e,
                           EventType type)
Called by EditToolhandler to updates the state.

Parameters:
e - The most recent event
type - the type of event

getDragStarted

public Point getDragStarted()
Returns:
Returns the point where the drag started or null if not dragging.

getPreviousEvents

public java.util.Queue<MapMouseEvent> getPreviousEvents()
This is a copy modifying queue will have no effect on original queue

Returns:
Returns the queue of previous events.

setDragStarted

protected void setDragStarted(Point dragStarted)
Parameters:
dragStarted - The dragStarted to set.

getModifiablePreviousEvents

protected java.util.Queue<MapMouseEvent> getModifiablePreviousEvents()
Returns the previous events queue. This is a thread-safe queue.

Parameters:
previousEvents - The previousEvents to set.

getCurrentPoint

public Point getCurrentPoint()
Returns the current location of the mouse.

Returns: