jriaffe - Runtime and Build

 

This section describes how to develop for the framework.  If you want to write applications that use the framework go to Building Applications with Jriaffe page.


All of the Jriaffe has been developed using the Netbeans 6.x IDE.  Netbeans project files have been checked into the repository to help you get started working with the projects.  There are a couple of libraries you need to create, and those things are covered in the Netbeans section below.


Jriaffe is written using a combination of Java and Groovy.  Most of the development has been done on OS X using JDK 1.5 and Groovy 1.5.5.  I’ve also done some testing with the SoyLatte JDK 6 implementation and Groovy 1.6.   The applications appear to be running fine under these environments.  You can even mix and match Java and Groovy implementations.  For example, I’ve used SoyLatte and Groovy 1.5 with no issues.


Because most of the work has been done on OS X, the application looks best on that platform using the default OS X look and feel.  I’ve done some testing with the Metal look and feel under SoyLatte and fixed a couple of problems.  I’ve been looking around for a default look and feel to use on other platforms, but have not made a decision.  Because the jriaffe framework controls the start up of the application we can force a look and feel of choice at application startup.


Netbeans 6.x Setup

All of the projects in the repository have been checked in with Netbeans project files.  You do need to do some setup in the IDE to get the code compiling and running.  First thing you need to do is set up a library called jraffeLib and add the dependent jar files found in the jriaffeLib zip file that you downloaded from the sourceforge release page.  Here are the steps.


  1. 1. Select Tools->Libraries from the Netbeans menu.

  2. 2. Click the “New Library...” button. 

  3. 3. In the Library Name field type jriaffeLib and click the OK button.

  4. 4. With the jriaffeLib selected click the “Add JAR/Folder... button on the right side of the dialog.

  5. 5. Navigate to where you checked out the jriaffeLib project and select all of the jar files in the folder.

  6. 6. Click OK.


The jriaffeAppManager and jriaffeDemoLauncher applications both need a library called ant.  Follow the directions above, but name the library “ant” instead of “jriaffeLib”.  When you create the library include the ant, ant-junit, and ant-launcher jar files from the jriaffeLib directory.


That should be it for setting up the IDE.  Someone please let me know if there is more and I will add it to the documentation.


Bundling JriaffeAppManager and JriaffeDemoLauncher

The JriaffeAppManager and JriaffeDemoProjects both have ant targets called bundle-app.  For these targets to execute correctly you must create a directory called syslib in the root of the project directory.  That directory should contain all of the jar files from the jriaffeLib directory.  When you build the jriaffeBind and jriaffeLauncher projects the jar files from those projects will be copied to that directory.  Depending on how you check out your projects from the repository you may need to tweak the path in the the build.xml’s -post-jar target for the jriaffeBind and jriaffeLauncher projects.


Runtime Parameters

Jriaffe applications take two runtime arguments.  The  first is the directory on the local machine that contains the application deployment file (.nba file) and the second is the location of the jriaffeClient.jar. 


Build Script Settings

The jriaffeDemo application copies files to a directory structure in your home directory.  Here are the directories you should have in your home directory.


${user.home}/jriaffe/applications/demo

${user.home}/Sites/applications/demo


Some of these settings might seem strange, but remember Jriaffe applications are supposed to be downloaded and installed in a user’s home directory.  The applications are meant to be launched with the jriaffeLauncher.  The application manager is still being developed at the time of this writing.  For the time being, all of the applications have been set up in the IDE so that they can be run and debugged without installing them.



QTJava.zip

The MoviePanel class in JriaffeClient uses the QTJava.zip (Quicktime for Java) library to render a movie.  If you are not on a Mac you probably do not have this class.  You can safely remove the MoviePanel and compile the project.  Unfortunately Quicktime for Java is the only video API that I have available to me.  Not that I have anything against Quicktime, quite the opposite I like it a lot, but I’m not sure how long Apple will support that API.  They have not updated it in a long time.  Here is hoping that the JavaFX guys allow the Video API to be used in Swing based applications.