I’ve been following the Netbeans tutorial on using the Nodes API to implement a tree structure with some information in it.
In the second part of the tutorial the author shows how to set up and show a property sheet sheet when an element in the tree structure is selected. Most of the examples work pretty straight forward, but when I tried to adapt the example to my own code, I got a problem with the way the tutorial uses the Java reflection to set the fields of the property sheet. Here is the line in the tutorial:
The other day I was working on a Netbeans project where I had to create a new module that was dependent on a external JAR file. From the platform document I found out that you can add a JAR file in two ways: Using the Library Manager or using a Library Wrapper Module. First I tried the second option, and it worked fine except for one thing – there was no javadoc attached to the jar, and no way to attach it.
There is no way to edit the jar file properties
Then I tried the other option, adding the JAR as a library using the Libraries option from the Tools menu. Using this method it was possible to add both the javadoc and the source to the library. Unfortunately there was no way to include the library in a project, which kind of renders the whole ting useless. I still don’t know what the Library Manager is supposed to be used for, but apparently not for including JARs in projects.
After Googling for a while, coming up blank on what to do, I got in touch with a Netbeans expert Andrzej Olszak – author of the cool Featureous tool. He already knew the problem from his own work and also knew a work-around:
Select the main module suite, click the New Project… option in the file menu and add a new Library Wrapper Module
Select the JAR file to be included and complete the forms as needed. When you press OK, the new module should be opened along with your other modules.
Right click on the module in the list of projects and select Properties at the bottom of the menu. Select the Libraries node on the left side, and click on the Wrapped JARs tab to the right.
Now you see the same options as on the image above, with the Edit… button disabled. Here comes the trick:
Select the JAR and press Remove, then press the Add JAR button and re-add the same JAR file again… and watch what happens to the Edit… button. Suddenly it is enabled! That is it…
Now you can include the wrapper module as a dependency in any module you like, and the javadoc will be available.
In our project we have the ARToolkit installed on several machines, and not all machines have problems with the V4L version of the toolkit, so you could try out the V4L version before resorting to the GStreamer version.
If you encounter the following error: “error: acquireing channel(0) info” it probably means you should configure the ARToolkit for GStreamer. Apparently this is due to some problems using V4L2 libraries, which is not supported by ARToolkit.
To do this you should re-run configure and make in the root of the ARToolkit to rebuild the toolkit. It is important to remember to clean the previous installation before reconfiguring. This can be done by running “make clean” in the root folder of the toolkit.
When configuring select option 5 “GStreamer” and choose the rest of the options that are appropriate for your system. After compilation you should be able to run the “simpleTest” demo.
If the default options does not work with the simpleTest example, it might be necessary to specify some options before running the example. Try running the following command to set options for ARVideo.
export ARTOOLKIT_CONFIG="v4l2src device=/dev/video0 use-fixed-fps=false ! ffmpegcolorspace ! capsfilter caps=video/x-raw-rgb,bpp=24 ! identity name=artoolkit ! fakesink"
Remember to change the device string to point to right camera source.