sclass LineWithColor implements RenderableWithHints { Pt a, b; RGB color; int width = 14; *() {} *(Pt *a, Pt *b, RGB *color) {} public void renderOn(Graphics2D g, int w, int h) { drawRoundEdgeLine(g, a, b, toColor(color), width); } public void renderHints(Graphics2D g, int w, int h) { fillRect(g, a.x, a.y, 1, 1, hintColor()); fillRect(g, b.x, b.y, 1, 1, hintColor()); } // 0 to 360 (clockwise, 0 is north) double angle() { double angle = Math.toDegrees(Math.atan2(b.y-a.y, b.x-a.x)); ret angle < 0 ? angle + 360 : angle; } }