Measurement of the forward-backward asymmetry of top-quark and antiquark pairs using the full CDF Run II data set