40,44d39 < * the anchor point of the interaction < */ < private Point fAnchorPoint; < < /** 56,56c51,51 < * the prototypical figure that is used to create new figures. --- > * the prototypical figure that is used to create new figuresthe prototypical figure that is used to create new figures. 58,58c53,53 < private Figure fPrototype; --- > private Figure myPrototypeFigure; 66,66c61,61 < fPrototype = prototype; --- > setPrototypeFigure(prototype); 90a86,86 > super.mouseDown(e, x, y); 91,92d85 < setView((DrawingView)e.getSource()); < setAnchorPoint(new Point(x, y)); 94a89,89 > getAddedFigure().displayBox(new Point(getAnchorX(), getAnchorY()), new Point(getAnchorX(), getAnchorY())); 95,95d88 < getAddedFigure().displayBox(getAnchorPoint(), getAnchorPoint()); 102,102c96,96 < if (fPrototype == null) { --- > if (getPrototypeFigure() == null) { 105,105c99,99 < return (Figure) fPrototype.clone(); --- > return (Figure)getPrototypeFigure().clone(); 113,113c107,107 < getAddedFigure().displayBox(getAnchorPoint(), new Point(x,y)); --- > getAddedFigure().displayBox(new Point(getAnchorX(), getAnchorY()), new Point(x, y)); 142a137,156 > * As the name suggests this CreationTool uses the Prototype design pattern. > * Thus, the prototype figure which is used to create new figures of the same > * type by cloning the original prototype figure. > * @param newPrototypeFigure figure to be cloned to create new figures > */ > protected void setPrototypeFigure(Figure newPrototypeFigure) { > myPrototypeFigure = newPrototypeFigure; > } > > /** > * As the name suggests this CreationTool uses the Prototype design pattern. > * Thus, the prototype figure which is used to create new figures of the same > * type by cloning the original prototype figure. > * @return figure to be cloned to create new figures > */ > protected Figure getPrototypeFigure() { > return myPrototypeFigure; > } > > /** 177,197d190 < < /** < * The anchor point is usually the first mouse click performed with this tool. < * < * @return the anchor point for the interaction < * @see #mouseDown < */ < protected Point getAnchorPoint() { < // SF bug-report id: #490752 < return fAnchorPoint; < } < < < /** < * Sets the anchorPoint attribute of the CreationTool object < * < * @param newAnchorPoint The new anchorPoint value < */ < protected void setAnchorPoint(Point newAnchorPoint) { < fAnchorPoint = newAnchorPoint; < }