diva.sketch.toolbox
Class PanZoomInterpreter

java.lang.Object
  extended by diva.canvas.interactor.AbstractInteractor
      extended by diva.sketch.toolbox.PanZoomInterpreter
All Implemented Interfaces:
LayerListener, LayerMotionListener, Interactor, EventListener

public class PanZoomInterpreter
extends AbstractInteractor

Version:
$Revision: 1.9 $
Author:
Heloise Hse (hwawen@eecs.berkeley.edu)

Nested Class Summary
 class PanZoomInterpreter.LocalRecognizer
           
 
Field Summary
static String PZ
           
 
Constructor Summary
PanZoomInterpreter(PanZoomController c)
           
 
Method Summary
protected  void appendStroke(LayerEvent e)
          Append the given new point/timestamp to the current stroke.
protected  void finishStroke()
          Called upon mouse released event.
 boolean isMotionEnabled()
          We're not handling motion events.
 void mouseDragged(LayerEvent e)
          Update the current stroke and its visual representation.
 void mousePressed(LayerEvent e)
          Instantiate a new stroke and add its visual representation as a symbol in the pane.
 void mouseReleased(LayerEvent e)
          Update the current stroke and its visual representation, and interpret the stroke using either the command recognizer or the UML recognizer.
protected  void removeCurrentFigure()
          Utility function.
protected  void startStroke()
          This method is invoked upon mouse down.
 
Methods inherited from class diva.canvas.interactor.AbstractInteractor
accept, getMouseFilter, isConsuming, isEnabled, mouseClicked, mouseEntered, mouseExited, mouseMoved, setConsuming, setEnabled, setMotionEnabled, setMouseFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PZ

public static final String PZ
See Also:
Constant Field Values
Constructor Detail

PanZoomInterpreter

public PanZoomInterpreter(PanZoomController c)
                   throws Exception
Throws:
Exception
Method Detail

appendStroke

protected final void appendStroke(LayerEvent e)
Append the given new point/timestamp to the current stroke.


removeCurrentFigure

protected void removeCurrentFigure()
Utility function. Remove the current figure from the figure layer.


startStroke

protected final void startStroke()
This method is invoked upon mouse down. A TimedStroke object and a BasicFigure object are created to represent the stroke being drawn. The figure is added to the pane, so that the user can see what he's drawing.


finishStroke

protected final void finishStroke()
Called upon mouse released event. Set current stroke, symbol and figure objects to null.


isMotionEnabled

public boolean isMotionEnabled()
We're not handling motion events.

Specified by:
isMotionEnabled in interface Interactor
Overrides:
isMotionEnabled in class AbstractInteractor

mouseDragged

public void mouseDragged(LayerEvent e)
Update the current stroke and its visual representation.

Specified by:
mouseDragged in interface LayerListener
Overrides:
mouseDragged in class AbstractInteractor

mousePressed

public void mousePressed(LayerEvent e)
Instantiate a new stroke and add its visual representation as a symbol in the pane.

Specified by:
mousePressed in interface LayerListener
Overrides:
mousePressed in class AbstractInteractor

mouseReleased

public void mouseReleased(LayerEvent e)
Update the current stroke and its visual representation, and interpret the stroke using either the command recognizer or the UML recognizer. This depends on with which mouse button the stroke is drawn.

Specified by:
mouseReleased in interface LayerListener
Overrides:
mouseReleased in class AbstractInteractor


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.