| Summary: | ChopboxAnchor.IComputationStrategy.Impl#getAnchorageReferenceGeometryInLocal() needs to evaluate visual outline rather than geometric outline. | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Alexander Nyßen <nyssen> |
| Component: | GEF FX | Assignee: | gef-inbox <gef-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | matthias.wienand |
| Version: | 0.2.0 | ||
| Target Milestone: | 4.0.0 / 3.11.0 (Neon) M5 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
|
Description
Alexander Nyßen
The computation needed here will be equal to the one sketched for the VisualOutlineGeometryProvider (see bug #483710). I refactored the ChopBoxAnchor.IComputationStrategy.Impl so that anchor positions can also be computed for anchorages with a visual of type JavaFX Shape, as well as for GeometryNodes with a Path geometry. During the refactoring, I performed the following changes: - In order to determine the anchorage geometry it was necessary to convert from JavaFX Shape to GEF4 Geometry. The conversions are provided within 2 utility classes: Geometry2Shape, and Shape2Geometry. - In order to determine the outline of a Path geometry, I added a Path#getOutlines() method that returns one ICurve per Path.Segment. In this context, I also fixed a NPE when calling CubicCurve#equals(null). - The ShapeOutlineProvider (i.e. VisualOutlineGeometryProvider) is implemented by resizing the geometric outline of a JavaFX Node to fit the node's layout-bounds. The same computation is used to expand the anchorage geometry to the anchorage's layout-bounds. For this purpose, I changed the visibility of GeometryNode#resizeGeometry() to public. However, this mechanic is only successful if the stroke around the geometry is uniform. Nonetheless, I extracted this functionality to a method within the NodeUtils utility class. The ChopBoxAnchor and the ShapeOutlineProvider both use this method. - When determining the layout-bounds of a JavaFX Node, a compensation has to be performed for JavaFX bug 8145499 (https://bugs.openjdk.java.net/browse/JDK-8145499). This compensation was already provided within Connection#getShapeBounds(). I moved the method to the NodeUtils utility class. - To demonstrate the new capabilities of the ChopBoxAnchor, I added a ChopBoxShapeSnippet. The code is published on the master branch. Therefore, I resolve this ticket as fixed for 3.11.0M5. |