fi.utu.cs.appearance
Class ShapeAdapter

java.lang.Object
  |
  +--fi.utu.cs.appearance.ShapeAdapter
All Implemented Interfaces:
Shapable

public abstract class ShapeAdapter
extends java.lang.Object
implements Shapable

An abstract adapter class for defining shapable objects that can be displayed in the Graphics2D context. The methods in this class either return false or null. This class exists as convenience for creating Shapable objects. Extend this class to create a Shapable object and override the methods of interest.

Since:
1.1
See Also:
Shapable

Constructor Summary
ShapeAdapter()
           
 
Method Summary
 java.awt.Color color()
          Returns a Color object that is used for drawing the outline.
 boolean isDrawn()
          Returns a boolean value indicating whether the outline of the shape is drawn or not.
 boolean isFilled()
          Returns a boolean value indicating whether the shape is filled or not.
 java.awt.Paint paint()
          Returns a Paint object that is used for filling the shape.
 java.awt.Shape shape()
          Returns a Shape object that defines the appearance of the object.
 java.awt.Stroke stroke()
          Returns a Stroke object that is used for drawing the outline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShapeAdapter

public ShapeAdapter()
Method Detail

shape

public java.awt.Shape shape()
Returns a Shape object that defines the appearance of the object.

Specified by:
shape in interface Shapable
See Also:
Shape

isDrawn

public boolean isDrawn()
Returns a boolean value indicating whether the outline of the shape is drawn or not.

Specified by:
isDrawn in interface Shapable
See Also:
stroke(), color()

stroke

public java.awt.Stroke stroke()
Returns a Stroke object that is used for drawing the outline.

Specified by:
stroke in interface Shapable
See Also:
isDrawn()

color

public java.awt.Color color()
Returns a Color object that is used for drawing the outline.

Specified by:
color in interface Shapable
See Also:
isDrawn()

isFilled

public boolean isFilled()
Returns a boolean value indicating whether the shape is filled or not.

Specified by:
isFilled in interface Shapable
See Also:
paint()

paint

public java.awt.Paint paint()
Returns a Paint object that is used for filling the shape.

Specified by:
paint in interface Shapable
See Also:
isFilled()