edu.umd.cfar.lamp.viper.gui.data.bbox
Class BboxCanvasEditor

java.lang.Object
  extended byedu.umd.cs.piccolo.event.PBasicInputEventHandler
      extended byedu.umd.cfar.lamp.viper.gui.canvas.CanvasEditor
          extended byedu.umd.cfar.lamp.viper.gui.canvas.GenericBoxEditor
              extended byedu.umd.cfar.lamp.viper.gui.data.bbox.BboxCanvasEditor
All Implemented Interfaces:
java.util.EventListener, edu.umd.cs.piccolo.event.PInputEventListener, Selectable

public class BboxCanvasEditor
extends GenericBoxEditor

Author:
clin

Field Summary
static double MIN_HEIGHT
           
static double MIN_WIDTH
           
 
Fields inherited from class edu.umd.cfar.lamp.viper.gui.canvas.GenericBoxEditor
box, CORNER_THRESHOLD, currDir, currPts, DEFAULT_DRAW_FROM_CENTER, dragPoint, LEFT_MOUSE_MASK, origPts, pressPoint, SIDE_THRESHOLD
 
Constructor Summary
BboxCanvasEditor(Attributable attrIn)
           
 
Method Summary
 java.awt.geom.Rectangle2D computeRect(java.awt.geom.Point2D corner, CanvasDir dir)
           
 java.awt.geom.Rectangle2D computeRect(java.awt.geom.Point2D topCorner, java.awt.geom.Point2D bottomCorner)
           
 boolean contains(java.awt.geom.Point2D select)
           
 void doWhenUnselected()
           
 java.lang.String getName()
           
 boolean inRangeOfInterest(java.awt.geom.Point2D point)
           
static int locatePointInRect(java.awt.geom.Point2D point, java.awt.geom.Rectangle2D rect)
           
 double minDist(java.awt.geom.Point2D select)
           
 void modifyRect(java.awt.geom.Rectangle2D rect, java.awt.geom.Point2D corner, CanvasDir dir)
           
 void mouseDragged(edu.umd.cs.piccolo.event.PInputEvent e)
           
 void mouseMoved(edu.umd.cs.piccolo.event.PInputEvent e)
           
 void mousePressed(edu.umd.cs.piccolo.event.PInputEvent e)
           
 void mouseReleased(edu.umd.cs.piccolo.event.PInputEvent e)
           
 void resizeBox(CanvasDir dir)
           
 void shift()
           
protected  void verifyCtrlIsPressed(edu.umd.cs.piccolo.event.PInputEvent e)
          Checks to see if the event has the ctrl mask.
 
Methods inherited from class edu.umd.cfar.lamp.viper.gui.canvas.GenericBoxEditor
cornerPointsValid, findDirection, isCorner, isDrawnFromCenter, isEdge, keyPressed, keyReleased, setDrawnFromCenter
 
Methods inherited from class edu.umd.cfar.lamp.viper.gui.canvas.CanvasEditor
doNotProcessEvent, doWhenSelected, getAttributable, getMediator, getShape, isDisplayWRTmode, isLeftClicked, isLocked, isLockedMode, isSelected, refresh, setDisplayWRTmode, setMediator, setSelected, updateAttributable, zap
 
Methods inherited from class edu.umd.cs.piccolo.event.PBasicInputEventHandler
acceptsEvent, getEventFilter, keyboardFocusGained, keyboardFocusLost, keyTyped, mouseClicked, mouseEntered, mouseExited, mouseWheelRotated, mouseWheelRotatedByBlock, paramString, processEvent, setEventFilter, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_HEIGHT

public static double MIN_HEIGHT

MIN_WIDTH

public static double MIN_WIDTH
Constructor Detail

BboxCanvasEditor

public BboxCanvasEditor(Attributable attrIn)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in class CanvasEditor

minDist

public double minDist(java.awt.geom.Point2D select)

contains

public boolean contains(java.awt.geom.Point2D select)

mouseMoved

public void mouseMoved(edu.umd.cs.piccolo.event.PInputEvent e)

doWhenUnselected

public void doWhenUnselected()
Specified by:
doWhenUnselected in class CanvasEditor

mousePressed

public void mousePressed(edu.umd.cs.piccolo.event.PInputEvent e)

mouseDragged

public void mouseDragged(edu.umd.cs.piccolo.event.PInputEvent e)

verifyCtrlIsPressed

protected void verifyCtrlIsPressed(edu.umd.cs.piccolo.event.PInputEvent e)
Checks to see if the event has the ctrl mask. Puts the controller in the appropriate draw state, depending on event.

Parameters:
e - the (mouse?) event to check

mouseReleased

public void mouseReleased(edu.umd.cs.piccolo.event.PInputEvent e)

shift

public void shift()

resizeBox

public void resizeBox(CanvasDir dir)
Specified by:
resizeBox in class GenericBoxEditor
Parameters:
dir -

computeRect

public java.awt.geom.Rectangle2D computeRect(java.awt.geom.Point2D topCorner,
                                             java.awt.geom.Point2D bottomCorner)

computeRect

public java.awt.geom.Rectangle2D computeRect(java.awt.geom.Point2D corner,
                                             CanvasDir dir)

locatePointInRect

public static int locatePointInRect(java.awt.geom.Point2D point,
                                    java.awt.geom.Rectangle2D rect)

modifyRect

public void modifyRect(java.awt.geom.Rectangle2D rect,
                       java.awt.geom.Point2D corner,
                       CanvasDir dir)

inRangeOfInterest

public boolean inRangeOfInterest(java.awt.geom.Point2D point)
Specified by:
inRangeOfInterest in class CanvasEditor
Parameters:
point -
Returns:
true if the CanvasEditor thinks this point is close enough to do something with. It returns false if point is far away enough that it's willing to let the EditorManager find a new shape to be selected as editor.