private void centerGraph(VisualizationViewer<V, E> visualizationViewer, Rectangle graphBounds) {

		RenderContext<?, ?> context = visualizationViewer.getRenderContext();
		MultiLayerTransformer multiLayerTransformer = context.getMultiLayerTransformer();

		// ...get the offset we need to revert the view translation back to zero
		MutableTransformer viewTransformer = multiLayerTransformer.getTransformer(Layer.VIEW);
		viewTransformer.setTranslate(0, 0);

		// ...get the offset we need to revert the layout translation back to zero
		MutableTransformer layoutTransformer = multiLayerTransformer.getTransformer(Layer.LAYOUT);
		layoutTransformer.setTranslate(0, 0);

		// ...get the center of the graph and center the viewer over that point
		Point2D viewCenter = visualizationViewer.getCenter();

		viewCenter = translatePointFromViewSpaceToLayoutSpace(viewCenter, visualizationViewer);

		Point2D.Double graphCenter =
			new Point2D.Double(graphBounds.getCenterX(), graphBounds.getCenterY());
		double centerX = graphCenter.getX() - viewCenter.getX();
		double centerY = graphCenter.getY() - viewCenter.getY();

		layoutTransformer.setTranslate(-centerX, -centerY);
	}
A job to scale one or more viewers such that the contained graph will fit entirely inside the
viewing area.

@param <V> the vertex type
@param <E> the edge type
Ghidra/Framework/Graph/src/main/java/ghidra/graph/job/FitGraphToViewJob.java