code: public static void center(IAtomContainer atomCon, Dimension areaDim) {
          Dimension molDim = get2DDimension(atomCon);
          int transX = (areaDim.width - molDim.width) / 2;
          int transY = (areaDim.height - molDim.height) / 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