CH.ifa.draw.figures
Class AttributeFigure
- java.lang.Object
-
- CH.ifa.draw.standard.AbstractFigure
-
- CH.ifa.draw.figures.AttributeFigure
-
- Direct Known Subclasses:
- EllipseFigure, ImageFigure, PolygonFigure, RectangleFigure, RoundRectangleFigure, TextFigure
public abstract class AttributeFigure extends AbstractFigure
A figure that can keep track of an open ended set of attributes. The attributes are stored in a dictionary implemented by FigureAttributes.- See Also:
Figure,Handle,FigureAttributes, Serialized Form
-
-
Field Summary
-
Fields inherited from interface CH.ifa.draw.framework.Figure
POPUP_MENU
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddraw(java.awt.Graphics g)Draws the figure in the given graphics.java.lang.ObjectgetAttribute(java.lang.String name)Returns the named attribute or null if a a figure doesn't have an attribute.static java.lang.ObjectgetDefaultAttribute(java.lang.String name)Gets a the default value for a named attributejava.awt.ColorgetFillColor()Gets the fill color of a figure.java.awt.ColorgetFrameColor()Gets the frame color of a figure.voidread(StorableInput dr)Reads the Figure from a StorableInput.voidsetAttribute(java.lang.String name, java.lang.Object value)Sets the named attribute to the new valuevoidwrite(StorableOutput dw)Stores the Figure to a StorableOutput.-
Methods inherited from class CH.ifa.draw.standard.AbstractFigure
addFigureChangeListener, addToContainer, basicDisplayBox, canConnect, center, changed, clone, connectedTextLocator, connectionInsets, connectorAt, connectorVisibility, containsPoint, decompose, displayBox, displayBox, displayBox, figures, findFigureInside, handles, includes, invalidate, isEmpty, listener, moveBy, release, removeFigureChangeListener, removeFromContainer, size, willChange
-
-
-
-
Method Detail
-
draw
public void draw(java.awt.Graphics g)
Draws the figure in the given graphics. Draw is a template method calling drawBackground followed by drawFrame.- Parameters:
g- the Graphics to draw into
-
getFillColor
public java.awt.Color getFillColor()
Gets the fill color of a figure. This is a convenience method.- See Also:
getAttribute(java.lang.String)
-
getFrameColor
public java.awt.Color getFrameColor()
Gets the frame color of a figure. This is a convenience method.- See Also:
getAttribute(java.lang.String)
-
getDefaultAttribute
public static java.lang.Object getDefaultAttribute(java.lang.String name)
Gets a the default value for a named attribute- See Also:
getAttribute(java.lang.String)
-
getAttribute
public java.lang.Object getAttribute(java.lang.String name)
Returns the named attribute or null if a a figure doesn't have an attribute. All figures support the attribute names FillColor and FrameColor- Specified by:
getAttributein interfaceFigure- Overrides:
getAttributein classAbstractFigure
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)Sets the named attribute to the new value- Specified by:
setAttributein interfaceFigure- Overrides:
setAttributein classAbstractFigure
-
write
public void write(StorableOutput dw)
Stores the Figure to a StorableOutput.- Specified by:
writein interfaceStorable- Overrides:
writein classAbstractFigure
-
read
public void read(StorableInput dr) throws java.io.IOException
Reads the Figure from a StorableInput.- Specified by:
readin interfaceStorable- Overrides:
readin classAbstractFigure- Throws:
java.io.IOException
-
-
DataMelt 3.0 © DataMelt by jWork.ORG