-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShape.java
More file actions
37 lines (31 loc) · 767 Bytes
/
Shape.java
File metadata and controls
37 lines (31 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.awt.Color;
import java.awt.Graphics;
/**
* A geometric entity with a color
*
* @author Chris Bailey-Kellogg, Dartmouth CS 10, Spring 2016, based on a related concept from previous terms
* @author CBK, revised Fall 2016
* @author Tim Pierson Dartmouth CS 10, provided for Winter 2025
*/
public interface Shape {
/**
* Moves the shape by dx in the x coordinate and dy in the y coordinate
*/
public void moveBy(int dx, int dy);
/**
* Whether or not the point is inside the shape
*/
public boolean contains(int x, int y);
/**
* @return The shape's color
*/
public Color getColor();
/**
* @param color The shape's color
*/
public void setColor(Color color);
/**
* Draws the shape
*/
public void draw(Graphics g);
}