|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.standard.AbstractTool
org.jhotdraw.standard.CreationTool
public class CreationTool
A tool to create new figures. The figure to be created is specified by a prototype.
Prototype
CreationTool creates new figures by cloning a prototype.
Figure
,
Object.clone()
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jhotdraw.standard.AbstractTool |
---|
AbstractTool.EventDispatcher |
Constructor Summary | |
---|---|
CreationTool(DrawingEditor newDrawingEditor,
Figure prototype)
Initializes a CreationTool with the given prototype. |
Method Summary | |
---|---|
void |
activate()
Sets the cross hair cursor. |
void |
deactivate()
Deactivates the tool. |
void |
mouseDown(java.awt.event.MouseEvent e,
int x,
int y)
Creates a new figure by cloning the prototype. |
void |
mouseDrag(java.awt.event.MouseEvent e,
int x,
int y)
Adjusts the extent of the created figure |
void |
mouseUp(java.awt.event.MouseEvent e,
int x,
int y)
Checks if the created figure is empty. |
Methods inherited from class org.jhotdraw.standard.AbstractTool |
---|
addToolListener, drawing, editor, getActiveDrawing, getActiveView, getUndoActivity, isActive, isEnabled, isUsable, keyDown, mouseMove, removeToolListener, setEnabled, setUndoActivity, setUsable, view |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CreationTool(DrawingEditor newDrawingEditor, Figure prototype)
Method Detail |
---|
public void activate()
activate
in interface Tool
activate
in class AbstractTool
public void deactivate()
AbstractTool
deactivate
in interface Tool
deactivate
in class AbstractTool
Tool.deactivate()
public void mouseDown(java.awt.event.MouseEvent e, int x, int y)
mouseDown
in interface Tool
mouseDown
in class AbstractTool
public void mouseDrag(java.awt.event.MouseEvent e, int x, int y)
mouseDrag
in interface Tool
mouseDrag
in class AbstractTool
public void mouseUp(java.awt.event.MouseEvent e, int x, int y)
mouseUp
in interface Tool
mouseUp
in class AbstractTool
Figure.isEmpty()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |