public void draw(Graphics g) { Color color = strokeColor != null ? strokeColor : ROIColor; if (fillColor != null) color = fillColor; g.setColor(color); mag = getMagnification(); int sw = (int) (width * mag); int sh = (int) (height * mag); int sw2 = (int) (0.14645 * width * mag); int sh2 = (int) (0.14645 * height * mag); int sx1 = screenX(x); int sy1 = screenY(y); int sx2 = sx1 + sw / 2; int sy2 = sy1 + sh / 2; int sx3 = sx1 + sw; int sy3 = sy1 + sh; Graphics2D g2d = (Graphics2D) g; if (stroke != null) g2d.setStroke(getScaledStroke()); if (fillColor != null) g.fillOval(sx1, sy1, sw, sh); else g.drawOval(sx1, sy1, sw, sh); if (state != CONSTRUCTING && clipboard == null && !overlay) { int size2 = HANDLE_SIZE / 2; drawHandle(g, sx1 + sw2 - size2, sy1 + sh2 - size2); drawHandle(g, sx3 - sw2 - size2, sy1 + sh2 - size2); drawHandle(g, sx3 - sw2 - size2, sy3 - sh2 - size2); drawHandle(g, sx1 + sw2 - size2, sy3 - sh2 - size2); drawHandle(g, sx2 - size2, sy1 - size2); drawHandle(g, sx3 - size2, sy2 - size2); drawHandle(g, sx2 - size2, sy3 - size2); drawHandle(g, sx1 - size2, sy2 - size2); } drawPreviousRoi(g); if (updateFullWindow) { updateFullWindow = false; imp.draw(); } if (state != NORMAL) showStatus(); }