cp5magic: Annotations based helper library for ControlP5 - not supported in PDE
in
Library and Tool Development
•
3 years ago
Dear all,
I've been using ControlP5 for quite a long while now and while it very well does what it says on the can for smallish sketches, it's not so easy/comfortable to deal with in somewhat larger situations. So I finally took the plunge to help me and potentially others writing MUCH less code in the future and actually have the GUI generating itself simply from chosen variables in your code. And here it doesn't really matter if these variables are all stuffed within your main PApplet instance or kept in other classes. The entire GUI generation can be reduced down to 2 lines of setup code and the system is totally customizable and heavily relies on Java annotations to pull off its "magic". And due to the type mapping & builder patterns used you're not restricted to just represent primitive variable types anymore as GUI controllers, but can create custom controller mappings for your own custom types...
I was so very excited to hear that Processing 1.2 would
finally support the much nicer Java 5 syntax, alas it seems that
annotations have been left out in the cold and are brutally stripped from any code written in the PDE... :( Why, oh why?
So very unfortunately, this library is only useful for those who've ventured outside the PDE sandbox (e.g. using Eclipse or any other fully Java compliant environment).
I've put up the entire project, exported JAR, fairly detailed documentation and usage examples over here:
To see some actual code example using this system, look here:
I might develop this further if the need arises, but here's to hoping this at least shows that annotations can actually be super useful also to Processing heads and that this triggers some further discussion about library design patterns, full language support etc...
3