Class ODGBezierFigure

  extended by org.jhotdraw.beans.AbstractBean
      extended by org.jhotdraw.draw.AbstractFigure
          extended by org.jhotdraw.draw.AbstractAttributedFigure
              extended by org.jhotdraw.draw.BezierFigure
                  extended by org.jhotdraw.samples.odg.figures.ODGBezierFigure
All Implemented Interfaces:, java.lang.Cloneable, Figure, DOMStorable

public class ODGBezierFigure
extends BezierFigure

ODGBezierFigure is not an actual ODG element, it is used by ODGPathFigure to represent a single BezierPath segment within an ODG path.

$Id: 575 2009-10-18 11:26:50Z rawcoder $
Werner Randelshofer
See Also:
Serialized Form

Field Summary
private  java.awt.geom.Rectangle2D.Double cachedDrawingArea
Fields inherited from class org.jhotdraw.draw.BezierFigure
Fields inherited from class org.jhotdraw.draw.AbstractFigure
changingDepth, listenerList
Fields inherited from class org.jhotdraw.beans.AbstractBean
Constructor Summary
          Creates a new instance.
ODGBezierFigure(boolean isClosed)
Method Summary
 java.util.Collection<Handle> createHandles(ODGPathFigure pathFigure, int detailLevel)
 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.
 void transform(java.awt.geom.AffineTransform tx)
          Transforms the shape of the Figure.
Methods inherited from class org.jhotdraw.draw.BezierFigure
addNode, addNode, canConnect, chop, clone, contains, createHandles, drawCaps, drawFill, drawStroke, findCompatibleConnector, findConnector, findNode, findSegment, getBezierPath, getBounds, getCappedPath, getCenter, getEndPoint, getNode, getNodeCount, getOutermostPoint, getPoint, getPoint, getPointOnPath, getStartPoint, getTransformRestoreData, isClosed, joinSegments, joinSegments, layout, read, readPoints, removeAllNodes, removeNode, restoreTransformTo, set, setBezierPath, setBounds, setClosed, setEndPoint, setNode, setPoint, setPoint, setStartPoint, splitSegment, splitSegment, validate, write, writePoints
Methods inherited from class org.jhotdraw.draw.AbstractAttributedFigure
applyAttributesTo, draw, drawText, get, getAttributeKey, getAttributes, getAttributesRestoreData, getStroke, getStrokeMiterLimitFactor, hasAttribute, isAttributeEnabled, readAttributes, removeAttribute, restoreAttributesTo, setAttributeEnabled, setAttributes, writeAttributes
Methods inherited from class org.jhotdraw.draw.AbstractFigure
addFigureListener, addNotify, basicClone, 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, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removeNotify, requestRemove, setBounds, setRemovable, setSelectable, setTransformable, setVisible, toString, willChange
Methods inherited from class org.jhotdraw.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail


private transient java.awt.geom.Rectangle2D.Double cachedDrawingArea
Constructor Detail


public ODGBezierFigure()
Creates a new instance.


public ODGBezierFigure(boolean isClosed)
Method Detail


public java.util.Collection<Handle> createHandles(ODGPathFigure pathFigure,
                                                  int detailLevel)


public boolean handleMouseClick(java.awt.geom.Point2D.Double p,
                                java.awt.event.MouseEvent evt,
                                DrawingView view)
Description copied from class: BezierFigure
Handles a mouse click.

Specified by:
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.
Returns true, if the event was consumed.


public void transform(java.awt.geom.AffineTransform tx)
Description copied from interface: Figure
Transforms the shape of the Figure. Transformations using double precision arithmethics are inherently lossy operations. Therefore it is recommended to use getTransformRestoreData() restoreTransformTo() to provide lossless undo/redo functionality.

This is a basic operation which does not fire events. Use the following code sequence, if you need event firing:


Specified by:
transform in interface Figure
transform in class BezierFigure
tx - The transformation.
See Also:
Figure.getTransformRestoreData(), Figure.restoreTransformTo(java.lang.Object)


public java.awt.geom.Rectangle2D.Double getDrawingArea()
Description copied from interface: Figure
Returns the drawing area of the figure as a Rectangle.

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.

Specified by:
getDrawingArea in interface Figure
getDrawingArea in class BezierFigure


public void flattenTransform()
Transforms all coords of the figure by the current TRANSFORM attribute and then sets the TRANSFORM attribute to null.


public void invalidate()
Description copied from class: AbstractFigure
Invalidates cached data of the Figure. This method must execute fast, because it can be called very often.

invalidate in class BezierFigure