Document the purpose of the LegacyEventDelegator class

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
DummyLegacyService: fix runLegacyCommand

The runLegacyCommand() method expects a class name as first argument,
not a command name.

While at it, move things into the IJ1Helper class, in line with the goal
that no ImageJ 1.x classes need to be imported when loading the
DummyLegacyService class.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Handle the LegacyOutputTrackers in LegacyImageMap

... instead of the DefaultLegacyService. Because it should be
LegacyImageMap's business to handle the synchronization with the legacy
images.

It also changes the behavior in that the output trackers are being left
alone in legacy mode.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ij-legacy: call LegacyImageMap#registerLegacyImage directly

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Get rid of LegacyService#legacyImageChanged

We should not require loading ImageJ 1.x classes just to load the
legacy service class (or for that matter, DummyLegacyService).

It all boils down to separating concerns properly: the LegacyImageMap's
*only* purpose is to synchronize images between legacy and modern
state, so we really should not put logic to that extent somewhere else.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
DefaultLegacyService: do not import ImagePlus any longer

We really want to separate things more cleanly, so let's keep all
imports of ImageJ 1.x classes out most of the ij-legacy classes
(IJ1Helper and LegacyImageMap being notable exceptions: they *need*
to interact with ImageJ 1.x classes, in the case of IJ1Helper
introducing a layer between legacy and modern code so that modern
code does not need to load legacy classes immediately, helping code
patching for example).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Avoid using ImageJ 1.x classes in LegacyHeadless directly

This commit pushes more code that interacts with ImageJ 1.x directly into the IJ1Helper class.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge branch 'legacy-image'

The purpose of the 'legacy-image' branch was to separate ImageJ 1.x
classes better from the classes in ij-legacy. The only direct users of
said classes which are left are:

	IJ1Helper, LegacyImageMap, LegacyOutputTracker,
	OptionsSynchronizer, SwitchToModernMode

apart from classes in the patches, plugin and translate sub-packages.

Most notably, the following classes do *not* import ImageJ 1.x classes:

	CodeHacker, DefaultLegacyService, DummyLegacyService,
	LegacyExtensions, LegacyHeadless, LegacyInjector,
	LegacyJavaAgent, LegacyService, Utils

The intention behind that separation is to help clean up ij-legacy in
the sense of having a better idea what class serves which purpose, and
also to avoid interfering with the code patching required to let the
legacy service run properly (e.g. when the core ij-legacy classes are
loaded before the code patching could happen).

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