Add API to obtain the current ImageJ version

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Introduce a function to compare ImageJ 1.x' peculiar versions

Due to the scheme that sees versions like 1.49c13 before 1.49c, let
alone 1.49 final, a simple String comparison is unfortunately not good
enough.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a way to guard patches against certain ImageJ 1.x versions

The ij1-patcher has to work with a wide range of ImageJ 1.x versions.
The reason is simple: every once in a while, previously working plugins
stop working because ImageJ 1.x development is not *quite* as
backwards-compatible as it could be. In such cases, users are basically
stuck with older versions, leading to the famous 'ImageJ icon gallery'
on the desktop.

Sometimes ImageJ 1.x changes crucially so that completely different
fixes are needed for different versions. To that end, we introduce a
function that lets you verify that the current ImageJ 1.x version is at
least the specified one, for conditional patching.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Teach ImageJ 1.x to be careful when adding images into the Window menu

When ImageJ 1.x adds images to the Window menu, it does not care whether
there were already some plugin installed or not; it always appends the
new menu item. Instead, it should insert the correct position.

This fixes https://github.com/imagej/imagej-legacy/issues/68.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge pull request #30 from imagej/window-menu

Fix the issue when Window menu items are not removed upon closing images