Symbolic Dice - Flipping Action

Hi guys,
I’m developing a new Vassal module and I’m hang up with this problem…
After rolling 2 symbolic dice (standard d6) I’d like to be able to “flip” them to see the number on the opposite side.

For example if i roll 2-6
I could flip 2 to change it to 5… and I can flip 6 to change it to 1

Every flippimg action should swap number with his opposite.
I know that the sum of opposite number always equal 7, so the trick could be easy… but I cannot figure it out.

Can anyone help me?
Thank you in advance.
Alessandro