public LayoutAlgorithm<V> getLayout(String name) {

		Builder<V, ?, ?> layoutBuilder = doGetLayout(name);
		LayoutAlgorithm<V> layout = layoutBuilder.build();

		if (layout instanceof TreeLayout) {
			((TreeLayout<V>) layout).setRootPredicate(rootPredicate);
		}

		if (layout instanceof VertexBoundsFunctionConsumer) {
			@SuppressWarnings("unchecked")
			VertexBoundsFunctionConsumer<FGVertex> boundsLayout =
				(VertexBoundsFunctionConsumer<FGVertex>) layout;
			Function<FGVertex, Rectangle> vertexBoundsFunction = new FGVertexShapeFunction();
			boundsLayout.setVertexBoundsFunction(vertexBoundsFunction);
		}

		// we should not need to set the max level, since our graphs do not get too many vertices
		// layoutAlgorithm.setMaxLevelCrossFunction(...);

		return layout;
	}
A class that supplies Jung graph layouts to the Function Graph API.

@param <V> the vertex type
@param <E> the edge type
Ghidra/Features/FunctionGraph/src/main/java/ghidra/app/plugin/core/functiongraph/graph/layout/jungrapht/JgtLayoutFactory.java