Script for rotating templates

I am using something similar to Drag and Drop Ignition Templates on the Template Canvas and I implemented new features like resizing. Now I would like to implement a function to rotate those templates like you can rotate elements in the ignition designer. If someone have an advice or can point me to the right direction.
Thank you for your answer.

Unfortunately, most components cannot be rotated in Ignition at this time due to some limitations of Java swing.