Pixel.java (633B)
1 class Pixel extends Point { 2 int color; 3 static int n = 0; 4 5 Pixel() { 6 super(0.0, 0.0f); 7 this.color = 0x000000; 8 n++; 9 } 10 11 Pixel(double x, double y, int color) { 12 super(x, y); 13 this.color = color; 14 n++; 15 } 16 17 Pixel(Point p, int color) { 18 super(p); 19 this.color = color; 20 n++; 21 } 22 23 public String toString() { 24 return "x: " + x + "\ty: " + y + "\tcolor: " + 25 String.format("0x%06X", color); 26 } 27 }