|
JHotDraw 7.5.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jhotdraw.beans.AbstractBean
org.jhotdraw.draw.AbstractFigure
org.jhotdraw.draw.AbstractCompositeFigure
org.jhotdraw.draw.AbstractAttributedCompositeFigure
public abstract class AbstractAttributedCompositeFigure
This abstract class can be extended to implement a CompositeFigure
which has its own attribute set.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.jhotdraw.draw.AbstractCompositeFigure |
---|
AbstractCompositeFigure.EventHandler |
Field Summary |
---|
Fields inherited from class org.jhotdraw.draw.AbstractCompositeFigure |
---|
cachedBounds, cachedDrawingArea, children, eventHandler, layouter |
Fields inherited from class org.jhotdraw.draw.AbstractFigure |
---|
changingDepth, listenerList |
Fields inherited from class org.jhotdraw.beans.AbstractBean |
---|
propertySupport |
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 | |
---|---|
AbstractAttributedCompositeFigure()
Creates a new instance. |
Method Summary | ||
---|---|---|
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)
|
|
|
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)
|
|
|
removeAttribute(AttributeKey<T> key)
|
|
void |
restoreAttributesTo(java.lang.Object restoreData)
Restores the attributes of the figure to a previously stored state. |
|
|
set(AttributeKey<T> key,
T newValue)
Sets an attribute of the figure. |
|
void |
setAttributeEnabled(AttributeKey key,
boolean b)
|
|
protected
|
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)
|
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 |
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 |
---|
public AbstractAttributedCompositeFigure()
Method Detail |
---|
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()
Figure
getAttributes
in interface Figure
getAttributes
in class AbstractCompositeFigure
public <T> void set(AttributeKey<T> key, T newValue)
set
in interface Figure
set
in class AbstractCompositeFigure
AttributeKey.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 Figure
get
in class AbstractCompositeFigure
AttributeKey.get(org.jhotdraw.draw.Figure)
public java.lang.Object getAttributesRestoreData()
Figure
getAttributesRestoreData
in interface Figure
getAttributesRestoreData
in class AbstractCompositeFigure
public void restoreAttributesTo(java.lang.Object restoreData)
Figure
restoreAttributesTo
in interface Figure
restoreAttributesTo
in class AbstractCompositeFigure
public 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()
Figure
clone
in interface Figure
clone
in class AbstractCompositeFigure
protected void writeAttributes(DOMOutput out) throws java.io.IOException
java.io.IOException
protected void readAttributes(DOMInput in) throws java.io.IOException
java.io.IOException
protected AttributeKey getAttributeKey(java.lang.String name)
protected void applyAttributesTo(Figure that)
public void write(DOMOutput out) throws java.io.IOException
write
in interface DOMStorable
write
in class AbstractCompositeFigure
java.io.IOException
public void read(DOMInput in) throws java.io.IOException
read
in interface DOMStorable
read
in class AbstractCompositeFigure
java.io.IOException
public <T> void removeAttribute(AttributeKey<T> key)
public boolean hasAttribute(AttributeKey key)
|
Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |