public static <
          NodeType extends ZyGraphNode<?> & ISelectableNode & IViewableNode,
          EdgeType extends ZyGraphEdge<?, ?, ?>>
      void centerNode(final AbstractZyGraph<NodeType, ?> graph, final NodeType node) {
    Preconditions.checkNotNull(node, "Error: Node argument can't be null");

    final NodeRealizer realizer = graph.getGraph().getRealizer(node.getNode());

    if (realizer.isVisible()) {
      graph
          .getView()
          .focusView(
              graph.getView().getZoom(),
              new Point2D.Double(realizer.getCenterX(), realizer.getCenterY()),
              graph.getSettings().getLayoutSettings().getAnimateLayout());
      graph.updateViews();
    }
  }
Centers the graph on a single node.

<p>Note that the node must be visible. Otherwise the centering operation has no effect.

@param node The node in question.
java/zylib/src/main/java/com/google/security/zynamics/zylib/yfileswrap/gui/zygraph/functions/MoveFunctions.java