edu.umd.cfar.lamp.viper.gui.data.polygon
Class PolygonCanvasEditor

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.data.polygon.PolygonCanvasEditor
All Implemented Interfaces:
java.util.EventListener, edu.umd.cs.piccolo.event.PInputEventListener, Selectable

public class PolygonCanvasEditor
extends CanvasEditor

Author:
clin

Field Summary
static int DELETE_VERTEX
           
static int EDGE
           
static int INSERT_VERTEX
           
static int INTERIOR
           
static int NONE
           
static int RESIZE
           
static int VERTEX
           
 
Constructor Summary
PolygonCanvasEditor(Attributable attrIn)
           
 
Method Summary
 boolean contains(java.awt.geom.Point2D select)
           
 void doWhenUnselected()
           
 void findNearest(java.awt.geom.Point2D select)
           
 java.lang.String getName()
           
 boolean inRangeOfInterest(java.awt.geom.Point2D point)
           
 void keyPressed(edu.umd.cs.piccolo.event.PInputEvent e)
           
 double minDist(java.awt.geom.Point2D selectPt)
           
 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)
           
 
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, keyReleased, 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

VERTEX

public static final int VERTEX
See Also:
Constant Field Values

EDGE

public static final int EDGE
See Also:
Constant Field Values

INTERIOR

public static final int INTERIOR
See Also:
Constant Field Values

INSERT_VERTEX

public static final int INSERT_VERTEX
See Also:
Constant Field Values

DELETE_VERTEX

public static final int DELETE_VERTEX
See Also:
Constant Field Values

RESIZE

public static final int RESIZE
See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values
Constructor Detail

PolygonCanvasEditor

public PolygonCanvasEditor(Attributable attrIn)
Method Detail

getName

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

findNearest

public void findNearest(java.awt.geom.Point2D select)

contains

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

keyPressed

public void keyPressed(edu.umd.cs.piccolo.event.PInputEvent e)
Returns:
true if it's right, false if not

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)

mouseReleased

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

minDist

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

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.