package proj4; import java.awt.Color; import java.awt.Graphics; public abstract class ColoredShape { private int x; private int y; private Color color; private boolean filled = false; public ColoredShape(int x, int y, Color color) { this.x = x; this.y = y; this.color = color; } public int getX() { return x; } public int getY() { return y; } public void setX(int x) { this.x = x; } public void setY(int y) { this.y = y; } public Color getColor() { return color; } public void setColor(Color c) { color = c; } public void setFilled(boolean f) { filled = f; } public boolean isFilled() { return filled; } public String toString() { return "x="+x+", y="+y+", filled="+filled + ", color="+color; } public abstract void draw(Graphics g); public abstract boolean inside(int x, int y); }