@Override
	public void mouseDragged(MouseEvent e) {

		RenderContext<?, ?> rc = viewer.getRenderContext();
		MultiLayerTransformer multiLayerTransformer = rc.getMultiLayerTransformer();
		MutableTransformer layoutXformer = multiLayerTransformer.getTransformer(Layer.LAYOUT);
		AffineTransform layoutXform = layoutXformer.getTransform();
		double tx = layoutXform.getTranslateX();
		double ty = layoutXform.getTranslateY();

		Point p = e.getPoint();
		Point gp = GraphViewerUtils.translatePointFromViewSpaceToGraphSpace(p, viewer);
		dragEnd = gp;

		Point gDown = GraphViewerUtils.translatePointFromViewSpaceToGraphSpace(down, viewer);
		if (dragShape == null) {
			dragShape = new MouseDraggedPaintableShape(gDown, gp, tx, ty);
			paintable.addShape(dragShape, viewer);
		}
		else {
			dragShape.setPoints(gDown, dragEnd);
		}

		int offset = 20;
		offset = 0; // not sure why this was using an offset?
		Point downOver = new Point(down.x + offset, down.y + offset);
		Point pOver = new Point(p.x + offset, p.y + offset);
		Point gpOver = GraphViewerUtils.translatePointFromViewSpaceToGraphSpace(pOver, viewer);
		if (dragLineShape == null) {

			Point gDownOver =
				GraphViewerUtils.translatePointFromViewSpaceToGraphSpace(downOver, viewer);
			dragLineShape = new MouseDraggedLinePaintableShape(gDownOver, gpOver, tx, ty);
			paintable.addShape(dragLineShape, viewer);
		}
		else {
			dragLineShape.addPoint(gpOver);
		}

		viewer.repaint();

	}
A simple plugin that allows clients to be notified of mouse events before any of the other
mouse plugins.

@param <V> the vertex type
@param <E> the edge type
Ghidra/Framework/Graph/src/main/java/ghidra/graph/viewer/event/mouse/VisualGraphMouseTrackingGraphMousePlugin.java