We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi I'm developing a little software to manipulate 2d shapes. I'm doing a lot of mouse commands: group/ungroup shapes, select single shape/group, rotate/translate single shape/group or all the canvas, etc etc Right now I'm doing it with weird different keys and mouse click combinations: click on shape while pressing the key 's' is select shape, while pressing 'g' is group, etc..
I'd like to do it with more structured mouse commands: one click, double click, one right click -> contextual menu, fright click and drag, etc etc etc
I've tried to see awt and there is the MouseAdapter but it's for awt objects and my shape classes (I'm using toxiclibs to handle 2d geometry) are not suitable for that. Or anyway not without a lot of works for adapting. And I'd like to stay more p5 as possible, using controlP5 as guy library.
Is there any kind of strategy/design pattern that you guys in the forum have used for such a structured thing?
Answers
Perhaps this thread can give some inspiration with regard to the right-click menu.
Hm, what about a menu in one corner where you can select group and rotate etc. ?
Yes could also be but I'd like the idea to make it more "softwareish" like pan tilt zoom in rhino, when modelling on the 3d perspective view. or click and select, right click, etc etc
Do you have it in mind? A key and a mouse action makes an operation in the world (the 3d perspective) AND in the gui visualization (change the mouse cursor for example)
I think that in the pure awt world this is done with a class that act as a mouse controller.. i'm looking for a similar pattern with no awt objects and events firing but with native processing
Menu like here,,,,