I have discovered that flexibility in the ankles is key, and keeping the feet nice and relaxed. Any tension there will result in cramp over long periods.
I experienced cramp in my calves in a duathlon today on the bike, and I know it was a result of stiff hamstrings, not warming up enough and bitterly cold weather, forgot my leg warmers! But flexibility is the main one.
For more on flexibility when swimming, Lindsay Benko\'s freestyle DVD is excellent.