I have created a method that allows me to select a shape and rotate it. I was wondering if anyone knows how to rotate it 45 degrees on the spot.
RotateMethod
public void rotateObject() {
int i=0;
selectedShapes.get(i++).getTransforms().add(new Rotate(45, 360, 360));
}
The method gets the selected item and then rotates it when a button is clicked. Currently it will rotate it 360 degrees around the scene. I want it to rotate around the same spot. If there is a better way of implementing this rotate method please enlighten me. Thank You
EDIT:
After implementing the method stated below, the selected shape now rotates 45 degrees as required. However, it only rotates once, how can I re-write the method to allow it to rotate 45 degrees every time I click on my rotate button
public void rotateObject(ActionEvent event) throws IOException{
int i = 0;
selectedShapes.get(i++).setRotate(45);
}