Class Controller2d

java.lang.Object
  |
  +--Controller2d
Direct Known Subclasses:
Controller2dSide, Controller2dTop

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

The base class for a 2d view's Controller. This class is responsible for keeping the appropriate view focused


Inner Class Summary
protected  class Controller2d.DragAction
           
 
Field Summary
protected  Point3D _dragStartPt
           
protected  Map _map
           
protected  boolean _rubberBanding
           
protected  ViewControl _vc
           
protected  View2d _view
           
 
Constructor Summary
Controller2d()
           
 
Method Summary
abstract  void mouseClicked(java.awt.event.MouseEvent evt)
           
abstract  void mouseDragged(java.awt.event.MouseEvent evt)
           
 void mouseEntered(java.awt.event.MouseEvent evt)
          requests focus to the view and updates the ViewController info bar current info
 void mouseExited(java.awt.event.MouseEvent evt)
          nulls the ViewController info bar current info
abstract  void mouseMoved(java.awt.event.MouseEvent evt)
           
abstract  void mousePressed(java.awt.event.MouseEvent evt)
           
abstract  void mouseReleased(java.awt.event.MouseEvent evt)
           
 Point3D screenToMap(java.awt.Point p)
           
abstract  Point3D screenToMap(Point3D p)
          this modifies the Point p parameter this handles the flip across the x axis and the translation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_map

protected Map _map

_vc

protected ViewControl _vc

_dragStartPt

protected Point3D _dragStartPt

_rubberBanding

protected boolean _rubberBanding

_view

protected View2d _view
Constructor Detail

Controller2d

public Controller2d()
Method Detail

screenToMap

public abstract Point3D screenToMap(Point3D p)
this modifies the Point p parameter this handles the flip across the x axis and the translation
Parameters:
p - is changed
Returns:
the mutated p

screenToMap

public Point3D screenToMap(java.awt.Point p)

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent evt)
requests focus to the view and updates the ViewController info bar current info
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
nulls the ViewController info bar current info
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseMoved

public abstract void mouseMoved(java.awt.event.MouseEvent evt)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mouseDragged

public abstract void mouseDragged(java.awt.event.MouseEvent evt)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mousePressed

public abstract void mousePressed(java.awt.event.MouseEvent evt)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public abstract void mouseReleased(java.awt.event.MouseEvent evt)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseClicked

public abstract void mouseClicked(java.awt.event.MouseEvent evt)
Specified by:
mouseClicked in interface java.awt.event.MouseListener