hIPster icon The Official Hipster Blog

Sunday, November 05, 2006

Subversion problems with CruiseControl

I am setting up a CruiseControl server on my iMac to automatically check out and build the hIPster source each day. Up until now I have failed to get it working because the call to subversion was failing with:

org.jdom.input.JDOMParseException: Error on line 3: XML document structures must start and end within the same entity.

After hacking the source code for CruiseControl I discovered what was happening. I post it here in case it is of use to someone else.

It turns out the svn command was returning the following before it output the XML:

svn: PROPFIND request failed on '/svn/trunk'svn: PROPFIND of '/svn/trunk': Server certificate verification failed: issuer is not trusted (https://hipster.googlecode.com)

The solution is to sign in with the same username that you use to run the CruiseControl server and do a manual:

svn update

You will then get the chance to sign in as the subversion user and permanently add the subversion user.

I have heard that the same thing can occur on Windows machines if the source was checked out by a GUI user, but the CruiseControl server is started as a system server. Same fix should work there.

Thursday, November 02, 2006

Refactoring madness

Currently refactoring the system and adding unit tests throughout. The bizarre thing is that it is actually (for the moment) making the code less stable. A couple of bugs have appeared. I suppose it demonstrates that agile methods don't neccessarily create code with fewer bugs, they just make sure that the old ones don't pay return visits...

Sunday, October 01, 2006

Mouse manipulation

The mouse interaction with the maps has been pretty poor so far, but this weekend I have managed to iron out a few bugs. You can now drag the branches around and they behave pretty much as your would expect. The strange side effect is, because all of the branches interconnected and try to repel each other, the whole of the mind map behaves like an organic structure. If you wiggle a branch on one side of the map, the shock travels through the whole structure.

I have also started to put the first pieces in place for cross-links. Cross links are the branches that join two distinct branches together. This is the major difference between mind maps and simple tree structures like you get in outliners.

At the moment I am saving files in OPML format, which is far from perfect, but is working reasonably well. The files now save their angle information, which looks a little odd if you open the outline in another tool (like OmniOutliner) but it does get past the problem of every file you open having to re-arrange itself.

It's nearly 11 now and I need to get to bed.

Sunday, September 24, 2006

XML Menus

The menus in the main window of the application are now stored as XML within the jar bundle. It's done using a very simple package I created a couple of years ago called "Interfaces iN Xml" (INX). Here's the menu:

<menubar>
<menu textname="file">
<item textname="new" action="newDocument" key="N">
<item textname="-">
<item textname="open" action="openDocument" key="O">
<item textname="save" action="saveDocument" key="S">
<item textname="saveAs" action="saveAsDocument">
</menu>
<menu textname="edit">
<item textname="insertChild" action="insertChild">
<item textname="insertSibling" action="insertSibling">
</menu>
<menu textname="view">
<item textname="zoomIn" action="zoomIn" key="PLUS">
<item textname="zoomOut" action="zoomOut" key="MINUS">
</menu>
<menu textname="help">
</menu>
</menubar>

The text-names refer to strings in a specified resources file (that'll help with internationalization), the action is a method in some underlying Java class and the key will be comined with whatever the platform-specific menu key is ([CTRL] on Windows [Command] on the Mac).

Here's the code in Mainframe that calls it up:

XMLMenuBar menuMgr = new XMLMenuBar(this,
"/dg/hipster/view/mainframeMenu.xml", resBundle);

If somebody clicks on the "view/zoomIn" item, the Mainframe.zoomIn() method will be called.

I hope to migrate more and more of the interface to XML. It should make it easier for non-Java people to modify the code.

Saturday, September 23, 2006

Universal binaries

I am just starting to create a help system on the Mac. Been doing a lot on the Mac version this werek, mostly as a result of using the excellent jar-bundler Ant task (thanks Greg and Will).

To get the help system called up on the Mac, you need to create a JNIlib, but the problem is that the example code in jar-bundler only builds the code for the current platform. So as soon as I transferred the binary from my Intel MacBook to my PowerPC iMac, the thing broke.

The trick is to pass a couple of -arch calls to cc:

<exec executable="cc">
<arg line="-c">
<arg line="-I/System/Library/Frameworks/JavaVM.framework/Headers">
<arg line="-o build/HelpBookJNI.o">
<arg value="platforms/macosx/obj-c/HelpBookJNI.m">
</exec>

<exec executable="cc">
<arg line="-dynamiclib">
<arg line="-framework JavaVM">
<arg line="-framework Cocoa">
<arg line="-o build/libHelpBookJNI.jnilib">
<arg value="build/HelpBookJNI.o">
</exec>

becomes:

<exec executable="cc">
<arg line="-arch ppc">
<arg line="-arch i386">
<arg line="-c">
<arg line="-I/System/Library/Frameworks/JavaVM.framework/Headers">
<arg line="-o build/HelpBookJNI.o">
<arg value="platforms/macosx/obj-c/HelpBookJNI.m">
</exec>

<exec executable="cc">
<arg line="-arch i386">
<arg line="-arch ppc">
<arg line="-dynamiclib">
<arg line="-framework JavaVM">
<arg line="-framework Cocoa">
<arg line="-o build/libHelpBookJNI.jnilib">
<arg value="build/HelpBookJNI.o">
</exec>

Sunday, September 17, 2006

Binary versions available

It's starting to take shape now. Basic mind maps can be created (although only simple tree structures - no cross-links between ideas yet) and they can be opened and saved to OPML files.

Over the weekend I started to create platform-specific builds for the Mac and Windows (Linux coming next). The binaries for these and the pure Java version are available via the project page.

I've also started to create the look of the application. For the moment this means pictures of Frank Zappa plastered everywhere. Looks a little rough. I really need to spend an evening with Photoshop and the The Gimp (did you know that Gimp can export Windows .ico files? Very useful).

The code needs tidying up next. There are hardly any unit tests and the separation between model, view and controller is a little arbitrary. I'd like to formalise things a lot more and probably bring in a library called INX ("Interfaces iN XML") that I started a while back. It will let me lay out frames using HTML-style syntax in XML and then bind Java beans to the views.

Good Heavens. My longest post yet...

Sunday, August 13, 2006

Text!

Text now added in the demo layout.