All Packages Class Hierarchy This Package Previous Next Index
Class CH.ifa.draw.standard.CreationTool
java.lang.Object
|
+----CH.ifa.draw.standard.AbstractTool
|
+----CH.ifa.draw.standard.CreationTool
- public class CreationTool
- extends AbstractTool
A tool to create new figures. The figure to be
created is specified by a prototype.
Design Patterns
Prototype
CreationTool creates new figures by cloning a prototype.
- See Also:
- Figure, clone
-
CreationTool(DrawingView)
- Constructs a CreationTool without a prototype.
-
CreationTool(DrawingView, Figure)
- Initializes a CreationTool with the given prototype.
-
activate()
- Sets the cross hair cursor.
-
createdFigure()
- Gets the currently created figure
-
createFigure()
- Creates a new figure by cloning the prototype.
-
mouseDown(MouseEvent, int, int)
- Creates a new figure by cloning the prototype.
-
mouseDrag(MouseEvent, int, int)
- Adjusts the extent of the created figure
-
mouseUp(MouseEvent, int, int)
- Checks if the created figure is empty.
CreationTool
public CreationTool(DrawingView view,
Figure prototype)
- Initializes a CreationTool with the given prototype.
CreationTool
protected CreationTool(DrawingView view)
- Constructs a CreationTool without a prototype.
This is for subclassers overriding createFigure.
activate
public void activate()
- Sets the cross hair cursor.
- Overrides:
- activate in class AbstractTool
mouseDown
public void mouseDown(MouseEvent e,
int x,
int y)
- Creates a new figure by cloning the prototype.
- Overrides:
- mouseDown in class AbstractTool
createFigure
protected Figure createFigure()
- Creates a new figure by cloning the prototype.
mouseDrag
public void mouseDrag(MouseEvent e,
int x,
int y)
- Adjusts the extent of the created figure
- Overrides:
- mouseDrag in class AbstractTool
mouseUp
public void mouseUp(MouseEvent e,
int x,
int y)
- Checks if the created figure is empty. If it is, the figure
is removed from the drawing.
- Overrides:
- mouseUp in class AbstractTool
- See Also:
- isEmpty
createdFigure
protected Figure createdFigure()
- Gets the currently created figure
All Packages Class Hierarchy This Package Previous Next Index