void draw(Graphics2D g) { if (this == selected) { g.setColor(selectedColor); fillCircle(g, screenPos); g.setColor(color); } else drawCircle(g, screenPos); // drawText(g, screenPos, id); }
private void fillCircle(Graphics2D g, Point2D loc) { int x = (int) (loc.getX() - circleRadius); int y = (int) (loc.getY() - circleRadius); g.fillOval(x, y, 2 * circleRadius, 2 * circleRadius); }