01: //Plik: 03_DziedziczKonstr/Pixel.java 02: 03: import java.awt.Color; 04: 05: public class Pixel extends Point { 06: 07: private Color color; 08: 09: public Pixel(int x, int y, Color color) { 10: super(x,y); 11: this.color = color; 12: } 13: 14: public Pixel(int x, int y) { 15: this(x,y,Color.BLACK); 16: } 17: 18: public Pixel(Color color) { 19: this(0,0,color); 20: } 21: 22: public Pixel() { 23: this(0,0,Color.BLACK); 24: } 25: 26: @Override 27: public String toString() { 28: return super.toString() + "(r=" + color.getRed() + 29: ",g=" + color.getGreen() + ",b=" + 30: color.getBlue() + ")"; 31: } 32: }