From 7072990fd768402e394a1bd876b28ac2d1d1f460 Mon Sep 17 00:00:00 2001 From: Andreas Bayha <bayha@fortiss.org> Date: Tue, 29 Aug 2023 13:50:01 +0200 Subject: [PATCH] Diagram viewer: disabled grid by default The grid in the background of diagram editors is disabled by default, now. This also simplifies some AF3 classes (see respective branch there). Issue-ref: 4319 Issue-URL: https://git.fortiss.org/af3/af3/-/issues/4319 Signed-off-by: Andreas Bayha <bayha@fortiss.org> --- .../org/fortiss/tooling/common/ui/javafx/lwfxef/.ratings | 2 +- .../common/ui/javafx/lwfxef/DiagramViewerFeatures.java | 2 +- .../common/ui/javafx/lwfxef/controller/base/.ratings | 2 +- .../lwfxef/controller/base/DefaultDiagramController.java | 7 ++++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/.ratings b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/.ratings index 93b60bd54..711c8e714 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/.ratings +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/.ratings @@ -2,7 +2,7 @@ DiagramCoordinate.java 6b00aec99054d4cd19003a72bd4e5e774ac6a641 GREEN DiagramLayers.java aa1f95dbae290c8b00202abe4385b01b8f36e5ab GREEN DiagramViewer.java 73c3c0af460ef0631f4fc8a9d674eb6ebc804ca8 YELLOW DiagramViewerDefaultTags.java 6230763252409c60009ab8887b4ef582cf883229 GREEN -DiagramViewerFeatures.java 3dd78d9c117fc156924a151c6f8d770c53c103bc GREEN +DiagramViewerFeatures.java 8909375b7116fbd7386eb7d6d8c6f0618a0673ec YELLOW DiagramViewerSelection.java e833f592543bc97077907d980a39b123fc4044e6 GREEN EDragGesture.java 5cfa098d3877db11981c2750e5e103156d62fc5e GREEN FeedbackChange.java b088fa89af648f1674f2f9c1f7f99d585ce801ca GREEN diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/DiagramViewerFeatures.java b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/DiagramViewerFeatures.java index 3dd78d9c1..8909375b7 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/DiagramViewerFeatures.java +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/DiagramViewerFeatures.java @@ -51,7 +51,7 @@ public final class DiagramViewerFeatures { /** The flag for drawing the outer border, which occupies the first grid row and lane. */ private boolean drawOuterBorder = true; /** The indicator type. */ - private IndicatorType indicatorType = IndicatorType.CROSS; + private IndicatorType indicatorType = IndicatorType.INVISIBLE; /** The background color. */ private Color backgroundColor = LIGHTGRAY; /** The help text for the diagram viewer in-place help */ diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/controller/base/.ratings b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/controller/base/.ratings index fdb866d16..4d5eceb1c 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/controller/base/.ratings +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/controller/base/.ratings @@ -2,7 +2,7 @@ AnchorageContentControllerBase.java da56b10cbf2711b5da69f0b59f43eacbe54f4eea GRE ClickControllerBase.java 8e5861ed5f9318008ad0fdd5497ed320cd5bd647 GREEN ContentAnchorageMoveControllerBase.java c18e7915ce23e124757f5b736086ecc46694800a GREEN ControllerBase.java 9311521b252e46640e26d409610e527fd5ed6922 GREEN -DefaultDiagramController.java 3f60229b2e0fe0b6ac40c617858cc5a0685a59eb GREEN +DefaultDiagramController.java f0e8fbcf8201699cd6bf6ea79878d11f9ad62756 YELLOW DelegatingContentAnchorageController.java 1889628a346a2183082ffe213978f9d15a949494 GREEN DragControllerBase.java b15ff874304f679fe494d85f57cc8cbe4d0d1d15 GREEN DraggingUtils.java 95117e2ea4c36b6c6a31f8088bb95b484e0e6612 GREEN diff --git a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/controller/base/DefaultDiagramController.java b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/controller/base/DefaultDiagramController.java index 3f60229b2..f0e8fbcf8 100644 --- a/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/controller/base/DefaultDiagramController.java +++ b/org.fortiss.tooling.common.ui/src/org/fortiss/tooling/common/ui/javafx/lwfxef/controller/base/DefaultDiagramController.java @@ -83,11 +83,16 @@ public class DefaultDiagramController extends ControllerBase { private MenuItem createGridMenuItem(DiagramViewerFeatures features) { MenuItem gridMenuItem = null; if(features.getIndicatorType() == IndicatorType.INVISIBLE) { + gridMenuItem = new MenuItem("Show Grid"); + if(previousGridIndicatorType != null) { - gridMenuItem = new MenuItem("Show Grid"); gridMenuItem.setOnAction(evt -> { features.setIndicatorType(previousGridIndicatorType); }); + } else { + gridMenuItem.setOnAction(evt -> { + features.setIndicatorType(IndicatorType.CROSS); + }); } } else { gridMenuItem = new MenuItem("Hide Grid"); -- GitLab