diva.whiteboard
Class HighlightInterpreter
java.lang.Object
diva.canvas.interactor.AbstractInteractor
diva.sketch.BasicInterpreter
diva.whiteboard.HighlightInterpreter
- All Implemented Interfaces:
- LayerListener, LayerMotionListener, Interactor, EventListener
public class HighlightInterpreter
- extends BasicInterpreter
This interpreter highlights, meaning that it puts ink
at the back of the drawing rather than at the front.
- Version:
- $Revision: 1.5 $
- Author:
- Michael Shilman (michaels@eecs.berkeley.edu)
Methods inherited from class diva.sketch.BasicInterpreter |
getController, getCurrentStroke, getCurrentSymbol, isMotionEnabled, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, removeCurrentSymbol |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HighlightInterpreter
public HighlightInterpreter(SketchController c)
- Create a HighlightInterpreter which is used by the
specified controller to interpret sketch input.
appendStroke
protected final void appendStroke(LayerEvent e)
- Append the given new point/timestamp to the current
stroke. Consume the event when done.
- Overrides:
appendStroke
in class BasicInterpreter
finishStroke
protected final void finishStroke(LayerEvent e)
- Called at the end of the mouseReleased method to
finish the drawing of a stroke.
- Overrides:
finishStroke
in class BasicInterpreter
startStroke
protected final void startStroke(LayerEvent e)
- Description copied from class:
BasicInterpreter
- This method is invoked upon mouse down. Reset the
_strokeBuffer to clear the previou stroke. Set the current
stroke (_curStroke) to point to the stroke buffer, and
instantiate a StrokeSymbol (_curSymbol) that paints the stroke
with outline/fill color and line width specified in the
controller.
If a SketchPane is used, get the SketchLayer and call
startStroke, this will set the starting point of the line
segment to be drawn. SketchLayer will take care of drawing the
last line segment in the current stroke, the prior segments
stay on the canvas, they are not being rerendered. If a
SketchPane is not being used, then add _curSymbol to the sketch
model so that it can be rendered ('cause there will be no
SketchLayer).
- Overrides:
startStroke
in class BasicInterpreter
Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.