public class SVGBezierFigure extends BezierFigure
path
changingDepth, listenerList
propertySupport
CONNECTABLE_PROPERTY, REMOVABLE_PROPERTY, SELECTABLE_PROPERTY, TRANSFORMABLE_PROPERTY
Constructor and Description |
---|
SVGBezierFigure()
Creates a new instance.
|
SVGBezierFigure(boolean isClosed) |
Modifier and Type | Method and Description |
---|---|
java.util.Collection<Handle> |
createHandles(SVGPathFigure pathFigure,
int detailLevel) |
int |
findSegment(java.awt.geom.Point2D.Double find,
double tolerance)
Gets the segment of the polyline that is hit by
the given Point2D.Double.
|
void |
flattenTransform()
Transforms all coords of the figure by the current TRANSFORM attribute
and then sets the TRANSFORM attribute to null.
|
java.awt.geom.Rectangle2D.Double |
getDrawingArea()
Returns the drawing area of the figure as a Rectangle.
|
boolean |
handleMouseClick(java.awt.geom.Point2D.Double p,
java.awt.event.MouseEvent evt,
DrawingView view)
Handles a mouse click.
|
void |
invalidate()
Invalidates cached data of the Figure.
|
boolean |
joinSegments(java.awt.geom.Point2D.Double join,
double tolerance)
Joins two segments into one if the given Point2D.Double hits a node
of the polyline.
|
int |
splitSegment(java.awt.geom.Point2D.Double split,
double tolerance)
Splits the segment at the given Point2D.Double if a segment was hit.
|
void |
transform(java.awt.geom.AffineTransform tx)
Transforms the shape of the Figure.
|
addNode, addNode, chop, clone, contains, createHandles, drawCaps, drawFill, drawStroke, findCompatibleConnector, findConnector, findNode, getBezierPath, getBounds, getCappedPath, getCenter, getEndPoint, getNode, getNodeCount, getOutermostPoint, getPoint, getPoint, getPointOnPath, getStartPoint, getTransformRestoreData, isClosed, joinSegments, layout, read, readPoints, removeAllNodes, removeNode, restoreTransformTo, set, setBezierPath, setBounds, setClosed, setEndPoint, setNode, setPoint, setPoint, setStartPoint, splitSegment, validate, write, writePoints
applyAttributesTo, draw, drawText, get, getAttributeKey, getAttributes, getAttributesRestoreData, getStroke, getStrokeMiterLimitFactor, hasAttribute, isAttributeEnabled, readAttributes, removeAttribute, restoreAttributesTo, setAttributeEnabled, setAttributes, writeAttributes
addFigureListener, addNotify, changed, findFigureInside, fireAreaInvalidated, fireAreaInvalidated, fireAreaInvalidated, fireAttributeChanged, fireFigureAdded, fireFigureChanged, fireFigureChanged, fireFigureChanged, fireFigureHandlesChanged, fireFigureRemoved, fireFigureRequestRemove, fireUndoableEditHappened, getActions, getChangingDepth, getConnectors, getCursor, getDecomposition, getDrawing, getFontRenderContext, getLayer, getLock, getPreferredSize, getTool, getToolTipText, handleDrop, includes, isChanging, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removeNotify, requestRemove, setBounds, setConnectable, setRemovable, setSelectable, setTransformable, setVisible, toString, willChange
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, removePropertyChangeListener
public SVGBezierFigure()
public SVGBezierFigure(boolean isClosed)
public java.util.Collection<Handle> createHandles(SVGPathFigure pathFigure, int detailLevel)
public boolean handleMouseClick(java.awt.geom.Point2D.Double p, java.awt.event.MouseEvent evt, DrawingView view)
BezierFigure
handleMouseClick
in interface Figure
handleMouseClick
in class BezierFigure
p
- The location of the mouse event.evt
- The mouse event.view
- The drawing view which is the source of the mouse event.public void transform(java.awt.geom.AffineTransform tx)
Figure
This is a basic operation which does not fire events. Use the following code sequence, if you need event firing:
figure.willChange(); figure.transform(...); figure.changed();
transform
in interface Figure
transform
in class BezierFigure
tx
- The transformation.Figure.getTransformRestoreData()
,
Figure.restoreTransformTo(java.lang.Object)
public java.awt.geom.Rectangle2D.Double getDrawingArea()
Figure
The drawing area is used to inform DrawingView
about the
area that is needed to draw this figure.
The drawing area needs to be large enough, to take line width, line caps and other decorations into account that exceed the bounds of the Figure.
getDrawingArea
in interface Figure
getDrawingArea
in class BezierFigure
public int findSegment(java.awt.geom.Point2D.Double find, double tolerance)
findSegment
in class BezierFigure
find
- a Point on the bezier pathtolerance
- a tolerance, tolerance should take into account
the line width, plus 2 divided by the zoom factor.public boolean joinSegments(java.awt.geom.Point2D.Double join, double tolerance)
joinSegments
in class BezierFigure
join
- a Point at a node on the bezier pathtolerance
- a tolerance, tolerance should take into account
the line width, plus 2 divided by the zoom factor.public int splitSegment(java.awt.geom.Point2D.Double split, double tolerance)
splitSegment
in class BezierFigure
split
- a Point on (or near) a segment of the bezier pathtolerance
- a tolerance, tolerance should take into account
the line width, plus 2 divided by the zoom factor.public void flattenTransform()
public void invalidate()
AbstractFigure
invalidate
in class BezierFigure