From 94d2c2c3673bdd801c17597af95f1121d2750a14 Mon Sep 17 00:00:00 2001 From: Alexander Pann Date: Mon, 16 Sep 2024 09:06:17 +0200 Subject: [PATCH 1/3] editor.diagram: add support for grid snapping --- CHANGELOG.md | 1 + .../languageModels/editor.mps | 50 + .../languageModels/editor.mps | 14 + .../generator/template/main@generator.mps | 466 ++++++ .../languageModels/behavior.mps | 58 + .../languageModels/editor.mps | 95 ++ .../languageModels/structure.mps | 34 + .../editor/diagram/demoentities/sandbox.mps | 4 +- .../mps/editor/diagram/runtime/jgraph.mps | 1465 ++++++++++++++--- .../mps/editor/diagram/runtime/model.mps | 101 ++ .../de.itemis.mps.extensions.changelog.mps | 110 ++ 11 files changed, 2131 insertions(+), 267 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 519128c65..e95898f0c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is *loosely* based on [Keep a Changelog](https://keepachangelog.com/e ### Added +- *de.itemis.mps.editor.diagram*: Diagrams can now show a grid that is used for snapping elements to it. It can be configured (visibility, grid snapping, grid color/size) in the editor definition of the diagram itself. - A module stub solution *MPS.Kotlin* was added to support referencing Kotlin classes and libraries from MPS.ThirdParty. ## August 2024 diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram.demoentities/languageModels/editor.mps b/code/diagram/languages/de.itemis.mps.editor.diagram.demoentities/languageModels/editor.mps index a6eb9b7f5..8d7c144e7 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram.demoentities/languageModels/editor.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram.demoentities/languageModels/editor.mps @@ -14,6 +14,7 @@ + @@ -58,6 +59,7 @@ + @@ -93,6 +95,7 @@ + @@ -124,6 +127,9 @@ + + + @@ -162,6 +168,9 @@ + + + @@ -219,6 +228,10 @@ + + + + @@ -880,6 +893,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram.styles/languageModels/editor.mps b/code/diagram/languages/de.itemis.mps.editor.diagram.styles/languageModels/editor.mps index 377492249..529e774f8 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram.styles/languageModels/editor.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram.styles/languageModels/editor.mps @@ -469,6 +469,20 @@ + + + + + + + + + + + + + + diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram/generator/template/main@generator.mps b/code/diagram/languages/de.itemis.mps.editor.diagram/generator/template/main@generator.mps index 8a29e185d..611405ac2 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram/generator/template/main@generator.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram/generator/template/main@generator.mps @@ -6161,6 +6161,112 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6627,6 +6733,300 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -16790,6 +17190,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/behavior.mps b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/behavior.mps index 609e6738b..f3865b9a8 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/behavior.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/behavior.mps @@ -10473,6 +10473,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/editor.mps b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/editor.mps index 41c35cf49..75c40173e 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/editor.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/editor.mps @@ -1179,6 +1179,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5822,6 +5879,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/structure.mps b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/structure.mps index bb442e11e..2d4f976df 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/structure.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/structure.mps @@ -216,6 +216,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -2194,6 +2218,16 @@ + + + + + + + + + + diff --git a/code/diagram/solutions/de.itemis.mps.editor.diagram.demoentities.sandbox/models/de/itemis/mps/editor/diagram/demoentities/sandbox.mps b/code/diagram/solutions/de.itemis.mps.editor.diagram.demoentities.sandbox/models/de/itemis/mps/editor/diagram/demoentities/sandbox.mps index 2c37b2791..bc522299d 100644 --- a/code/diagram/solutions/de.itemis.mps.editor.diagram.demoentities.sandbox/models/de/itemis/mps/editor/diagram/demoentities/sandbox.mps +++ b/code/diagram/solutions/de.itemis.mps.editor.diagram.demoentities.sandbox/models/de/itemis/mps/editor/diagram/demoentities/sandbox.mps @@ -488,11 +488,11 @@ - + - + diff --git a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps index fa7c88b07..d4cd6d7e6 100644 --- a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps +++ b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps @@ -135,7 +135,7 @@ - + @@ -23957,11 +23957,39 @@ - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -24472,6 +24500,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -27987,6 +28035,27 @@ + + + + + + + + + + + + + + + + + + + + + @@ -28047,14 +28116,43 @@ - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -30785,7 +30883,7 @@ - + @@ -67781,15 +67879,13 @@ - - - - - - - - + + + + + + @@ -88675,26 +88771,18 @@ - - - - - - - - - + + + + + + - - - - - - - - - - + + + + + @@ -88712,7 +88800,7 @@ - + @@ -88802,6 +88890,25 @@ + + + + + + + + + + + + + + + + + + + @@ -88822,6 +88929,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -88830,39 +88970,31 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + - - + + @@ -88884,23 +89016,28 @@ - - - - - - - + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -89037,8 +89174,11 @@ - - + + + + + @@ -89071,9 +89211,6 @@ - - - @@ -89092,6 +89229,12 @@ + + + + + + @@ -89574,6 +89717,9 @@ + + + @@ -89797,153 +89943,24 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + - - @@ -89981,6 +89998,12 @@ + + + + + + @@ -90042,7 +90065,7 @@ - + @@ -90144,7 +90167,7 @@ - + @@ -90360,7 +90383,7 @@ - + @@ -90391,7 +90414,7 @@ - + @@ -90422,7 +90445,7 @@ - + @@ -90473,7 +90496,7 @@ - + @@ -90505,7 +90528,7 @@ - + @@ -90536,7 +90559,7 @@ - + @@ -90569,7 +90592,7 @@ - + @@ -90642,13 +90665,106 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -90682,7 +90798,7 @@ - + @@ -90722,7 +90838,7 @@ - + @@ -90758,7 +90874,7 @@ - + @@ -147121,24 +147237,15 @@ - + - - - - - - - - - - - - - - + + + + + - + @@ -147171,7 +147278,49 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -148912,5 +149061,791 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/model.mps b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/model.mps index f0f278a5a..8902ab49f 100644 --- a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/model.mps +++ b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/model.mps @@ -17592,6 +17592,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -29402,6 +29429,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/solutions/de.itemis.mps.extensions.changelog/models/de.itemis.mps.extensions.changelog.mps b/code/solutions/de.itemis.mps.extensions.changelog/models/de.itemis.mps.extensions.changelog.mps index 6cbbc3f9e..5f09cb735 100644 --- a/code/solutions/de.itemis.mps.extensions.changelog/models/de.itemis.mps.extensions.changelog.mps +++ b/code/solutions/de.itemis.mps.extensions.changelog/models/de.itemis.mps.extensions.changelog.mps @@ -234,6 +234,116 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 593c4143fc6c9aee0450e1e6e29683afbd067de9 Mon Sep 17 00:00:00 2001 From: Alexander Pann Date: Mon, 16 Sep 2024 09:44:28 +0200 Subject: [PATCH 2/3] force save all --- .../generator/template/main@generator.mps | 4 ++-- .../itemis/mps/editor/diagram/runtime/jgraph.mps | 16 ++++++++-------- .../itemis/mps/editor/diagram/runtime/model.mps | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram/generator/template/main@generator.mps b/code/diagram/languages/de.itemis.mps.editor.diagram/generator/template/main@generator.mps index 611405ac2..a6eef4ee4 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram/generator/template/main@generator.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram/generator/template/main@generator.mps @@ -6899,7 +6899,7 @@ - + @@ -6947,7 +6947,7 @@ - + diff --git a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps index d4cd6d7e6..7eb059d63 100644 --- a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps +++ b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps @@ -88906,7 +88906,7 @@ - + @@ -149207,7 +149207,7 @@ - + @@ -149220,7 +149220,7 @@ - + @@ -149235,13 +149235,13 @@ - + - + @@ -149280,7 +149280,7 @@ - + @@ -149293,7 +149293,7 @@ - + @@ -149322,7 +149322,7 @@ - + diff --git a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/model.mps b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/model.mps index 8902ab49f..60d6ecded 100644 --- a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/model.mps +++ b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/model.mps @@ -29440,7 +29440,7 @@ - + @@ -29454,7 +29454,7 @@ - + @@ -29470,7 +29470,7 @@ - + @@ -29500,7 +29500,7 @@ - + From 12bdc3a229a31e4d279f3f20c155fb25ef4bd9e9 Mon Sep 17 00:00:00 2001 From: Alexander Pann Date: Tue, 17 Sep 2024 08:51:47 +0200 Subject: [PATCH 3/3] diagram: implement the option to set the grid style --- .../languageModels/editor.mps | 6 +- .../generator/template/main@generator.mps | 87 +++++++++++++++++++ .../languageModels/editor.mps | 13 +++ .../languageModels/structure.mps | 30 +++++++ .../mps/editor/diagram/runtime/jgraph.mps | 13 +++ .../mps/editor/diagram/runtime/model.mps | 25 ++++++ 6 files changed, 172 insertions(+), 2 deletions(-) diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram.demoentities/languageModels/editor.mps b/code/diagram/languages/de.itemis.mps.editor.diagram.demoentities/languageModels/editor.mps index 8d7c144e7..60eb77349 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram.demoentities/languageModels/editor.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram.demoentities/languageModels/editor.mps @@ -224,6 +224,7 @@ + @@ -490,6 +491,7 @@ + @@ -896,8 +898,8 @@ - - + + diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram/generator/template/main@generator.mps b/code/diagram/languages/de.itemis.mps.editor.diagram/generator/template/main@generator.mps index a6eef4ee4..2762d1286 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram/generator/template/main@generator.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram/generator/template/main@generator.mps @@ -68,7 +68,9 @@ + + @@ -101,6 +103,9 @@ + + + @@ -140,6 +145,7 @@ + @@ -265,6 +271,10 @@ + + + + @@ -275,6 +285,10 @@ + + + + @@ -6879,6 +6893,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/editor.mps b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/editor.mps index 75c40173e..6b04ced6d 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/editor.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/editor.mps @@ -1222,6 +1222,19 @@ + + + + + + + + + + + + + diff --git a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/structure.mps b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/structure.mps index 2d4f976df..5753fb3d9 100644 --- a/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/structure.mps +++ b/code/diagram/languages/de.itemis.mps.editor.diagram/languageModels/structure.mps @@ -124,6 +124,11 @@ + + + + + @@ -5095,5 +5100,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps index 7eb059d63..a8ca78721 100644 --- a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps +++ b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/jgraph.mps @@ -28157,6 +28157,19 @@ + + + + + + + + + + + + + diff --git a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/model.mps b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/model.mps index 60d6ecded..f6a94dea2 100644 --- a/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/model.mps +++ b/code/diagram/solutions/de.itemis.mps.editor.diagram.runtime/models/de/itemis/mps/editor/diagram/runtime/model.mps @@ -54,6 +54,7 @@ + @@ -17611,6 +17612,12 @@ + + + + + + @@ -29473,6 +29480,24 @@ + + + + + + + + + + + + + + + + + +