package rebelsky.drawing; import rebelsky.newvec.Point; /** * Points that also have colors. * * @author CSC152 2004F * @version 1.0 of September 2004 */ public class ColoredPoint extends Point { // +--------+-------------------------------------------------- // | Fields | // +--------+ String color; // +--------------+-------------------------------------------- // | Constructors | // +--------------+ public ColoredPoint(double _x, double _y, String _color) { super(_x,_y); this.color = _color; } // ColoredPoint(double, double, String) // +---------+------------------------------------------------- // | Methods | // +---------+ public String toString() { return this.color + ":" + super.toString(); } // toString() public String getColor() throws Exception { ColoredPoint c = (ColoredPoint) (Object) this.color; return this.color; } // getColor() } // class ColoredPoint