Does Processing IDE include all PDE files in the sketch folder by default?
in
Integration and Hardware
•
1 year ago
Hi all,
I'm trying to set up a sketch which can dynamically load one of several classes. The classes are in separate PDE files in the sketch folder and should be loading as internal, but aren't. The code I'm using is:
- void addModule(String prefix) {
- // get class by name
- Class c = Class.forName(prefix + "Control");
- // retrieve constructor based on constructor arguments
- Class[] constructorArgs = new Class[3];
- constructorArgs[0] = ControlP5.class;
- constructorArgs[1] = int.class;
- constructorArgs[2] = int.class;
- ModuleControl mc = (ModuleControl) c.getDeclaredConstructor(constructorArgs).newInstance(controlP5, 0, 0);
- // add new ModuleControl object to modules ArrayList
- modules.add(mc);
- }
I get an unhandled ClassNotFoundException from line 3. I've doublechecked that the class name I'm trying to load actually exists - this leads me to think that the Processing IDE doesn't process PDE files that aren't specifically mentioned in the other files, even if they're in the same folder. Is that right? Is there any way to force it to do otherwise?
I realise importing stuff explicitly would be quite a bit easier from Eclipse, but I've gotten quite used to the Vim/Processing IDE workflow I've got going on :)
Thanks for your help!
Andrey
1