public abstract class AbstractAttributedCompositeFigure extends AbstractCompositeFigure
CompositeFigure
which has its own attribute set.AbstractCompositeFigure.EventHandlercachedBounds, cachedDrawingArea, children, eventHandler, layouterchangingDepth, listenerListpropertySupportLAYOUT_INSETSCONNECTABLE_PROPERTY, REMOVABLE_PROPERTY, SELECTABLE_PROPERTY, TRANSFORMABLE_PROPERTY| Constructor and Description |
|---|
AbstractAttributedCompositeFigure()
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
applyAttributesTo(Figure that)
Applies all attributes of this figure to that figure.
|
AbstractAttributedCompositeFigure |
clone()
Returns a clone of the figure, with clones of all aggregated figures,
such as children and decorators.
|
protected void |
drawChildren(java.awt.Graphics2D g) |
void |
drawFigure(java.awt.Graphics2D g) |
protected abstract void |
drawFill(java.awt.Graphics2D g)
This method is called by method draw() to draw the fill
area of the figure.
|
protected abstract void |
drawStroke(java.awt.Graphics2D g)
This method is called by method draw() to draw the text of the figure
.
|
protected void |
drawText(java.awt.Graphics2D g) |
<T> T |
get(AttributeKey<T> key)
Gets an attribute from the figure.
|
protected AttributeKey |
getAttributeKey(java.lang.String name) |
java.util.Map<AttributeKey,java.lang.Object> |
getAttributes()
Returns a view to all attributes of this figure.
|
java.lang.Object |
getAttributesRestoreData()
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.Double |
getFigureDrawBounds() |
java.awt.Stroke |
getStroke() |
double |
getStrokeMiterLimitFactor() |
boolean |
hasAttribute(AttributeKey key) |
boolean |
isAttributeEnabled(AttributeKey key) |
void |
read(DOMInput in) |
protected void |
readAttributes(DOMInput in) |
<T> void |
removeAttribute(AttributeKey<T> key) |
void |
restoreAttributesTo(java.lang.Object restoreData)
Restores the attributes of the figure to a previously stored state.
|
<T> void |
set(AttributeKey<T> key,
T newValue)
Sets an attribute of the figure.
|
void |
setAttributeEnabled(AttributeKey key,
boolean b) |
protected <T> void |
setAttributeOnChildren(AttributeKey<T> key,
T newValue) |
void |
setAttributes(java.util.Map<AttributeKey,java.lang.Object> map) |
void |
write(DOMOutput out) |
protected void |
writeAttributes(DOMOutput out) |
add, add, addAll, addAll, addCompositeFigureListener, addNotify, basicAdd, basicAdd, basicAddAll, basicRemove, basicRemoveAll, basicRemoveAllChildren, basicRemoveChild, bringToFront, changed, contains, contains, createEventHandler, createHandles, draw, findChild, findChildIndex, findFigureInside, fireFigureAdded, fireFigureRemoved, getBounds, getChild, getChildCount, getChildren, getChildrenFrontToBack, getDecomposition, getDrawingArea, getLayouter, getPreferredSize, getTransformRestoreData, indexOf, invalidate, layout, remove, removeAll, removeAllChildren, removeChild, removeCompositeFigureListener, removeNotify, restoreTransformTo, sendToBack, setBounds, setLayouter, transform, validate, willChangeaddFigureListener, findCompatibleConnector, findConnector, fireAreaInvalidated, fireAreaInvalidated, fireAreaInvalidated, fireAttributeChanged, fireFigureAdded, fireFigureChanged, fireFigureChanged, fireFigureChanged, fireFigureHandlesChanged, fireFigureRemoved, fireFigureRequestRemove, fireUndoableEditHappened, getActions, getChangingDepth, getConnectors, getCursor, getDrawing, getEndPoint, getFontRenderContext, getLayer, getLock, getStartPoint, getTool, getToolTipText, handleDrop, handleMouseClick, includes, isChanging, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, requestRemove, setBounds, setConnectable, setRemovable, setSelectable, setTransformable, setVisible, toStringaddPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddFigureListener, addPropertyChangeListener, findCompatibleConnector, findConnector, getActions, getConnectors, getCursor, getEndPoint, getLayer, getStartPoint, getTool, getToolTipText, handleDrop, handleMouseClick, includes, isConnectable, isRemovable, isSelectable, isTransformable, isVisible, remap, removeFigureListener, removePropertyChangeListener, requestRemovepublic AbstractAttributedCompositeFigure()
public void setAttributeEnabled(AttributeKey key, boolean b)
public boolean isAttributeEnabled(AttributeKey key)
public void setAttributes(java.util.Map<AttributeKey,java.lang.Object> map)
public java.util.Map<AttributeKey,java.lang.Object> getAttributes()
FiguregetAttributes in interface FiguregetAttributes in class AbstractCompositeFigurepublic <T> void set(AttributeKey<T> key, T newValue)
set in interface Figureset in class AbstractCompositeFigureAttributeKey.set(org.jhotdraw.draw.Figure, T)protected <T> void setAttributeOnChildren(AttributeKey<T> key, T newValue)
public <T> T get(AttributeKey<T> key)
get in interface Figureget in class AbstractCompositeFigureAttributeKey.get(org.jhotdraw.draw.Figure)public java.lang.Object getAttributesRestoreData()
FiguregetAttributesRestoreData in interface FiguregetAttributesRestoreData in class AbstractCompositeFigurepublic void restoreAttributesTo(java.lang.Object restoreData)
FigurerestoreAttributesTo in interface FigurerestoreAttributesTo in class AbstractCompositeFigurepublic void drawFigure(java.awt.Graphics2D g)
protected void drawChildren(java.awt.Graphics2D g)
public java.awt.Stroke getStroke()
public double getStrokeMiterLimitFactor()
public java.awt.geom.Rectangle2D.Double getFigureDrawBounds()
protected abstract void drawFill(java.awt.Graphics2D g)
protected abstract void drawStroke(java.awt.Graphics2D g)
protected void drawText(java.awt.Graphics2D g)
public AbstractAttributedCompositeFigure clone()
Figureclone in interface Figureclone in class AbstractCompositeFigureprotected void writeAttributes(DOMOutput out) throws java.io.IOException
java.io.IOExceptionprotected void readAttributes(DOMInput in) throws java.io.IOException
java.io.IOExceptionprotected AttributeKey getAttributeKey(java.lang.String name)
protected void applyAttributesTo(Figure that)
public void write(DOMOutput out) throws java.io.IOException
write in interface DOMStorablewrite in class AbstractCompositeFigurejava.io.IOExceptionpublic void read(DOMInput in) throws java.io.IOException
read in interface DOMStorableread in class AbstractCompositeFigurejava.io.IOExceptionpublic <T> void removeAttribute(AttributeKey<T> key)
public boolean hasAttribute(AttributeKey key)