One of the most telling bits of information into the nature of this type of question was provided by a videotape made by a diver that was left behind by a dive op. The woman survived, and the tape was widely circulated on the tv talk shows. What it showed was the minutes after she was left. When she realized she was alone, she floated on the surface, and her camera was still on. Below her, sharks are clearly visible, mostly just swimming along. As she became more excited (read that "panicked") you can her her screaming through her snorkle and crying. Immediately, the sharks began to move to the surface. That did nothing to calm her, I assure you. However, she did manage to calm herself with time, and she resolutely turned off the camera, trimmed her gear (she kept the camera, of course), and set off to swim against the current for the nearest shore. Several hours later she made it, and she was picked up by a search boat (I believe it was the next day).
My point is pretty obvious, and it's the same one many marine biologists make when they see the video. When she acted distressed and out of the ordinary, the sharks immediately began to check her out. She was exhibiting all the signs of being food. However, when she lined out and began swimming, even on the surface, she was doing what all the other sea life was doing---going somewhere and behaving with a purpose. The sharks then accepted her as part of the system and lost interest in her.
It's also noteworthy that in the case of the Indianapolis, the men were in the water for a long time. I don't know where I've read this, but I believe I remember seeing that there were no shark attacks for hours after the sinking. It wasn't until the men began to tire and become distressed that large numbers of sharks began moving in. As more and more men became victims and panic became high, there were more and more attacks.