code: public static void center(IAtomContainer atomCon, double[] areaDim) {
          double[] molDim = get2DDimension(atomCon);
          double transX = (areaDim[0] - molDim[0]) / 2;
          double transY = (areaDim[1] - molDim[1]) / 2;
          translateAllPositive(atomCon);
          translate2D(atomCon, new Vector2d(transX, transY));
      }
docs: Centers the molecule in the given area. See comment for center(IAtomContainer atomCon,
  Dimension areaDim, HashMap renderingCoordinates) for details on coordinate sets
  
  @param atomCon molecule to be centered
  @param areaDim dimension in which the molecule is to be centered, array containing
  {width, height}