|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jhotdraw.beans.AbstractBean
org.jhotdraw.draw.AbstractTool
org.jhotdraw.draw.BezierTool
public class BezierTool
Tool to scribble a BezierFigure
| Field Summary | |
|---|---|
protected java.util.Map<AttributeKey,java.lang.Object> |
attributes
|
protected BezierFigure |
createdFigure
The created figure. |
private DrawingView |
creationView
Holds the view on which we are currently creating a figure. |
private static boolean |
DEBUG
Set this to true to turn on debugging output on System.out. |
private java.lang.Boolean |
finishWhenMouseReleased
|
private boolean |
isToolDoneAfterCreation
|
private java.awt.Point |
mouseLocation
|
private int |
nodeCountBeforeDrag
|
private java.lang.String |
presentationName
A localized name for this tool. |
private BezierFigure |
prototype
The prototype for new figures. |
| Fields inherited from class org.jhotdraw.draw.AbstractTool |
|---|
anchor, editor, isWorking, listenerList |
| Fields inherited from class org.jhotdraw.beans.AbstractBean |
|---|
propertySupport |
| Constructor Summary | |
|---|---|
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)
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class org.jhotdraw.beans.AbstractBean |
|---|
addPropertyChangeListener, addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final boolean DEBUG
private java.lang.Boolean finishWhenMouseReleased
protected java.util.Map<AttributeKey,java.lang.Object> attributes
private boolean isToolDoneAfterCreation
private BezierFigure prototype
protected BezierFigure createdFigure
private int nodeCountBeforeDrag
private java.lang.String presentationName
private java.awt.Point mouseLocation
private DrawingView creationView
| Constructor Detail |
|---|
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)
| Method Detail |
|---|
public java.lang.String getPresentationName()
public void activate(DrawingEditor editor)
Tool
activate in interface Toolactivate in class AbstractToolpublic void deactivate(DrawingEditor editor)
Tool
deactivate in interface Tooldeactivate in class AbstractToolpublic void mousePressed(java.awt.event.MouseEvent evt)
mousePressed in interface java.awt.event.MouseListenermousePressed in class AbstractToolprotected 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.MouseListenermouseClicked in class AbstractTool
protected void fireUndoEvent(Figure createdFigure,
DrawingView creationView)
public void mouseReleased(java.awt.event.MouseEvent evt)
mouseReleased in interface java.awt.event.MouseListenermouseReleased 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 Tooldraw in class AbstractToolpublic void mouseMoved(java.awt.event.MouseEvent evt)
mouseMoved in interface java.awt.event.MouseMotionListenermouseMoved in class AbstractToolprotected BezierPath calculateFittedCurve(BezierPath path)
public void setToolDoneAfterCreation(boolean b)
public boolean isToolDoneAfterCreation()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||