com.rolemodelsoft.drawlet.basics
Class PrototypeConstructionTool

java.lang.Object
  |
  +--com.rolemodelsoft.drawlet.basics.AbstractInputEventHandler
        |
        +--com.rolemodelsoft.drawlet.basics.CanvasTool
              |
              +--com.rolemodelsoft.drawlet.basics.ConstructionTool
                    |
                    +--com.rolemodelsoft.drawlet.basics.PrototypeConstructionTool

public class PrototypeConstructionTool
extends ConstructionTool

This tool create new Figures based on a prototypical Figure.


Field Summary
protected  Figure prototype
          The figure we duplicate to create new ones.
 
Fields inherited from class com.rolemodelsoft.drawlet.basics.ConstructionTool
figure
 
Fields inherited from class com.rolemodelsoft.drawlet.basics.CanvasTool
canvas
 
Constructor Summary
PrototypeConstructionTool(DrawingCanvas canvas, Figure prototype)
          Constructs and initializes a new instance of a tool which constructs new figures on a DrawingCanvas based on a prototypical figure
 
Method Summary
protected  Figure basicNewFigure(int x, int y)
          Create and answer a new Figure which is a duplicate of the prototype.
 
Methods inherited from class com.rolemodelsoft.drawlet.basics.ConstructionTool
mouseDragged, mousePressed, mouseReleased, newFigure, setProperties
 
Methods inherited from class com.rolemodelsoft.drawlet.basics.CanvasTool
getX, getY
 
Methods inherited from class com.rolemodelsoft.drawlet.basics.AbstractInputEventHandler
keyPressed, keyReleased, keyTyped, mouseClicked, mouseDoubleClicked, mouseEntered, mouseExited, mouseMoved, mouseSingleClicked
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

prototype

protected Figure prototype
The figure we duplicate to create new ones.
Constructor Detail

PrototypeConstructionTool

public PrototypeConstructionTool(DrawingCanvas canvas,
                                 Figure prototype)
Constructs and initializes a new instance of a tool which constructs new figures on a DrawingCanvas based on a prototypical figure
Parameters:
canvas - the canvas to which we add new figures.
prototype - the figure which we duplicate to create new ones.
Method Detail

basicNewFigure

protected Figure basicNewFigure(int x,
                                int y)
Create and answer a new Figure which is a duplicate of the prototype.
Overrides:
basicNewFigure in class ConstructionTool
Parameters:
x - the x coordinate
y - the y coordinate
Returns:
a new Figure which is a duplicate of the prototype