CH.ifa.draw.standard
Class CreationTool
- java.lang.Object
-
- CH.ifa.draw.standard.AbstractTool
-
- CH.ifa.draw.standard.CreationTool
-
- All Implemented Interfaces:
- Tool
- Direct Known Subclasses:
- LayerFigureCreationTool, PertFigureCreationTool, TextTool
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,Object.clone()
-
-
Constructor Summary
Constructors Constructor and Description CreationTool(DrawingView view, Figure prototype)Initializes a CreationTool with the given prototype.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidactivate()Sets the cross hair cursor.voidmouseDown(java.awt.event.MouseEvent e, int x, int y)Creates a new figure by cloning the prototype.voidmouseDrag(java.awt.event.MouseEvent e, int x, int y)Adjusts the extent of the created figurevoidmouseUp(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
-
-
-
-
Constructor Detail
-
CreationTool
public CreationTool(DrawingView view, Figure prototype)
Initializes a CreationTool with the given prototype.
-
-
Method Detail
-
activate
public void activate()
Sets the cross hair cursor.- Specified by:
activatein interfaceTool- Overrides:
activatein classAbstractTool
-
mouseDown
public void mouseDown(java.awt.event.MouseEvent e, int x, int y)Creates a new figure by cloning the prototype.- Specified by:
mouseDownin interfaceTool- Overrides:
mouseDownin classAbstractTool
-
mouseDrag
public void mouseDrag(java.awt.event.MouseEvent e, int x, int y)Adjusts the extent of the created figure- Specified by:
mouseDragin interfaceTool- Overrides:
mouseDragin classAbstractTool
-
mouseUp
public void mouseUp(java.awt.event.MouseEvent e, int x, int y)Checks if the created figure is empty. If it is, the figure is removed from the drawing.- Specified by:
mouseUpin interfaceTool- Overrides:
mouseUpin classAbstractTool- See Also:
Figure.isEmpty()
-
-
DataMelt 3.0 © DataMelt by jWork.ORG