I am building a document layout editor in NetBeans Visual Library API, and I am looking for a way to let the user rotate a widget about it's center with the mouse. How would I go about adding this functionality?
I think I need to clarify, this is what I want to accomplish:
I am not using an NetBeans Platform or an IDE.
Looking at the API doc for Widget, I don't see how it is possible.
There is another approach I can suggest.
extend Widget (the relevant widget you are interested in), add support for rotation. In paintWidget method, add a line
The angle will have to come from your model or user interaction. How you build the user interaction is another exercise, but this approach should work.
If you need something which is already provided, then simply copy the source in your own class and add support for rotation.
If you have already come across a better way, I would be happy to learn about it.