JHotDraw 7.4.1

org.jhotdraw.draw.tool
Class DefaultSelectAreaTracker

java.lang.Object
  extended by org.jhotdraw.beans.AbstractBean
      extended by org.jhotdraw.draw.tool.AbstractTool
          extended by org.jhotdraw.draw.tool.DefaultSelectAreaTracker
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, SelectAreaTracker, Tool

public class DefaultSelectAreaTracker
extends AbstractTool
implements SelectAreaTracker

DefaultSelectAreaTracker implements interactions with the background area of a Drawing.

The DefaultSelectAreaTracker handles one of the three states of the SelectionTool. It comes into action, when the user presses the mouse button over the background of a Drawing.

Design pattern:
Name: Chain of Responsibility.
Role: Handler.
Partners: SelectionTool as Handler, DragTracker as Handler, HandleTracker as Handler.

Design pattern:
Name: State.
Role: State.
Partners: SelectionTool as Context, DragTracker as State, HandleTracker as State.

Version:
$Id: DefaultSelectAreaTracker.java -1 $
Author:
Werner Randelshofer
See Also:
SelectionTool, Serialized Form

Field Summary
 
Fields inherited from class org.jhotdraw.draw.tool.AbstractTool
anchor, editor, isWorking, listenerList
 
Fields inherited from class org.jhotdraw.beans.AbstractBean
propertySupport
 
Constructor Summary
DefaultSelectAreaTracker()
          Creates a new instance.
 
Method Summary
 void activate(DrawingEditor editor)
          Activates the tool for the given editor.
protected  void clearHoverHandles()
           
 void deactivate(DrawingEditor editor)
          Deactivates the tool.
 void draw(java.awt.Graphics2D g)
          Draws the tool.
 void mouseDragged(java.awt.event.MouseEvent evt)
           
 void mouseExited(java.awt.event.MouseEvent evt)
           
 void mouseMoved(java.awt.event.MouseEvent evt)
           
 void mousePressed(java.awt.event.MouseEvent evt)
           
 void mouseReleased(java.awt.event.MouseEvent evt)
           
protected  void updateHoverHandles(DrawingView view, Figure f)
           
 
Methods inherited from class org.jhotdraw.draw.tool.AbstractTool
addToolListener, addUndoableEditListener, constrainPoint, constrainPoint, createActionMap, createInputMap, editCopy, editCut, editDelete, editDuplicate, editPaste, fireAreaInvalidated, fireAreaInvalidated, fireBoundsInvalidated, fireToolDone, fireToolStarted, getActionMap, getDrawing, getEditor, getInputMap, getToolTipText, getView, isActive, keyPressed, keyReleased, keyTyped, maybeFireBoundsInvalidated, mouseClicked, mouseEntered, removeToolListener, removeUndoableEditListener, setActionMap, setInputMap, supportsHandleInteraction, updateCursor, viewToDrawing
 
Methods inherited from class org.jhotdraw.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jhotdraw.draw.tool.Tool
addToolListener, editCopy, editCut, editDelete, editDuplicate, editPaste, getToolTipText, removeToolListener, supportsHandleInteraction
 
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered
 
Methods inherited from interface java.awt.event.KeyListener
keyPressed, keyReleased, keyTyped
 

Constructor Detail

DefaultSelectAreaTracker

public DefaultSelectAreaTracker()
Creates a new instance.

Method Detail

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class AbstractTool

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class AbstractTool

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent evt)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent evt)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Overrides:
mouseMoved in class AbstractTool

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
Specified by:
mouseExited in interface java.awt.event.MouseListener
Overrides:
mouseExited in class AbstractTool

draw

public void draw(java.awt.Graphics2D g)
Description copied from interface: Tool
Draws the tool.

Specified by:
draw in interface Tool
Overrides:
draw in class AbstractTool

clearHoverHandles

protected void clearHoverHandles()

updateHoverHandles

protected void updateHoverHandles(DrawingView view,
                                  Figure f)

activate

public void activate(DrawingEditor editor)
Description copied from interface: Tool
Activates the tool for the given editor. This method is called whenever the user switches to this tool.

Specified by:
activate in interface Tool
Overrides:
activate in class AbstractTool

deactivate

public void deactivate(DrawingEditor editor)
Description copied from interface: Tool
Deactivates the tool. This method is called whenever the user switches to another tool.

Specified by:
deactivate in interface Tool
Overrides:
deactivate in class AbstractTool

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.