|
JHotDraw 7.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.AbstractAttributedFigure
public abstract class AbstractAttributedFigure
A figure that can keep track of an open ended set of attributes.
Field Summary |
---|
Fields inherited from class org.jhotdraw.draw.AbstractFigure |
---|
changingDepth, listenerList |
Fields inherited from class org.jhotdraw.beans.AbstractBean |
---|
propertySupport |
Constructor Summary | |
---|---|
AbstractAttributedFigure()
Creates a new instance. |
Method Summary | |
---|---|
protected void |
applyAttributesTo(Figure that)
Applies all attributes of this figure to that figure. |
AbstractAttributedFigure |
clone()
Returns a clone of the figure, with clones of all aggregated figures, such as chilrend and decorators. |
void |
draw(java.awt.Graphics2D g)
Draws the figure. |
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)
|
java.lang.Object |
getAttribute(AttributeKey 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 setAttribute has been applied to it. |
java.awt.geom.Rectangle2D.Double |
getDrawingArea()
Returns the drawing area of the figure as a Rectangle. |
java.awt.Stroke |
getStroke()
|
double |
getStrokeMiterLimitFactor()
|
boolean |
hasAttribute(AttributeKey key)
|
boolean |
isAttributeEnabled(AttributeKey key)
|
void |
read(DOMInput in)
|
protected void |
readAttributes(DOMInput in)
|
void |
removeAttribute(AttributeKey key)
|
void |
restoreAttributesTo(java.lang.Object restoreData)
Restores the attributes of the figure to a previously stored state. |
void |
setAttribute(AttributeKey key,
java.lang.Object newValue)
Sets an attribute of the figure. |
void |
setAttributeEnabled(AttributeKey key,
boolean b)
|
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, 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 |
---|
contains, getBounds, getTransformRestoreData, restoreTransformTo, transform |
Constructor Detail |
---|
public AbstractAttributedFigure()
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
public java.lang.Object getAttributesRestoreData()
Figure
public void restoreAttributesTo(java.lang.Object restoreData)
Figure
public void setAttribute(AttributeKey key, java.lang.Object newValue)
AttributeKey.set(org.jhotdraw.draw.Figure, T)
public java.lang.Object getAttribute(AttributeKey key)
AttributeKey.get(org.jhotdraw.draw.Figure)
public void draw(java.awt.Graphics2D g)
Figure
g
- The Graphics2D to draw to.public java.awt.Stroke getStroke()
public double getStrokeMiterLimitFactor()
public java.awt.geom.Rectangle2D.Double getDrawingArea()
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.
protected abstract void drawFill(java.awt.Graphics2D g)
protected abstract void drawStroke(java.awt.Graphics2D g)
protected void drawText(java.awt.Graphics2D g)
public AbstractAttributedFigure clone()
Figure
clone
in interface Figure
clone
in class AbstractFigure
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
java.io.IOException
public void read(DOMInput in) throws java.io.IOException
java.io.IOException
public void removeAttribute(AttributeKey key)
public boolean hasAttribute(AttributeKey key)
|
Copyright 1996-2007 (c) JHotDraw.org. Some rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |