OverlayHarmonizer: avoid use of deprecated class 'Log'

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Create IJ1 Rois before running the first legacy command

We need to take care to make sure that everything is ready for the legacy
command before it runs. That includes the Roi (if any), even if we just
fired up the first legacy command of this session (i.e. even if the
harmonizer was just initialized and had no ImagePlus for any ImageDisplay
yet).

While at it, consolidate duplicated code into a common code path.

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

This is a companion commit to 192365bd(Allow overlays to be duplicated
and move).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
ConfigFileParameters: avoid constructing File objects over and
over again

When working with files, we should hand around references to File
objects rather than absolute paths from which we have to construct
File objects anyway before we can work with them.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Let SWTToolBar have a reference to the UIService

This avoids a deprecated call to ImageJ.getContext().

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Avoid using the deprecated Log class in the toolbars

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Allow tools to be active before the toolbars are created

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
As in IJ1, make the rectangle tool active by default

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a class to work with JHotDraw BezierPaths

This class adds functions to convert java.awt.Shape (via PathIterators)
into BezierPaths.

We will use this to perform constructive area geometry (in particular,
subtraction of ROIs) thanks to AWT's Area class.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Factor out PointFigure into its own file

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Factor out PolygonFigure into its own file

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Avoid casts of JHotDraw-type Figures

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Require all JHotDraw Figure adapters to return an AWT-style Shape

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Move PointFigure and PolygonFigure into ui-swing

These two classes implement JHotDraw-style figures and at least
PolygonFigure needs to live in the same project (or a dependency) as
IJBezierTool for safe typing (to be done in the next commit).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Only use fully-qualified IJHotDrawOverlayAdapter references

... except for the sezpoz discovery, which cannot qualify in full (there
is no way to specify IJHotDrawOverlayAdapter<?>.class).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add an overlay for GeneralPathOfInterest instances

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
WIP: OverlayHarmonizer: turn ShapeRois into GeneralPathOverlays
WIP: Show GeneralPathOverlays via JHotDraw

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Legacy: convert traced and free-hand ROIs into polygon overlays

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

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