Plugin development

Extending jAlbum

Skins extend the way jAlbum presents albums. Plugins extend the jAlbum application itself. Here is how it works and how you make your own extensions using jAlbum's Plugin API.

A word on the wording

We're talking about "extensions" and "plugins" here so we'd better explain the terminology: A plugin is a certain type of jAlbum extension that implements the JAlbumPlugin interface. All jAlbum plugins are therefore extensions, but not all extensions are plugins. An extension is a way of packaging code so jAlbum can install it with a simple double-click just like skins are installed. You could for instance package a jAlbum image filter as a jAlbum extension for easy installation.


The image filters are examples of plugins

Being Java code, a plugin can do virtually anything you can do in Java. A plugin is able to interact with jAlbum objects like its UI and album making engine AlbumBean. It can for instance modify how jAlbum creates and scales images.

A plugin can hook itself into jAlbum's UI in various ways. jAlbum already comes with several plugins installed:

  • As menu items under jAlbum's Tools menu. The "Skin development" menu and its JTextPad editor is a plugin
  • As menu items under jAlbum's File->Import menu.
  • As a context menu item, when right clicking album objects. The "Print" item is a plugin
  • To a keyboard hotkey. Pressing F12 will launch the "Instant preview" plugin
  • As a tab of jAlbum's edit view. The "Camera" tab is a plugin
  • As an image filter. The image filters/tools visible in jAlbum's edit mode are also plugins

Packaging and installing

A jAlbum plugin is usually packaged as .jaext (jAlbum Extension) file so it can be installed into jAlbum by double clicking it, or dropping it onto jAlbum (v9.4 and above). A .jaext file is simply a .jar file renamed to .jaext, and a .jar file by the way is simply a bunch of zipped java class files. Extensions end up installed in the "ext" folder of jAlbum's new centralized config folder. This way they survive jAlbum updates. During development, they can also be added as plain class files to jAlbum's "plugins" folder.

Plugins can be shared with the jAlbum community by posting them in the tools & plugins forum

Loading and activation

When jAlbum starts it activates each plugin by looking for class files ending in "Plugin", for instance "JTextPadPlugin.class". Found classes that also implement the JAlbumPlugin interface are then instantiated. This is done before any significant initialization has been done. When significant initialization has been done, like building up the UI and adding the AlbumBean album engine, jAlbum calls the init() method on each plugin. The init() method takes a PluginContext reference as parameter. This object allows you to interface with jAlbum and hook your plugin into various parts of the UI.

Get involved!

You can now contribute to a better jAlbum by improving and providing new plugins. Most plugins bundled with jAlbum are licensed under the liberal Apache v2 open source license. This means you can freely use code from them in other java projects or when making new jAlbum plugins.

To facilitate collaborative development, we have added the following plugins as Google Code projects. These projects have an issue tracker, Wiki and a Subversion revision control system for the source code:

For these projects to compile, have the jAlbum application installed in a "JAlbum" folder next to the folder you put a plugin project into.

Many plugins have been listed on this development forum page