The thing is that i have got the two cylinders on the canvas. So wherever i click, the two cylinders rotate simultaneously. I understand that by having mouselisteners for each cylinder separately will solve the problem, however since i am adding the cylinders on the canvas, therefore i can only invoke the mouselistener on the canvas instance not the cylinder instance.
Can u please post a code of how a mouselistener can be invoked from a cylinder instance.
How do you know which cylinder that you are trying to rotate?
You will need some sort of bounding box to identify which cylinder you want to rotate.
If you mouse click is inside of bounding box 1, rotate cylinder 1.
I have used MouseRotate and passed the cylinder transform group as its transform group. But the problem still is that the rotating via mouse anywhere on the canvas rotates the mouse, which i don't want. THerefore i had used the MouseRotate and set the transform group of the cylinder, so that only that particular transform group gets rotated.
I can set the scheduling bounds of this behavior (MouseRotate) but still the canvas rotates the mouse.
Can you please tell me how to restrict the scheduling bounds only to the diameter of the cylinder and not the entire canvas.
I have never used MouseRotate.
If it was me, I would try using MouseWheelListener instead.
But, that's just me.