Would this do it?

`perl -pi -e 's/@@/^&/g' /mypath/diagrams-lib/src/diagrams/*`

and also on TwoD, ThreeD and the other subdirectories