public class BezierTool extends AbstractTool
Tool
which allows to create a new BezierFigure
by
drawing its path.Modifier and Type | Field and Description |
---|---|
protected java.util.Map<AttributeKey,java.lang.Object> |
attributes |
protected BezierFigure |
createdFigure
The created figure.
|
anchor, editor, isWorking, listenerList
propertySupport
Constructor and Description |
---|
BezierTool(BezierFigure prototype)
Creates a new instance.
|
BezierTool(BezierFigure prototype,
java.util.Map<AttributeKey,java.lang.Object> attributes)
Creates a new instance.
|
BezierTool(BezierFigure prototype,
java.util.Map<AttributeKey,java.lang.Object> attributes,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
void |
activate(DrawingEditor editor)
Activates the tool for the given editor.
|
protected void |
addPointToFigure(java.awt.geom.Point2D.Double newPoint) |
protected BezierPath |
calculateFittedCurve(BezierPath path) |
protected BezierFigure |
createFigure() |
void |
deactivate(DrawingEditor editor)
Deactivates the tool.
|
void |
draw(java.awt.Graphics2D g)
Draws the tool.
|
protected void |
finishCreation(BezierFigure createdFigure,
DrawingView creationView) |
protected void |
fireUndoEvent(Figure createdFigure,
DrawingView creationView) |
protected Figure |
getAddedFigure() |
protected Figure |
getCreatedFigure() |
java.lang.String |
getPresentationName() |
boolean |
isToolDoneAfterCreation() |
void |
mouseClicked(java.awt.event.MouseEvent evt) |
void |
mouseDragged(java.awt.event.MouseEvent evt) |
void |
mouseMoved(java.awt.event.MouseEvent evt) |
void |
mousePressed(java.awt.event.MouseEvent evt) |
void |
mouseReleased(java.awt.event.MouseEvent evt) |
void |
setToolDoneAfterCreation(boolean b) |
addToolListener, addUndoableEditListener, constrainPoint, constrainPoint, createActionMap, createInputMap, editCopy, editCut, editDelete, editDuplicate, editPaste, fireAreaInvalidated, fireAreaInvalidated, fireBoundsInvalidated, fireToolDone, fireToolStarted, getActionMap, getDrawing, getEditor, getInputMap, getToolTipText, getView, isActive, keyPressed, keyReleased, keyTyped, maybeFireBoundsInvalidated, mouseEntered, mouseExited, removeToolListener, removeUndoableEditListener, setActionMap, setInputMap, supportsHandleInteraction, updateCursor, viewToDrawing
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
protected java.util.Map<AttributeKey,java.lang.Object> attributes
protected BezierFigure createdFigure
public BezierTool(BezierFigure prototype)
public BezierTool(BezierFigure prototype, java.util.Map<AttributeKey,java.lang.Object> attributes)
public BezierTool(BezierFigure prototype, java.util.Map<AttributeKey,java.lang.Object> attributes, java.lang.String name)
public java.lang.String getPresentationName()
public void activate(DrawingEditor editor)
Tool
activate
in interface Tool
activate
in class AbstractTool
public void deactivate(DrawingEditor editor)
Tool
deactivate
in interface Tool
deactivate
in class AbstractTool
public void mousePressed(java.awt.event.MouseEvent evt)
mousePressed
in interface java.awt.event.MouseListener
mousePressed
in class AbstractTool
protected BezierFigure createFigure()
protected Figure getCreatedFigure()
protected Figure getAddedFigure()
protected void addPointToFigure(java.awt.geom.Point2D.Double newPoint)
public void mouseClicked(java.awt.event.MouseEvent evt)
mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class AbstractTool
protected void fireUndoEvent(Figure createdFigure, DrawingView creationView)
public void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased
in interface java.awt.event.MouseListener
mouseReleased
in class AbstractTool
protected void finishCreation(BezierFigure createdFigure, DrawingView creationView)
public void mouseDragged(java.awt.event.MouseEvent evt)
public void draw(java.awt.Graphics2D g)
Tool
draw
in interface Tool
draw
in class AbstractTool
public void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved
in interface java.awt.event.MouseMotionListener
mouseMoved
in class AbstractTool
protected BezierPath calculateFittedCurve(BezierPath path)
public void setToolDoneAfterCreation(boolean b)
public boolean isToolDoneAfterCreation()