Processing, Eclipse, Java 1.5, Generics, and Fullscreen

Menu from AhText

Menu from AhText

As we started the AhText Project, we began to run into our first difficulties with processing. It turns out that although Processing 0136+ supports Java 1.5, it does not support any of the new Java syntax. Things like generics, and enhanced “for” loops are not understood by the preprocessor and compiler used in Processing. See this link for more information.

Our initial motivation for moving from the processing IDE to eclipse was the use of generics with regards to Arraylists. Arraylists have been available in Java for a while, but the trouble has been dealing with the type casting of objects stored in the arrays. We needed to be able to use the Java 1.5 syntax to define the type of object that will be contained in a particular Arraylist; however, once we moved to eclipse, we realized that there were other fantastic options afforded to users outside of the processing IDE. Things like auto complete, line numbering, and debugging proved to be invaluable as the program became larger and more complex.

Here is a link to a fantastic, clear and detailed explanation of how to set up eclipse for processing.

One final note. We did have some difficulties implementing full screen support on a mac. After a little research, we found a few different solutions.

1) There is a fullscreen API which works really well, and is very simple to implement. Unfortunately, it doesn’t support dual screens with different resolutions yet. This led us to a second method that is not as flexible but did work for us.

2) It turns out that you can define the “presentation” mode in the main function of your Java program. However, in OSX the top menu bar still persists. In order to fix this you need to export as an OSX application and edit a “.plist” file entry. There is a nice blog here explaining the process. The only major down side to this approach is that you have to hard define your screen size of your processing patch.

Installing Eclipse and setting up Processing:

FullScreen Support:

    FullScreen API (Although it does work, the developer does not support the latest version of Processing) – www.superduper.org
    Pehr Hovey – Alternate method (We couldn’t get this to work, but that is almost certainly our fault :) )

More Links to come…

Share This!

Twitter Facebook MySpace Digg StumbleUpon Delicious


2 Comments

  1. Posted November 26th, 2009 at 5:28 pm | Permalink

    hey!

    first of all thanks for mentioning the fullscreen api, i found this blog entry in my referrers list…

    a few remarks:

     

    compatibility with newer versions of processing: 
    i released a new version just today, which is compatible with newer versions of processing
    the persisting menu-bar issue on macos: 
    i’ve written a native library that allows you to hide/show the menubar at runtime. 
    grab those two files (http://bit.ly/75m9GQ, http://bit.ly/5OA3aU – use the “download” buttons). there’s only one method, i think you’ll figure out how to use it :) it’s compiled as universal binary and for 32/64bits, should work pretty much on any mac with 10.4+
    dual-screen with different resolution: 
    this doesn’t work? it should if you have two seperate applets and each of them specifies the “screen-nr” parameter, like this: 
    new FullScreen( this, 0 ); // in the first applet
    new FullScreen( this, 1 ); // in the second applet

    okay, that’s it :)
    good luck with your project!

     

  2. Posted November 26th, 2009 at 5:30 pm | Permalink

    p.s. i got the download thing wrong, you need to press “raw” instead of “download”!  (otherwise you’ll download the whole fullscreen api source code…)

One Trackback

  1. By AhText! Installation Demonstration Video – FlipMu on October 19th, 2009 at 2:24 pm

    [...] on the application we learned a great deal, moving from Processing to Eclipse / Java 1.5 (see this post), and coming up with interesting solutions which would enable multiple users to effectively [...]

Post a Comment

Your email is never shared. Required fields are marked *

*
*