org.jhotdraw.draw
Class AbstractAttributedCompositeFigure
- java.lang.Object
-
- org.jhotdraw.beans.AbstractBean
-
- org.jhotdraw.draw.AbstractFigure
-
- org.jhotdraw.draw.AbstractCompositeFigure
-
- org.jhotdraw.draw.AbstractAttributedCompositeFigure
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, CompositeFigure, Figure, DOMStorable
- Direct Known Subclasses:
- AbstractDrawing, ODGPathFigure, SVGPathFigure
public abstract class AbstractAttributedCompositeFigure extends AbstractCompositeFigure
This abstract class can be extended to implement aCompositeFigurewhich has its own attribute set.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.jhotdraw.draw.CompositeFigure
LAYOUT_INSETS
-
Fields inherited from interface org.jhotdraw.draw.Figure
CONNECTABLE_PROPERTY, REMOVABLE_PROPERTY, SELECTABLE_PROPERTY, TRANSFORMABLE_PROPERTY
-
-
Constructor Summary
Constructors Constructor and Description AbstractAttributedCompositeFigure()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description AbstractAttributedCompositeFigureclone()Returns a clone of the figure, with clones of all aggregated figures, such as children and decorators.voiddrawFigure(java.awt.Graphics2D g)<T> Tget(AttributeKey<T> key)Gets an attribute from the figure.java.util.Map<AttributeKey,java.lang.Object>getAttributes()Returns a view to all attributes of this figure.java.lang.ObjectgetAttributesRestoreData()Gets data which can be used to restore the attributes of the figure after a set has been applied to it.java.awt.geom.Rectangle2D.DoublegetFigureDrawBounds()java.awt.StrokegetStroke()doublegetStrokeMiterLimitFactor()booleanhasAttribute(AttributeKey key)booleanisAttributeEnabled(AttributeKey key)voidread(DOMInput in)<T> voidremoveAttribute(AttributeKey<T> key)voidrestoreAttributesTo(java.lang.Object restoreData)Restores the attributes of the figure to a previously stored state.<T> voidset(AttributeKey<T> key, T newValue)Sets an attribute of the figure.voidsetAttributeEnabled(AttributeKey key, boolean b)voidsetAttributes(java.util.Map<AttributeKey,java.lang.Object> map)voidwrite(DOMOutput out)-
Methods inherited from class org.jhotdraw.draw.AbstractCompositeFigure
add, add, addAll, addAll, addCompositeFigureListener, addNotify, basicAdd, basicAdd, basicAddAll, basicRemove, basicRemoveAll, basicRemoveAllChildren, basicRemoveChild, bringToFront, changed, contains, contains, createHandles, draw, findChild, findChildIndex, findFigureInside, getBounds, getChild, getChildCount, getChildren, getChildrenFrontToBack, getDecomposition, getDrawingArea, getLayouter, getPreferredSize, getTransformRestoreData, indexOf, layout, remove, removeAll, removeAllChildren, removeChild, removeCompositeFigureListener, removeNotify, restoreTransformTo, sendToBack, setBounds, setLayouter, transform, willChange
-
Methods inherited from class org.jhotdraw.draw.AbstractFigure
addFigureListener, findCompatibleConnector, findConnector, fireAreaInvalidated, fireFigureChanged, getActions, getConnectors, getCursor, getEndPoint, getLayer, getStartPoint, getTool, getToolTipText, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, requestRemove, setBounds, setConnectable, setRemovable, setSelectable, setTransformable, setVisible, toString
-
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, addPropertyChangeListener, findCompatibleConnector, findConnector, getActions, getConnectors, getCursor, getEndPoint, getLayer, getStartPoint, getTool, getToolTipText, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removePropertyChangeListener, requestRemove
-
-
-
-
Constructor Detail
-
AbstractAttributedCompositeFigure
public AbstractAttributedCompositeFigure()
Creates a new instance.
-
-
Method Detail
-
setAttributeEnabled
public void setAttributeEnabled(AttributeKey key, boolean b)
-
isAttributeEnabled
public boolean isAttributeEnabled(AttributeKey key)
-
setAttributes
public void setAttributes(java.util.Map<AttributeKey,java.lang.Object> map)
-
getAttributes
public java.util.Map<AttributeKey,java.lang.Object> getAttributes()
Description copied from interface:FigureReturns a view to all attributes of this figure. By convention, an unmodifiable map is returned.- Specified by:
getAttributesin interfaceFigure- Overrides:
getAttributesin classAbstractCompositeFigure
-
set
public <T> void set(AttributeKey<T> key, T newValue)
Sets an attribute of the figure. AttributeKey name and semantics are defined by the class implementing the figure interface.- Specified by:
setin interfaceFigure- Overrides:
setin classAbstractCompositeFigure- See Also:
AttributeKey.set(org.jhotdraw.draw.Figure, T)
-
get
public <T> T get(AttributeKey<T> key)
Gets an attribute from the figure.- Specified by:
getin interfaceFigure- Overrides:
getin classAbstractCompositeFigure- Returns:
- Returns the attribute value. If the Figure does not have an attribute with the specified key, returns key.getDefaultValue().
- See Also:
AttributeKey.get(org.jhotdraw.draw.Figure)
-
getAttributesRestoreData
public java.lang.Object getAttributesRestoreData()
Description copied from interface:FigureGets data which can be used to restore the attributes of the figure after a set has been applied to it.- Specified by:
getAttributesRestoreDatain interfaceFigure- Overrides:
getAttributesRestoreDatain classAbstractCompositeFigure
-
restoreAttributesTo
public void restoreAttributesTo(java.lang.Object restoreData)
Description copied from interface:FigureRestores the attributes of the figure to a previously stored state.- Specified by:
restoreAttributesToin interfaceFigure- Overrides:
restoreAttributesToin classAbstractCompositeFigure
-
drawFigure
public void drawFigure(java.awt.Graphics2D g)
-
getStroke
public java.awt.Stroke getStroke()
-
getStrokeMiterLimitFactor
public double getStrokeMiterLimitFactor()
-
getFigureDrawBounds
public java.awt.geom.Rectangle2D.Double getFigureDrawBounds()
-
clone
public AbstractAttributedCompositeFigure 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 classAbstractCompositeFigure
-
write
public void write(DOMOutput out) throws java.io.IOException
- Specified by:
writein interfaceDOMStorable- Overrides:
writein classAbstractCompositeFigure- Throws:
java.io.IOException
-
read
public void read(DOMInput in) throws java.io.IOException
- Specified by:
readin interfaceDOMStorable- Overrides:
readin classAbstractCompositeFigure- Throws:
java.io.IOException
-
removeAttribute
public <T> void removeAttribute(AttributeKey<T> key)
-
hasAttribute
public boolean hasAttribute(AttributeKey key)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG