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

java.lang.Object
  extended byedu.umd.cs.piccolo.event.PBasicInputEventHandler
      extended byedu.umd.cfar.lamp.viper.gui.canvas.CanvasEditor
All Implemented Interfaces:
java.util.EventListener, edu.umd.cs.piccolo.event.PInputEventListener, Selectable
Direct Known Subclasses:
CircleCanvasEditor, EllipseCanvasEditor, GenericBoxEditor, OmegaCanvasEditor, PointCanvasEditor, PolygonCanvasEditor

public abstract class CanvasEditor
extends edu.umd.cs.piccolo.event.PBasicInputEventHandler
implements Selectable

Base class for spatial data editor proxies.


Constructor Summary
CanvasEditor(Attributable attrIn)
           
 
Method Summary
protected  boolean doNotProcessEvent(edu.umd.cs.piccolo.event.PInputEvent e)
           
 void doWhenSelected()
           
abstract  void doWhenUnselected()
           
 Attributable getAttributable()
           
 ViperViewMediator getMediator()
           
abstract  java.lang.String getName()
           
 edu.umd.cs.piccolo.PNode getShape()
           
abstract  boolean inRangeOfInterest(java.awt.geom.Point2D point)
           
 boolean isDisplayWRTmode()
           
protected  boolean isLeftClicked(edu.umd.cs.piccolo.event.PInputEvent e)
           
protected  boolean isLocked(edu.umd.cs.piccolo.event.PInputEvent e)
           
protected  boolean isLockedMode()
           
 boolean isSelected()
           
protected  void refresh()
           
 void setDisplayWRTmode(boolean turnOn)
           
 void setMediator(ViperViewMediator mediator)
           
 void setSelected(boolean isSelected)
           
 void updateAttributable(Instant lastFrame, Instant currentFrame, Instant nextFrame)
           
 void zap()
          Sets the attribute to null, so that it is no longer being drawn This method is called when the user removes an object by pressing the delete key.
 
Methods inherited from class edu.umd.cs.piccolo.event.PBasicInputEventHandler
acceptsEvent, getEventFilter, keyboardFocusGained, keyboardFocusLost, keyPressed, keyReleased, 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
 

Constructor Detail

CanvasEditor

public CanvasEditor(Attributable attrIn)
Method Detail

getName

public abstract java.lang.String getName()

getShape

public edu.umd.cs.piccolo.PNode getShape()

updateAttributable

public void updateAttributable(Instant lastFrame,
                               Instant currentFrame,
                               Instant nextFrame)

getAttributable

public Attributable getAttributable()

setSelected

public void setSelected(boolean isSelected)

isDisplayWRTmode

public boolean isDisplayWRTmode()
Returns:

setDisplayWRTmode

public void setDisplayWRTmode(boolean turnOn)

refresh

protected void refresh()

isLockedMode

protected boolean isLockedMode()

isLocked

protected boolean isLocked(edu.umd.cs.piccolo.event.PInputEvent e)

isLeftClicked

protected boolean isLeftClicked(edu.umd.cs.piccolo.event.PInputEvent e)

doNotProcessEvent

protected boolean doNotProcessEvent(edu.umd.cs.piccolo.event.PInputEvent e)

doWhenSelected

public void doWhenSelected()

doWhenUnselected

public abstract void doWhenUnselected()

getMediator

public ViperViewMediator getMediator()
Returns:

setMediator

public void setMediator(ViperViewMediator mediator)
Parameters:
mediator -

inRangeOfInterest

public abstract boolean inRangeOfInterest(java.awt.geom.Point2D point)
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.

isSelected

public boolean isSelected()

zap

public void zap()
Sets the attribute to null, so that it is no longer being drawn This method is called when the user removes an object by pressing the delete key. This also removes the attribute from selection.