All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.ifa.draw.figures.AttributeFigure

java.lang.Object
   |
   +----CH.ifa.draw.standard.AbstractFigure
           |
           +----CH.ifa.draw.figures.AttributeFigure

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

Constructor Index

 o AttributeFigure()

Method Index

 o draw(Graphics)
Draws the figure in the given graphics.
 o drawBackground(Graphics)
Draws the background of the figure.
 o drawFrame(Graphics)
Draws the frame of the figure.
 o getAttribute(String)
Returns the named attribute or null if a a figure doesn't have an attribute.
 o getDefaultAttribute(String)
Gets a the default value for a named attribute
 o getFillColor()
Gets the fill color of a figure.
 o getFrameColor()
Gets the frame color of a figure.
 o read(StorableInput)
Reads the Figure from a StorableInput.
 o setAttribute(String, Object)
Sets the named attribute to the new value
 o write(StorableOutput)
Stores the Figure to a StorableOutput.

Constructors

 o AttributeFigure
 protected AttributeFigure()

Methods

 o draw
 public void draw(Graphics g)
Draws the figure in the given graphics. Draw is a template method calling drawBackground followed by drawFrame.

Overrides:
draw in class AbstractFigure
 o drawBackground
 protected void drawBackground(Graphics g)
Draws the background of the figure.

See Also:
draw
 o drawFrame
 protected void drawFrame(Graphics g)
Draws the frame of the figure.

See Also:
draw
 o getFillColor
 public Color getFillColor()
Gets the fill color of a figure. This is a convenience method.

See Also:
getAttribute
 o getFrameColor
 public Color getFrameColor()
Gets the frame color of a figure. This is a convenience method.

See Also:
getAttribute
 o getDefaultAttribute
 public static Object getDefaultAttribute(String name)
Gets a the default value for a named attribute

See Also:
getAttribute
 o getAttribute
 public Object getAttribute(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

Overrides:
getAttribute in class AbstractFigure
 o setAttribute
 public void setAttribute(String name,
                          Object value)
Sets the named attribute to the new value

Overrides:
setAttribute in class AbstractFigure
 o write
 public void write(StorableOutput dw)
Stores the Figure to a StorableOutput.

Overrides:
write in class AbstractFigure
 o read
 public void read(StorableInput dr) throws IOException
Reads the Figure from a StorableInput.

Overrides:
read in class AbstractFigure

All Packages  Class Hierarchy  This Package  Previous  Next  Index