private void buildShape() {
		controls.clear();

		Point start = points.get(0);
		Point p1 = start;
		Point p2 = points.get(1);

		GeneralPath path = new GeneralPath();
		path.moveTo(p1.x, p1.y);
		if (points.size() == 2) {
			path.lineTo(p2.x, p2.y);
			path.closePath();
			this.shape = path;
			return;
		}

		boolean useControl = true;
		for (int i = 2; i < points.size(); i++) {

			Point p3 = points.get(i);

			if (useControl) {
				path.quadTo(p2.x, p2.y, p3.x, p3.y);
			}
			else {
				path.lineTo(p3.x, p3.y);
			}

			useControl = !useControl;

			p1 = p2;
			p2 = p3;
		}

		for (int i = points.size() - 1; i >= 0; i--) {
			Point p = points.get(i);
			path.moveTo(p.x, p.y);
		}

		path.closePath();
		this.shape = path;
	}
Paints a line showing the start and end points of a drag operation.
Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/renderer/MouseDraggedLinePaintableShape.java