public void paint(Graphics2D g) {

		Color oldColor = g.getColor();
		Stroke oldStroke = g.getStroke();

		if (rotation != 0) {
			g.rotate(rotation, x, y);
		}

		g.setColor(color);

		float x1 = x - length * 0.5f;
		float x2 = x + length * 0.5f;
		if (line == null)
			line = new Line2D.Float();
		if (drawAxis) {
			g.setStroke(axisStroke);
			line.setLine(x1, y, x2, y);
			g.draw(line);
		}

		g.setStroke(stroke);
		if (path == null)
			path = new GeneralPath();
		else
			path.reset();
		double rx, ry;
		int n = resolution * turnCount;
		double delta = (length - lead * 2) / (n + 1);
		double theta = 2 * Math.PI / resolution;
		double angle;
		for (int i = 0; i < n + 1; i++) {
			angle = Math.PI - theta * i;
			rx = x1 + lead + i * delta + pitch * Math.cos(angle) + pitch;
			ry = y + diameter * Math.sin(angle);
			if (i == 0)
				path.moveTo(rx, ry);
			else
				path.lineTo(rx, ry);
		}
		g.draw(path);

		if (lead > 0) {
			line.setLine(x1, y, x1 + lead, y);
			g.draw(line);
			line.setLine(x2, y, x2 - lead, y);
			g.draw(line);
		}

		g.setColor(oldColor);
		g.setStroke(oldStroke);

		if (rotation != 0) {
			g.rotate(-rotation, x, y);
		}

	}