public static void zoomToScreen(final AbstractZyGraph<?, ?> graph) {
    graph.getView().fitContent();

    ZoomHelpers.keepZoomValid(graph.getView());

    graph.updateViews();
  }
Zooms the graph so far that all nodes are non-hidden nodes are visible on the screen.
java/zylib/src/main/java/com/google/security/zynamics/zylib/yfileswrap/gui/zygraph/functions/ZoomFunctions.java