|
|||||||||
| 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.tool.AbstractTool
org.jhotdraw.draw.tool.DefaultSelectAreaTracker
public class DefaultSelectAreaTracker
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 Form| Field Summary | |
|---|---|
private Figure |
hoverFigure
The hover Figure is the figure, over which the mouse is currently hovering. |
private java.util.LinkedList<Handle> |
hoverHandles
The hover handles, are the handles of the figure over which the mouse pointer is currently hovering. |
private java.awt.Rectangle |
rubberband
The bounds of the rubberband. |
private java.awt.Color |
rubberbandColor
Rubberband color. |
private java.awt.Stroke |
rubberbandStroke
Rubberband stroke. |
| 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()
|
private void |
clearRubberBand()
|
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)
|
private void |
selectGroup(boolean toggle)
|
protected void |
updateHoverHandles(DrawingView view,
Figure f)
|
| 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 |
| Field Detail |
|---|
private java.awt.Rectangle rubberband
private java.awt.Color rubberbandColor
private java.awt.Stroke rubberbandStroke
private java.util.LinkedList<Handle> hoverHandles
private Figure hoverFigure
| Constructor Detail |
|---|
public DefaultSelectAreaTracker()
| Method Detail |
|---|
public void mousePressed(java.awt.event.MouseEvent evt)
mousePressed in interface java.awt.event.MouseListenermousePressed in class AbstractToolpublic void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased in interface java.awt.event.MouseListenermouseReleased in class AbstractToolpublic void mouseDragged(java.awt.event.MouseEvent evt)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class AbstractToolpublic void mouseExited(java.awt.event.MouseEvent evt)
mouseExited in interface java.awt.event.MouseListenermouseExited in class AbstractToolprivate void clearRubberBand()
public void draw(java.awt.Graphics2D g)
Tool
draw in interface Tooldraw in class AbstractToolprivate void selectGroup(boolean toggle)
protected void clearHoverHandles()
protected void updateHoverHandles(DrawingView view,
Figure f)
public void activate(DrawingEditor editor)
Tool
activate in interface Toolactivate in class AbstractToolpublic void deactivate(DrawingEditor editor)
Tool
deactivate in interface Tooldeactivate in class AbstractTool
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||