edu.umd.cfar.lamp.viper.gui.canvas
Class GenericBoxEditor

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
All Implemented Interfaces:
java.util.EventListener, edu.umd.cs.piccolo.event.PInputEventListener, Selectable
Direct Known Subclasses:
BboxCanvasEditor, OboxCanvasEditor

public abstract class GenericBoxEditor
extends CanvasEditor

Author:
davidm TODO To change the template for this generated type comment go to Window - Preferences - Java - Code Generation - Code and Comments

Field Summary
protected  PBoxNode box
           
protected  int CORNER_THRESHOLD
           
protected  CanvasDir currDir
           
protected  java.awt.geom.Point2D[] currPts
           
protected static boolean DEFAULT_DRAW_FROM_CENTER
           
protected  java.awt.geom.Point2D dragPoint
           
protected static int LEFT_MOUSE_MASK
           
protected  java.awt.geom.Point2D[] origPts
           
protected  java.awt.geom.Point2D pressPoint
           
protected  int SIDE_THRESHOLD
           
 
Constructor Summary
GenericBoxEditor(Attributable attrIn)
           
 
Method Summary
protected  boolean cornerPointsValid()
           
protected  CanvasDir findDirection(java.awt.geom.Point2D refPoint)
           
static boolean isCorner(CanvasDir dir)
           
 boolean isDrawnFromCenter()
           
static boolean isEdge(CanvasDir dir)
           
 void keyPressed(edu.umd.cs.piccolo.event.PInputEvent e)
           
 void keyReleased(edu.umd.cs.piccolo.event.PInputEvent e)
           
abstract  void resizeBox(CanvasDir dir)
           
 void setDrawnFromCenter(boolean b)
           
 
Methods inherited from class edu.umd.cfar.lamp.viper.gui.canvas.CanvasEditor
doNotProcessEvent, doWhenSelected, doWhenUnselected, getAttributable, getMediator, getName, getShape, inRangeOfInterest, 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, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, mouseWheelRotated, mouseWheelRotatedByBlock, paramString, processEvent, setEventFilter, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.umd.cfar.lamp.viper.gui.canvas.Selectable
contains, minDist
 

Field Detail

DEFAULT_DRAW_FROM_CENTER

protected static final boolean DEFAULT_DRAW_FROM_CENTER
See Also:
Constant Field Values

LEFT_MOUSE_MASK

protected static final int LEFT_MOUSE_MASK
See Also:
Constant Field Values

currDir

protected CanvasDir currDir

origPts

protected java.awt.geom.Point2D[] origPts

currPts

protected java.awt.geom.Point2D[] currPts

pressPoint

protected java.awt.geom.Point2D pressPoint

dragPoint

protected java.awt.geom.Point2D dragPoint

box

protected PBoxNode box

CORNER_THRESHOLD

protected int CORNER_THRESHOLD

SIDE_THRESHOLD

protected int SIDE_THRESHOLD
Constructor Detail

GenericBoxEditor

public GenericBoxEditor(Attributable attrIn)
Method Detail

findDirection

protected CanvasDir findDirection(java.awt.geom.Point2D refPoint)

isDrawnFromCenter

public boolean isDrawnFromCenter()
Returns:

setDrawnFromCenter

public void setDrawnFromCenter(boolean b)
Parameters:
b -

resizeBox

public abstract void resizeBox(CanvasDir dir)

isCorner

public static boolean isCorner(CanvasDir dir)

isEdge

public static boolean isEdge(CanvasDir dir)

cornerPointsValid

protected boolean cornerPointsValid()
Returns:

keyPressed

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

keyReleased

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