-
Notifications
You must be signed in to change notification settings - Fork 0
/
ColoredPoint.java
39 lines (33 loc) · 877 Bytes
/
ColoredPoint.java
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
38
39
import java.awt.Color;
import java.awt.Point;
public class ColoredPoint {
private Point pointCoord;
private Color pointColor;
public ColoredPoint(Point pointCoord, Color pointColor) {
this.pointCoord = pointCoord;
this.pointColor= pointColor;
}
public Point getPointCoord() {
return pointCoord;
}
public double getXCoord() {
return pointCoord.getX();
}
public double getYCoord() {
return pointCoord.getY();
}
public Color getPointColor() {
return pointColor;
}
// public ColoredPoint getColoredPoint() {
// }
public void setPointCoord(Point pointCoord) {
this.pointCoord = pointCoord;
}
public void setPointColor(Color pointColor) {
this.pointColor = pointColor;
}
public String toString() {
return "Coordinates of point: " + getPointCoord() + "\nColor of point: " + getPointColor();
}
}