org.jhotdraw.draw
Class AbstractAttributedDecoratedFigure
- java.lang.Object
-
- org.jhotdraw.beans.AbstractBean
-
- org.jhotdraw.draw.AbstractFigure
-
- org.jhotdraw.draw.AbstractAttributedFigure
-
- org.jhotdraw.draw.AbstractAttributedDecoratedFigure
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, DecoratedFigure, Figure, DOMStorable
- Direct Known Subclasses:
- ImageFigure, TextAreaFigure, TextFigure
public abstract class AbstractAttributedDecoratedFigure extends AbstractAttributedFigure implements DecoratedFigure, DOMStorable
This abstract class can be extended to implement aDecoratedFigurewhich has an attribute set.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.jhotdraw.draw.Figure
CONNECTABLE_PROPERTY, REMOVABLE_PROPERTY, SELECTABLE_PROPERTY, TRANSFORMABLE_PROPERTY
-
-
Constructor Summary
Constructors Constructor and Description AbstractAttributedDecoratedFigure()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AbstractAttributedDecoratedFigureclone()Returns a clone of the figure, with clones of all aggregated figures, such as children and decorators.booleancontains(java.awt.geom.Point2D.Double p)Checks if a point is contained by the figure.voiddraw(java.awt.Graphics2D g)Draws the figure.FiguregetDecorator()Gets the decorator for this figure.java.awt.geom.Rectangle2D.DoublegetDrawingArea()Returns the drawing area of the figure as a Rectangle.voidread(DOMInput in)voidsetDecorator(Figure newValue)Sets a decorator Figure, for example a visual adornment to this Figure.voidwrite(DOMOutput out)-
Methods inherited from class org.jhotdraw.draw.AbstractAttributedFigure
get, getAttributes, getAttributesRestoreData, getStroke, getStrokeMiterLimitFactor, hasAttribute, isAttributeEnabled, removeAttribute, restoreAttributesTo, set, setAttributeEnabled, setAttributes
-
Methods inherited from class org.jhotdraw.draw.AbstractFigure
addFigureListener, addNotify, changed, createHandles, findCompatibleConnector, findConnector, findFigureInside, fireAreaInvalidated, fireFigureChanged, getActions, getConnectors, getCursor, getDecomposition, getEndPoint, getLayer, getPreferredSize, getStartPoint, getTool, getToolTipText, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removeNotify, requestRemove, setBounds, setBounds, setConnectable, setRemovable, setSelectable, setTransformable, setVisible, toString, willChange
-
Methods inherited from class org.jhotdraw.beans.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jhotdraw.draw.Figure
addFigureListener, addNotify, addPropertyChangeListener, changed, createHandles, findCompatibleConnector, findConnector, findFigureInside, get, getActions, getAttributes, getAttributesRestoreData, getBounds, getConnectors, getCursor, getDecomposition, getEndPoint, getLayer, getPreferredSize, getStartPoint, getTool, getToolTipText, getTransformRestoreData, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removeNotify, removePropertyChangeListener, requestRemove, restoreAttributesTo, restoreTransformTo, set, setBounds, transform, willChange
-
-
-
-
Method Detail
-
draw
public final void draw(java.awt.Graphics2D g)
Description copied from interface:FigureDraws the figure.- Specified by:
drawin interfaceFigure- Overrides:
drawin classAbstractAttributedFigure- Parameters:
g- The Graphics2D to draw to.
-
getDrawingArea
public final java.awt.geom.Rectangle2D.Double getDrawingArea()
Description copied from interface:FigureReturns the drawing area of the figure as a Rectangle.The drawing area is used to inform
DrawingViewabout 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:
getDrawingAreain interfaceFigure- Overrides:
getDrawingAreain classAbstractAttributedFigure
-
setDecorator
public void setDecorator(Figure newValue)
Description copied from interface:DecoratedFigureSets a decorator Figure, for example a visual adornment to this Figure. Set this to null, if no decorator is desired. The decorator uses the same logical bounds as this Figure plus AttributeKeys.DECORATOR_INSETS. The decorator does not handle events. The decorator is drawn when the figure is drawn.- Specified by:
setDecoratorin interfaceDecoratedFigure
-
getDecorator
public Figure getDecorator()
Description copied from interface:DecoratedFigureGets the decorator for this figure.- Specified by:
getDecoratorin interfaceDecoratedFigure
-
contains
public final boolean contains(java.awt.geom.Point2D.Double p)
Description copied from interface:FigureChecks if a point is contained by the figure.This is used for hit testing by Tool's.
-
read
public void read(DOMInput in) throws java.io.IOException
- Specified by:
readin interfaceDOMStorable- Overrides:
readin classAbstractAttributedFigure- Throws:
java.io.IOException
-
write
public void write(DOMOutput out) throws java.io.IOException
- Specified by:
writein interfaceDOMStorable- Overrides:
writein classAbstractAttributedFigure- Throws:
java.io.IOException
-
clone
public AbstractAttributedDecoratedFigure clone()
Description copied from interface:FigureReturns a clone of the figure, with clones of all aggregated figures, such as children and decorators. The cloned figure does not clone the list of FigureListeners from its original.- Specified by:
clonein interfaceFigure- Overrides:
clonein classAbstractAttributedFigure
-
-
DataMelt 3.0 © DataMelt by jWork.ORG