private GridLocationMap<FGVertex, FGEdge> convertToGrid(FGTempGraph jGraph,
			LayoutModel<FGVertex> layoutModel,
			LayoutAlgorithm<FGVertex> layoutAlgorithm)
			throws CancelledException {

		GridLocationMap<FGVertex, FGEdge> grid = new GridLocationMap<>();

		Map<Double, Integer> columns = new TreeMap<>();
		Map<Double, Integer> rows = new TreeMap<>();

		Set<FGVertex> jungVertices = jGraph.vertexSet();
		for (FGVertex fgVertex : jungVertices) {
			monitor.checkCancelled();

			Point point = layoutModel.get(fgVertex);
			columns.put(point.x, 0);
			rows.put(point.y, 0);
		}

		Function<FGEdge, List<Point>> articulator = getArticulator(layoutAlgorithm);
		Set<FGEdge> edges = jGraph.edgeSet();
		for (FGEdge fgEdge : edges) {
			monitor.checkCancelled();

			List<Point> ariculations = articulator.apply(fgEdge);
			for (Point point : ariculations) {
				columns.put(point.x, 0);
				rows.put(point.y, 0);
			}
		}

		// translate the real coordinates to grid coordinates (row and column indices)
		int counter = 0;
		for (Double x : columns.keySet()) {
			monitor.checkCancelled();
			columns.put(x, counter++);
		}

		counter = 0;
		for (Double y : rows.keySet()) {
			monitor.checkCancelled();
			rows.put(y, counter++);
		}

		jungVertices = jGraph.vertexSet();
		for (FGVertex fgVertex : jungVertices) {
			monitor.checkCancelled();

			Point point = layoutModel.get(fgVertex);
			grid.set(fgVertex, rows.get(point.y), columns.get(point.x));
		}

		edges = jGraph.edgeSet();
		for (FGEdge fgEdge : edges) {
			monitor.checkCancelled();

			List<GridPoint> newPoints = new ArrayList<>();

			List<Point> articulations = articulator.apply(fgEdge);
			for (Point point : articulations) {

				Integer col = columns.get(point.x);
				Integer row = rows.get(point.y);
				newPoints.add(new GridPoint(row, col));
			}

			// The jung layout will provide articulations at the vertex points.   We do not want to
			// use these values, since we may move the vertices during layout.  Our renderer will
			// connect the articulation endpoints to the vertices when drawing, so we do not need
			// these points provided by jung.
			if (!articulations.isEmpty()) {
				newPoints.remove(0);
				newPoints.remove(newPoints.size() - 1);
			}

			grid.setArticulations(fgEdge, newPoints);
		}

		return grid;
	}
A layout that delegates work to the Jung layout specified in the constructor.
Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/layout/jungrapht/JgtNamedLayout.java