Connexions Version of “Programming for Change”

Dr. Nguyen had sent me an email with an example of how to include Java applets in a Connexions document. Today I finally updated the Connexions version of our “Programming for Change” nifty assignment that I had started to create last year. The Connexions version now also includes applets, and both the original HTML version and the Connexions version now use an actual image of the star-shaped graph of conversion functions instead of ugly ASCII art.

I had to experiment a little bit since neither the example nor Connexion’s reference described how applets packaged in jar files can be used. It turned out I needed to specify the class name as source of the media, not a file name as described on the reference page of the <media> tag, and then provide the jar file in a <param> tag.

1
2
3
4
5
6
7
8
<figure id="applet1">
  <media type="application/x-java-applet" src="controller.TempCalcApplet">
    <param name="width" value="300"/>
    <param name="height" value="50"/>
    <param name="archive" value="constant.jar"/>
  </media>
  <caption>Example applet for the constant solution.</caption>
</figure>

Once those additions were made, I decided the Connexions Version of “Programming for Change” was ready to be published.

In general, Connexions has probably become better. I saw that it now includes a LaTeX importer, although I haven’t tried it. It’s still a slow, cumbersome system, though, that makes a writer jump through an exorbitant number of pointless hoops. I’m going to edit all the lectures for the COMP 202 course that I will teach next semester, and I will make their appearance more consistent, but I’m not sure I also want to port all of them to Connexions. I might end up being forced to do that, even though I don’t see the value of having a Connexions port at all: No one in his right mind would want to maintain the documents.

In other news, I fixed a bug in DrJava that would throw a NullPointerException when using “Step Into” in debug mode and corrected three typos in the QuickStart guide (two found by a user, a third found when I grepped for the misspelled word). I’m glad I didn’t make that mistake, although I’m the only one who has updated the DrJava documentation since it was created almost three years ago.

I also fixed a problem with loading projects and restoring the selection and active document. I don’t know how that got screwed up again, but I know that I fixed it once already, and after that it was working.

I completed the “project auto-refresh” task from COMP 312 that wasn’t finished; now there is a menu item to invoke the feature on demand, and the black list can be edited in the “Project Properties” dialog.

I changed the “Insert Variable” dialog so that it maintains the previously selected variable; I believe this makes the dialog less confusing. Finally, I’ve been in the process of adding a few actions to DrJava that can be invoked from the command line of an external process. The actions are implemented as side effects of the evaluation of the command line: A variable used to denote an action performs the action and then evaluates to the empty string, disappearing from the command line.

So far, the following properties are available:

  • ${action.save.all} — save all source files and the project file
  • ${action.compile.all} — compile all source files and included external files
  • ${action.clean} — clean the build directory
  • ${action.open.file;file="Foo.java";line="100"} — open a file and jump to a certain line, if a line number was specified
  • ${action.auto.refresh} — perform a project auto-refresh

For example, the command line

1
${action.clean}${action.compile.all}find ${project.build.dir}

cleans the build directory, then compiles all files, and finally runs find on the build directory, resulting in a listing of all class files.

Oh, and I graduated, but I still, still, still don’t have my diploma.

Share

About Mathias

Software development engineer. Principal developer of DrJava. Recent Ph.D. graduate from the Department of Computer Science at Rice University.
This entry was posted in DrJava, Graduate School, OOP Book, Ramblings. Bookmark the permalink.

Leave a Reply