org.jhotdraw.draw.tool
Class DefaultSelectAreaTracker
java.lang.Object
org.jhotdraw.beans.AbstractBean
org.jhotdraw.draw.tool.AbstractTool
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
| 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 java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.awt.event.MouseListener |
mouseClicked, mouseEntered |
| Methods inherited from interface java.awt.event.KeyListener |
keyPressed, keyReleased, keyTyped |
DefaultSelectAreaTracker
public DefaultSelectAreaTracker()
- Creates a new instance.
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