Skip to content

Instantly share code, notes, and snippets.

Created February 22, 2013 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5010382 to your computer and use it in GitHub Desktop.
Save anonymous/5010382 to your computer and use it in GitHub Desktop.
package shapes;
import interfaces.ComparableShape;
import java.awt.Color;
import java.awt.Graphics;
public abstract class Shape implements ComparableShape{
private int x, y;
private Color lineColor;
//public abstract double getArea();
public Shape(int x, int y, Color lineColor) {
this.x = x;
this.y = y;
this.lineColor = lineColor;
}
public abstract void draw(Graphics g);
public abstract boolean containsLocation(int x, int y);
public int getX() {
return x;
}
public void setX(int x) {
this.x = x;
}
public int getY() {
return y;
}
public void setY(int y) {
this.y = y;
}
public Color getLineColor() {
return lineColor;
}
public void setLineColor(Color lineColor) {
this.lineColor = lineColor;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment