|
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
public abstract class AbstractTool
AbstractTool.
Field Summary | |
---|---|
protected java.awt.Point |
anchor
|
protected DrawingEditor |
editor
|
protected boolean |
isWorking
This is set to true, while the tool is doing some work. |
protected javax.swing.event.EventListenerList |
listenerList
|
Fields inherited from class org.jhotdraw.beans.AbstractBean |
---|
propertySupport |
Constructor Summary | |
---|---|
AbstractTool()
Creates a new instance. |
Method Summary | |
---|---|
void |
activate(DrawingEditor editor)
Activates the tool for the given editor. |
void |
addToolListener(ToolListener l)
Adds a listener for this tool. |
void |
addUndoableEditListener(javax.swing.event.UndoableEditListener l)
|
protected java.awt.geom.Point2D.Double |
constrainPoint(java.awt.Point p)
|
protected java.awt.geom.Point2D.Double |
constrainPoint(java.awt.geom.Point2D.Double p)
|
protected javax.swing.ActionMap |
createActionMap()
|
protected javax.swing.InputMap |
createInputMap()
|
void |
deactivate(DrawingEditor editor)
Deactivates the tool. |
void |
draw(java.awt.Graphics2D g)
Draws the tool. |
void |
editCopy()
Copies the selection into the clipboard. |
void |
editCut()
Cuts the selection into the clipboard. |
void |
editDelete()
Deletes the selection. |
void |
editDuplicate()
Duplicates the selection. |
void |
editPaste()
Pastes the contents of the clipboard. |
protected void |
fireAreaInvalidated(java.awt.Rectangle invalidatedArea)
Notify all listenerList that have registered interest for notification on this event type. |
protected void |
fireAreaInvalidated(java.awt.geom.Rectangle2D.Double r)
Notify all listenerList that have registered interest for notification on this event type. |
protected void |
fireToolDone()
Notify all listenerList that have registered interest for notification on this event type. |
protected void |
fireToolStarted(DrawingView view)
Notify all listenerList that have registered interest for notification on this event type. |
javax.swing.ActionMap |
getActionMap()
Gets the action map of the Tool |
protected Drawing |
getDrawing()
|
protected DrawingEditor |
getEditor()
|
javax.swing.InputMap |
getInputMap()
Gets the input map of the Tool |
protected DrawingView |
getView()
|
boolean |
isActive()
|
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 |
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 |
removeToolListener(ToolListener l)
Removes a listener for this tool. |
void |
removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
|
void |
setActionMap(javax.swing.ActionMap newValue)
Sets the ActionMap for the Tool. |
void |
setInputMap(javax.swing.InputMap newValue)
Sets the InputMap for the Tool. |
void |
updateCursor(DrawingView view,
java.awt.Point p)
|
protected java.awt.geom.Point2D.Double |
viewToDrawing(java.awt.Point p)
|
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 |
Methods inherited from interface java.awt.event.MouseMotionListener |
---|
mouseDragged |
Field Detail |
---|
protected boolean isWorking
protected DrawingEditor editor
protected java.awt.Point anchor
protected javax.swing.event.EventListenerList listenerList
Constructor Detail |
---|
public AbstractTool()
Method Detail |
---|
public void addUndoableEditListener(javax.swing.event.UndoableEditListener l)
public void removeUndoableEditListener(javax.swing.event.UndoableEditListener l)
public void activate(DrawingEditor editor)
Tool
activate
in interface Tool
public void deactivate(DrawingEditor editor)
Tool
deactivate
in interface Tool
public boolean isActive()
protected DrawingView getView()
protected DrawingEditor getEditor()
protected Drawing getDrawing()
protected java.awt.geom.Point2D.Double viewToDrawing(java.awt.Point p)
protected java.awt.geom.Point2D.Double constrainPoint(java.awt.Point p)
protected java.awt.geom.Point2D.Double constrainPoint(java.awt.geom.Point2D.Double p)
public void setInputMap(javax.swing.InputMap newValue)
keyPressed(java.awt.event.KeyEvent)
,
setActionMap(javax.swing.ActionMap)
public javax.swing.InputMap getInputMap()
public void setActionMap(javax.swing.ActionMap newValue)
keyPressed(java.awt.event.KeyEvent)
public javax.swing.ActionMap getActionMap()
public void editDelete()
editDelete
in interface Tool
public void editCut()
editCut
in interface Tool
public void editCopy()
editCopy
in interface Tool
public void editDuplicate()
editDuplicate
in interface Tool
public void editPaste()
editPaste
in interface Tool
public void keyReleased(java.awt.event.KeyEvent evt)
keyReleased
in interface java.awt.event.KeyListener
public void keyTyped(java.awt.event.KeyEvent evt)
keyTyped
in interface java.awt.event.KeyListener
public void keyPressed(java.awt.event.KeyEvent evt)
keyPressed
in interface java.awt.event.KeyListener
protected javax.swing.InputMap createInputMap()
protected javax.swing.ActionMap createActionMap()
public void mouseClicked(java.awt.event.MouseEvent evt)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent evt)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent evt)
mouseExited
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mousePressed(java.awt.event.MouseEvent evt)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased
in interface java.awt.event.MouseListener
public void addToolListener(ToolListener l)
Tool
addToolListener
in interface Tool
public void removeToolListener(ToolListener l)
Tool
removeToolListener
in interface Tool
protected void fireToolStarted(DrawingView view)
protected void fireToolDone()
protected void fireAreaInvalidated(java.awt.geom.Rectangle2D.Double r)
protected void fireAreaInvalidated(java.awt.Rectangle invalidatedArea)
public void draw(java.awt.Graphics2D g)
Tool
draw
in interface Tool
public void updateCursor(DrawingView view, java.awt.Point p)
|
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 |