edu.umd.cfar.lamp.viper.gui.canvas
Class CanvasEditor
java.lang.Object
edu.umd.cs.piccolo.event.PBasicInputEventHandler
edu.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.
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 |
CanvasEditor
public CanvasEditor(Attributable attrIn)
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.