public class DefaultHandleTracker extends AbstractTool implements HandleTracker
The DefaultHandleTracker
handles one of the three states of the
SelectionTool
. Iz comes into action, when the user presses
the mouse button over a Figure
.
Design pattern:
Name: Chain of Responsibility.
Role: Handler.
Partners: SelectionTool
as Handler, SelectAreaTracker
as
Handler, DragTracker
as Handler, DefaultHandleTracker
as Handler.
Design pattern:
Name: State.
Role: State.
Partners: SelectAreaTracker
as State, DragTracker
as
State, SelectionTool
as Context.
SelectionTool
,
Serialized Formanchor, editor, isWorking, listenerList
propertySupport
Constructor and Description |
---|
DefaultHandleTracker() |
DefaultHandleTracker(Handle handle)
Creates a new instance.
|
DefaultHandleTracker(Handle master,
java.util.Collection<Handle> handles) |
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 |
keyPressed(java.awt.event.KeyEvent evt)
The Tool uses the InputMap to determine what to do, when a key is pressed.
|
void |
keyReleased(java.awt.event.KeyEvent evt) |
void |
keyTyped(java.awt.event.KeyEvent evt) |
void |
mouseClicked(java.awt.event.MouseEvent evt) |
void |
mouseDragged(java.awt.event.MouseEvent evt) |
void |
mouseEntered(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) |
void |
setHandles(Handle handle,
java.util.Collection<Handle> compatibleHandles) |
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, maybeFireBoundsInvalidated, 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 DefaultHandleTracker(Handle handle)
public DefaultHandleTracker(Handle master, java.util.Collection<Handle> handles)
public DefaultHandleTracker()
public void draw(java.awt.Graphics2D g)
Tool
draw
in interface Tool
draw
in class AbstractTool
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
public void keyPressed(java.awt.event.KeyEvent evt)
AbstractTool
keyPressed
in interface java.awt.event.KeyListener
keyPressed
in class AbstractTool
public void keyReleased(java.awt.event.KeyEvent evt)
keyReleased
in interface java.awt.event.KeyListener
keyReleased
in class AbstractTool
public void keyTyped(java.awt.event.KeyEvent evt)
keyTyped
in interface java.awt.event.KeyListener
keyTyped
in class AbstractTool
public void mouseClicked(java.awt.event.MouseEvent evt)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class AbstractTool
public void mouseDragged(java.awt.event.MouseEvent evt)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseEntered(java.awt.event.MouseEvent evt)
mouseEntered
in interface java.awt.event.MouseListener
mouseEntered
in class AbstractTool
public void mouseExited(java.awt.event.MouseEvent evt)
mouseExited
in interface java.awt.event.MouseListener
mouseExited
in class AbstractTool
public void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class AbstractTool
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
protected void clearHoverHandles()
protected void updateHoverHandles(DrawingView view, Figure f)
public void setHandles(Handle handle, java.util.Collection<Handle> compatibleHandles)
setHandles
in interface HandleTracker