Site hosted by Angelfire.com: Build your free website today!
 

The Element Implementation classes

Since the implmentation classes extends the BaseGraphicElem abstract class, there is no change to the implementation classes:

package graphicalobject.impl;

import graphicalobject.BaseGraphicElem;

public class Rectangle extends BaseGraphicElem {
    private int width;
    private int height;
    public Rectangle(int w, int h) {
        width = w;
        height = h;
    }
    public void display() {
        super.display();
        System.out.println(", width=" + width + ", height=" + height);
    }

}