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.
SelectionTool
,
Serialized Formanchor, editor, isWorking, listenerList
propertySupport
Constructor and Description |
---|
DefaultSelectAreaTracker()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
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) |
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
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addToolListener, editCopy, editCut, editDelete, editDuplicate, editPaste, getToolTipText, removeToolListener, supportsHandleInteraction
public DefaultSelectAreaTracker()
public void mousePressed(java.awt.event.MouseEvent evt)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class AbstractTool
public void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class AbstractTool
public void mouseDragged(java.awt.event.MouseEvent evt)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class AbstractTool
public void mouseExited(java.awt.event.MouseEvent evt)
mouseExited
in interface java.awt.event.MouseListener
mouseExited
in class AbstractTool
public void draw(java.awt.Graphics2D g)
Tool
draw
in interface Tool
draw
in class AbstractTool
protected void clearHoverHandles()
protected void updateHoverHandles(DrawingView view, Figure f)
public void activate(DrawingEditor editor)
Tool
activate
in interface Tool
activate
in class AbstractTool
public void deactivate(DrawingEditor editor)
Tool
deactivate
in interface Tool
deactivate
in class AbstractTool