netbeans plugin to support processing.org API
http://processing.org is a flexible software sketchbook and a language for learning how to code within the context of the visual arts.
As it is based on Java, it is also possible to use processing as an external library of a full Java project.
What is the advantage of doing so? We all love playing with processing API which is simple, well designed and efficient in the audio/visual digital art domain, but sometimes, we would want to benefit from Java language and its Object Oriented approach when the project sketches (name of processing.org programs) start to grow.
Netbeans (http://netbeans.org) is a great Open Source IDE, and this plugin aims at making easier the way to work with processing within your java code, allowing to:
- create a ready-to-run java processing project from a provided project template including processing libs and main class
- add processing.org contributions libraries thanks to an included downloader/installer
- benefit from code completion, debugger, profiler and other usual tools from the netbeans IDE
Netbeans 8.2 and Netbeans 9 are supported, download the dedicated nbm file.
You can retrieve the latest compiled version of the plugin here. Choose either org-netbeans-modules-java-processingproject-nb8.nbm or org-netbeans-modules-java-processingproject-nb9.nbm, depending on your IDE version.
The plugin is also available on the http://plugins.netbeans.org/ website.
It's not a Processing language IDE support plugin: you don't code using the Processing language, you code using Java and the Processing libs. Feel comfortable: Sketches can easily be translated from Processing language to full Java.
This plugin should work on Windows, MacOS and Linux, but I've tested it only on Windows and MacOS.
First create a new Netbeans project and select the Processing Category, you will find the processing java template.
Then you need to set your project's name
The following java project structure is created (see project explorer on the left), including a data folder for usual processing assets (images, sounds,...) and a contribs folder ready to embed external processing.org contributions libraries. The java main class is also created. Finally, all the necessary processing core libs are already there, included as jar files in the project classpath.
You can already run the created project.
Then, if you want to add some processing.org contributions (contribs) libraries, right click on the contribs folder in the project explorer, and click on the action: "Add contribs lib..."
This opens the processing contribs dialog, letting you choose libraries you want to install and use in your project. The dialog lists all the official libraries. You can filter the libraries entries.
For each library you want to install, click on the lower right "Download and install" button of the dialog; this will download the archive of the library in the contribs folder. Once you have downloaded all the necessary libs for your project, close the dialog by clicking on the cross at the upper right corner of it. This finalizes the libs installation, by unzipping libs archives (with all associated examples,...) in the contribs folder and adding the associated .jar files in the project classpath.
You're now able to work with processing.org libs within your netbeans java project!
The plugin allows you to create some classes with a template sticking to the processing rendering rules, for example, if you want to create objects with their own rendering to be rendered within the main sketch... let's see how,
This creates a class within the main project, a class with the following template:
Such a class can then be used in you main sketch:
For now, that's all about this processing plugin for java projects in netbeans, wishing you good processing sketches!