|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectCH.ifa.draw.standard.AbstractTool
CH.ifa.draw.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()
Field Summary |
---|
Fields inherited from class CH.ifa.draw.standard.AbstractTool |
---|
fAnchorX, fAnchorY, fView |
Constructor Summary | |
---|---|
protected |
CreationTool(DrawingView view)
Constructs a CreationTool without a prototype. |
|
CreationTool(DrawingView view,
Figure prototype)
Initializes a CreationTool with the given prototype. |
Method Summary | |
---|---|
void |
activate()
Sets the cross hair cursor. |
protected Figure |
createdFigure()
Gets the currently created figure |
protected Figure |
createFigure()
Creates a new figure by cloning the prototype. |
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 CH.ifa.draw.standard.AbstractTool |
---|
deactivate, drawing, editor, keyDown, mouseMove, view |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CreationTool(DrawingView view, Figure prototype)
protected CreationTool(DrawingView view)
Method Detail |
---|
public void activate()
activate
in interface Tool
activate
in class AbstractTool
public void mouseDown(java.awt.event.MouseEvent e, int x, int y)
mouseDown
in interface Tool
mouseDown
in class AbstractTool
protected Figure createFigure()
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()
protected Figure createdFigure()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |