src/main/java/com/mxgraph/swing/mxGraphComponent.java
public void zoomAndCenter()
	{
		if (zoomPolicy != ZOOM_POLICY_NONE)
		{
			// Centers only on the initial zoom call
			zoom(zoomPolicy == ZOOM_POLICY_PAGE, centerOnResize
					|| zoomPolicy == ZOOM_POLICY_PAGE);
			centerOnResize = false;
		}
		else if (pageVisible && centerPage)
		{
			mxPoint translate = getPageTranslate(graph.getView().getScale());
			graph.getView().setTranslate(translate);
		}
		else
		{
			getGraphControl().updatePreferredSize();
		}
	}
/**
	 * Invoked after the component was resized to update the zoom if the zoom
	 * policy is not none and/or update the translation of the diagram if
	 * pageVisible and centerPage are true.
	 */
Invoked after the component was resized to update the zoom if the zoom
policy is not none and/or update the translation of the diagram if
pageVisible and centerPage are true.
Invoked after the component was resized to update the zoom if the zoom policy is not none and / or update the translation of the diagram if pageVisible and centerPage are true .
public void zoomAndCenter()
	{
		if (zoomPolicy != ZOOM_POLICY_NONE)
		{
			zoom(zoomPolicy == ZOOM_POLICY_PAGE, centerOnResize
					|| zoomPolicy == ZOOM_POLICY_PAGE);
			centerOnResize = false;
		}
		else if (pageVisible && centerPage)
		{
			mxPoint translate = getPageTranslate(graph.getView().getScale());
			graph.getView().setTranslate(translate);
		}
		else
		{
			getGraphControl().updatePreferredSize();
		}
	}
public void zoomAndCenter ( ) { if ( zoomPolicy != ZOOM_POLICY_NONE ) { zoom ( zoomPolicy == ZOOM_POLICY_PAGE , centerOnResize || zoomPolicy == ZOOM_POLICY_PAGE ) ; centerOnResize = false ; } else if ( pageVisible && centerPage ) { mxPoint translate = getPageTranslate ( graph . getView ( ) . getScale ( ) ) ; graph . getView ( ) . setTranslate ( translate ) ; } else { getGraphControl ( ) . updatePreferredSize ( ) ; } }
Invoked after the component was resized to update the zoom if the zoom
 policy is not none and/or update the translation of the diagram if
 pageVisible and centerPage are true.
Invoked after the component was resized to update the zoom if the zoom policy is not none and / or update the translation of the diagram if pageVisible and centerPage are true .
// Centers only on the initial zoom call