import java.awt.*; /** This class manages the color associated with a Room's set by overriding * {@link #getColor()}. */ public class SetViz extends RectViz { private RoomViz r; /** Visualize the set associated with a [@link Room} * @param r The {@link RoomViz} */ public SetViz(RoomViz r, double dx, double dy, double dwidth, double dheight) { super(r.getRoom().getPCS(), dx, dy, dwidth, dheight, r, new String[] { "set" }, new Color[] { Color.black }, computeColor(r.getRoom())); this.r = r; } /** Override to get the actual color for this part based on the current * set. Hint: use the set's {@link System#identityHashCode(Object)} * to make 3 integers representing the red, green, and blue content * of the color. For the red and green, don't let it get all the way * red or green, because we use those colors for other things. A * helper method is a good idea, because you need the same code to * initialize as well as recompute the color. */ protected Color getColor() { return Color.black; } // FIX ME }