|
JHotDraw 7.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.beans.AbstractBean
org.jhotdraw.draw.AbstractTool
org.jhotdraw.draw.SelectionTool
public class SelectionTool
Tool to select and manipulate figures.
A selection tool is in one of three states: 1) area
selection, 2) figure dragging, 3) handle manipulation. The different
states are handled by different tracker objects: the
SelectAreaTracker
, the DragTracker
and the
HandleTracker
.
A Figure can be selected by clicking at it. Holding the alt key or the ctrl key down, selects the Figure behind it.
SelectAreaTracker
,
DragTracker
,
HandleTracker
,
Serialized FormField Summary | |
---|---|
static java.lang.String |
SELECT_BEHIND_ENABLED_PROPERTY
Constant for the name of the selectBehindEnabled property. |
Fields inherited from class org.jhotdraw.draw.AbstractTool |
---|
anchor, editor, isWorking, listenerList |
Fields inherited from class org.jhotdraw.beans.AbstractBean |
---|
propertySupport |
Constructor Summary | |
---|---|
SelectionTool()
Creates a new instance. |
Method Summary | |
---|---|
void |
activate(DrawingEditor editor)
Activates the tool for the given editor. |
void |
areaInvalidated(ToolEvent e)
Sent when an area of the drawing view needs to be repainted. |
protected Tool |
createAreaTracker()
Factory method to create an area tracker. |
protected Tool |
createDragTracker(Figure f)
Factory method to create a Drag tracker. |
protected Tool |
createHandleTracker(Handle handle)
Factory method to create a Handle tracker. |
void |
deactivate(DrawingEditor editor)
Deactivates the tool. |
void |
draw(java.awt.Graphics2D g)
Draws the tool. |
boolean |
isSelectBehindEnabled()
Returns the value of the selectBehindEnabled property. |
void |
keyPressed(java.awt.event.KeyEvent e)
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 |
setSelectBehindEnabled(boolean newValue)
Sets the selectBehindEnabled property. |
protected void |
setTracker(Tool newTracker)
|
void |
toolDone(ToolEvent event)
Informs the listener that a tool has done its interaction. |
void |
toolStarted(ToolEvent event)
Informs the listener that a tool has starteds interacting with a specific drawing view. |
Methods inherited from class org.jhotdraw.draw.AbstractTool |
---|
addToolListener, addUndoableEditListener, constrainPoint, constrainPoint, createActionMap, createInputMap, editCopy, editCut, editDelete, editDuplicate, editPaste, fireAreaInvalidated, fireAreaInvalidated, fireToolDone, fireToolStarted, getActionMap, getDrawing, getEditor, getInputMap, getView, isActive, removeToolListener, removeUndoableEditListener, setActionMap, setInputMap, updateCursor, viewToDrawing |
Methods inherited from class org.jhotdraw.beans.AbstractBean |
---|
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SELECT_BEHIND_ENABLED_PROPERTY
Constructor Detail |
---|
public SelectionTool()
Method Detail |
---|
public void setSelectBehindEnabled(boolean newValue)
newValue
- The new value.public boolean isSelectBehindEnabled()
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 e)
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 mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class AbstractTool
public void draw(java.awt.Graphics2D g)
Tool
draw
in interface Tool
draw
in class AbstractTool
public void mousePressed(java.awt.event.MouseEvent evt)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class AbstractTool
protected void setTracker(Tool newTracker)
protected Tool createHandleTracker(Handle handle)
protected Tool createDragTracker(Figure f)
protected Tool createAreaTracker()
public void toolStarted(ToolEvent event)
ToolListener
toolStarted
in interface ToolListener
public void toolDone(ToolEvent event)
ToolListener
toolDone
in interface ToolListener
public void areaInvalidated(ToolEvent e)
areaInvalidated
in interface ToolListener
|
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |