public boolean draw_shape(Graphics g, LShape ob, Color col) { boolean rv = false; if (ob.points.length == 0) return rv; for (int i = 0; i < ob.points.length; i++) { int j = (i + 1) % ob.points.length; this.line(g, ob.points[i].x, ob.points[i].y, ob.points[j].x, ob.points[j].y, col); rv = rv || this.in_rangetdv(ob.points[i]); } P2i avg = ob.get_avg(); this.linev(g, avg, ob.points[0], col); return rv; }
public boolean draw_object(Graphics g, LObj ob, Color col1, Color col2) { LShape shape = ob.get_shape(); Bbox bbox = shape.get_bbox(); this.draw_bbox(g, bbox, col2); return this.draw_shape(g, shape, col1); }