Volatile Prototypes

A simple interface/control panel for Processing that makes use of the Java Reflection API to automatically update linked fields and call methods.

Here is the Processing code to generate the panel shown below:

import volatileprototypes.Panel4P.*;

Panel4P i;

void setup() {
  i = new Panel4P(this);
  i.addLabel("p","Paint");             // Label
  i.addButton("clr","Clear");          // Single Button
  i.addButton("ers","Erase", 0);       // Toggle Button
  i.addLabel("q","Stroke");
  String[] e = {"Ellipse","Line"};
  i.addButtonGroup("paintmode",e,0);   // Button Group
  i.addLabel("c","Color & Size");
  i.addSlider("redc","Red",0,255,redc);// Slider
  i.addSlider("grec","Green",0,255,grec);
  i.addSlider("bluc","Blue",0,255,bluc);
  i.addSlider("sz","Size",1,120,sz);
}

Now, any fields (variables) and methods (functions) of your Processing sketch that share names with a UI element (the first field) will be changed/triggered automatically when the element is activated.

Full documentation will be available soon.

Released under the BSD License.

Topics
Prototypes
Libraries
All