POM: add a dependency on scripting-java

We will need this because that component will soon have a new plugin
type for defining how to execute particular classes. In our case, we are
interested in implementing a JavaRunner for legacy ImageJ 1.x plugins.
Bump pom-imagej to 2.12

This updates the version of scripting-java to the 0.2.0 release, which
contains the new JavaRunner plugin type that we need.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a JavaRunner for ImageJ 1.x plugins
Switch to non-deprecated ij1-patcher classes

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Avoid NullPointerException

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyJavaRunner: Handle PlugInFilter, too

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
LegacyJavaRunner: make it work

Unfortunately, we cannot simply hand off to the LegacyService to run
the legacy command because the class is most likely not known to the
PluginClassLoader of ImageJ 1.x.

For now, let's punt and run the class directly (as we used to do in
Fiji's Refresh_Javas plugin). To allow compiling & running classes
that might be known to the PluginClassLoader, we will most likely
jump through hoops. That's next.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge remote-tracking branch 'origin/overengineered-goodness'

This 'overengineered' goodness

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Organize imports

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Safeguard against uninitialized ImageJ 1.x

There is a bug in ij1-patcher 0.4.2 that prevents ImageJ 1.x from being
initialized properly when running

	IJ.runPlugIn("ij.IJ.init", "");

Even though we have fixed this in ij1-patcher, let's safeguard against
this problem for the future.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add an interactive test for the legacy mode

This new test lets you start up ImageJ2 in legacy mode, for interactive
playing around and testing. You can execute it with

	mvn exec:java -Dexec.mainClass=imagej.legacy.TestDrive \
		-Dexec.classpathScope=test

or in Eclipse

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Fix tyop in Javadoc

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Use ImageJ2 logo in legacy mode

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Create LegacyUI

Create a new ImageJ2 UserInterface implementation: the LegacyUI.

This UI acts as a bridge between ImageJ2 and ImageJ1 - it will only be
active when there is an active ImageJ instance.

The intent of this UI is to handle the display of ImageJ2 command output
via ImageJ1, and to facilitate ImageJ2 commands operating on ImageJ1
structures (such as outputting ImagePluses).
Create ActiveImagePlusPreprocessor

Provides a method to harvest ImagePlus @Parameter inputs.
Create LegacyCompatibleCommand

Adds a marker class for IJ2 commands that should also be added to the
IJ1 menu when in legacy mode.
Create LegacyStatusBar

Adds an ImageJ2 adapter for the ImageJ1 status bar.
Create LegacyDialogPrompt

Adds an ImageJ2 adaptor for the ImageJ1 dialog prompt.
Create LegacyToolbar

Adds an ImageJ2 adaptor for the ImageJ1 toolbar.
Create LegacyApplicationFrame

Adds and ImageJ2 adaptor for the ImageJ1 application frame (that is, the
actual IJ window).