Background
Quoting from Gillespie's book
The level of inbreeding is measured by the inbreeding coefficient, $F_I$, which is the probability that two alleles in an individual are identity by descent.
The two possible alleles are $A_1$ and $A_2$ and their frequencies are $p$ and $q=1-p$, respectively. Gillespie goes on and give the expected genotype frequencies given $p$ (and $q$) and $F_I$
$$ \begin{array}{r|c|c|c} Genotype & A_1A_1 & A_1A_2 & A_2A_2 \\ \hline Frequency & p^2(1-F_I)+pF_I & 2pq(1-F_I) & q^2(1-F_I)+qF_I \\ \end{array} $$
Question
Can you please help me to understand why those are the appropriate genotype frequencies?
Example of what is unclear to me
By the definition of $F_I$, I was expecting that the frequency of `$A_1A_2$ (and $A_2A_1$) would be $(1-F_I)$, that is the frequency (or probability) that two alleles in an individual are not identical by descent. I feel like the definition given above is wrong. Should it rather be something like the weight for sampling like individuals? That is if there were only two possible mates, one that is $A_1A_1$ and one that is either $A_1A_2$ or $A_2A_2$, then the probability for a $A_1A_1$ individual to mate with the other $A_1A_1$ is $F_I$.