Add missing license boiler plates

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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 unnecessarily

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.

While at it, we avoid reading the configuration file when it does not
exist in the first place.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Make the default fill color of overlays visible

Instead of making them 0% opaque, we set them to 25%. That way,
it will be obvious what parts of a composite overlay are 'in'.

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

This also includes a first stab at supporting tool switching in SWT,
although it is only compile-tested.

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

While at it, rename it to 'SwingPointFigure' to point out that it relies
on Swing.

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 SwingPo{int,lygon}Figure 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>
OverlayHarmonizer: turn ShapeRois into GeneralPathOverlays

While at it, simplify the OverlayHarmonizerTest.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Show GeneralPathOverlays via JHotDraw

This commit adds a JHotDraw tool that embeds JHotDraw's Beziér tool to
show and interact with composite ("GeneralPath") overlays.

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