From 6e42148e5237e10c18f812fcd2527cdae03c720d Mon Sep 17 00:00:00 2001 From: Max Kasperowski Date: Mon, 16 Dec 2024 12:44:04 +0100 Subject: [PATCH] remove old edge sections and update jsonwrapper (#1104) --- .../src/org/eclipse/elk/graph/json/JsonAdapter.xtend | 8 ++++++++ .../src/org/eclipse/elk/graph/json/JsonImporter.xtend | 1 + 2 files changed, 9 insertions(+) diff --git a/plugins/org.eclipse.elk.graph.json/src/org/eclipse/elk/graph/json/JsonAdapter.xtend b/plugins/org.eclipse.elk.graph.json/src/org/eclipse/elk/graph/json/JsonAdapter.xtend index dd2e145c5d..581a1a5876 100644 --- a/plugins/org.eclipse.elk.graph.json/src/org/eclipse/elk/graph/json/JsonAdapter.xtend +++ b/plugins/org.eclipse.elk.graph.json/src/org/eclipse/elk/graph/json/JsonAdapter.xtend @@ -186,6 +186,14 @@ final class JsonAdapter { } } + // - - - - - - - - - - - - - - - - - - - + // Remove members from a json object + // - - - - - - - - - - - - - - - - - - - + + def void removeJsonObj(JsonObject o, String element) { + o.remove(element) + } + // - - - - - - - - - - - - - - - - - - - // Add to a json array // - - - - - - - - - - - - - - - - - - - diff --git a/plugins/org.eclipse.elk.graph.json/src/org/eclipse/elk/graph/json/JsonImporter.xtend b/plugins/org.eclipse.elk.graph.json/src/org/eclipse/elk/graph/json/JsonImporter.xtend index 7990e0f7ff..94286d2f29 100644 --- a/plugins/org.eclipse.elk.graph.json/src/org/eclipse/elk/graph/json/JsonImporter.xtend +++ b/plugins/org.eclipse.elk.graph.json/src/org/eclipse/elk/graph/json/JsonImporter.xtend @@ -627,6 +627,7 @@ final class JsonImporter { } ] + jsonObj.removeJsonObj("sections") jsonObj.addJsonObj("sections", sections) }