diff --git a/build/de.cau.cs.kieler.klighd.repository/category.xml b/build/de.cau.cs.kieler.klighd.repository/category.xml
index 7d0c7f9d5..5216ede61 100644
--- a/build/de.cau.cs.kieler.klighd.repository/category.xml
+++ b/build/de.cau.cs.kieler.klighd.repository/category.xml
@@ -60,8 +60,6 @@
-
-
@@ -69,5 +67,4 @@
-
diff --git a/build/de.cau.cs.kieler.klighd.repository/pom.xml b/build/de.cau.cs.kieler.klighd.repository/pom.xml
index eb94937db..cfa0d42fc 100644
--- a/build/de.cau.cs.kieler.klighd.repository/pom.xml
+++ b/build/de.cau.cs.kieler.klighd.repository/pom.xml
@@ -63,8 +63,6 @@
https://xtext.github.io/download/updates/releases/2.1.1/>
https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/release/4.30.0
-
- https://rtsys.informatik.uni-kiel.de/~kieler/updatesite/sprotty/0.9.0/
siteTemplate
diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target
index 3d08e692f..2a3c0eccd 100644
--- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target
+++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target
@@ -43,9 +43,5 @@
-
-
-
-
\ No newline at end of file
diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target
index 8f00f2b0c..fc4b1e392 100644
--- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target
+++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target
@@ -47,9 +47,5 @@
-
-
-
-
\ No newline at end of file
diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target
index d1f752741..8c9f1fff6 100644
--- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target
+++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target
@@ -47,9 +47,5 @@
-
-
-
-
\ No newline at end of file
diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target
index 9ec8e1d19..19e50c619 100644
--- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target
+++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target
@@ -43,9 +43,5 @@
-
-
-
-
\ No newline at end of file
diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ide/build.properties b/plugins/de.cau.cs.kieler.kgraph.text.ide/build.properties
index 6b74f11c3..d7ab75e9c 100644
--- a/plugins/de.cau.cs.kieler.kgraph.text.ide/build.properties
+++ b/plugins/de.cau.cs.kieler.kgraph.text.ide/build.properties
@@ -4,3 +4,5 @@ source.. = src-gen/,\
output.. = bin/
bin.includes = META-INF/,\
.
+bin.excludes = **/*.xtend,\
+ **/*.java._trace
diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ui/build.properties b/plugins/de.cau.cs.kieler.kgraph.text.ui/build.properties
index e86a412e6..1a12796b4 100644
--- a/plugins/de.cau.cs.kieler.kgraph.text.ui/build.properties
+++ b/plugins/de.cau.cs.kieler.kgraph.text.ui/build.properties
@@ -6,4 +6,6 @@ bin.includes = META-INF/,\
about.html,\
icons/,\
plugin.xml
+bin.excludes = **/*.xtend,\
+ **/*.java._trace
diff --git a/plugins/de.cau.cs.kieler.kgraph.text/build.properties b/plugins/de.cau.cs.kieler.kgraph.text/build.properties
index 160c5b09a..56e82316d 100644
--- a/plugins/de.cau.cs.kieler.kgraph.text/build.properties
+++ b/plugins/de.cau.cs.kieler.kgraph.text/build.properties
@@ -6,3 +6,7 @@ bin.includes = model/generated/,\
about.html,\
.,\
plugin.xml
+bin.excludes = **/*.xtend,\
+ **/*.mwe2,\
+ **/*.xtext,\
+ **/*.java._trace
diff --git a/plugins/de.cau.cs.kieler.klighd.ide/build.properties b/plugins/de.cau.cs.kieler.klighd.ide/build.properties
index 74b70cb95..ba5f2edfe 100644
--- a/plugins/de.cau.cs.kieler.klighd.ide/build.properties
+++ b/plugins/de.cau.cs.kieler.klighd.ide/build.properties
@@ -6,3 +6,5 @@ bin.includes = META-INF/,\
plugin.xml,\
about.html,\
icons/
+bin.excludes = **/*.xtend,\
+ **/*.java._trace
diff --git a/plugins/de.cau.cs.kieler.klighd.krendering.extensions/build.properties b/plugins/de.cau.cs.kieler.klighd.krendering.extensions/build.properties
index 2a2eb15f7..4069920ae 100644
--- a/plugins/de.cau.cs.kieler.klighd.krendering.extensions/build.properties
+++ b/plugins/de.cau.cs.kieler.klighd.krendering.extensions/build.properties
@@ -4,3 +4,5 @@ output.. = bin/
bin.includes = META-INF/,\
about.html,\
.
+bin.excludes = **/*.xtend,\
+ **/*.java._trace
diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/.classpath b/plugins/de.cau.cs.kieler.klighd.lsp/.classpath
index 7cd7b128b..59a498ec0 100644
--- a/plugins/de.cau.cs.kieler.klighd.lsp/.classpath
+++ b/plugins/de.cau.cs.kieler.klighd.lsp/.classpath
@@ -5,8 +5,28 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/.project b/plugins/de.cau.cs.kieler.klighd.lsp/.project
index 27cf23a80..918374c6f 100644
--- a/plugins/de.cau.cs.kieler.klighd.lsp/.project
+++ b/plugins/de.cau.cs.kieler.klighd.lsp/.project
@@ -15,16 +15,6 @@
-
- org.eclipse.pde.ManifestBuilder
-
-
-
-
- org.eclipse.pde.SchemaBuilder
-
-
-
org.eclipse.m2e.core.maven2Builder
@@ -35,6 +25,5 @@
org.eclipse.jdt.core.javanature
org.eclipse.xtext.ui.shared.xtextNature
org.eclipse.m2e.core.maven2Nature
- org.eclipse.pde.PluginNature
diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.core.resources.prefs b/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.core.resources.prefs
index 7a5313928..505845e4f 100644
--- a/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.core.resources.prefs
+++ b/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.core.resources.prefs
@@ -1,3 +1,4 @@
eclipse.preferences.version=1
encoding/=UTF-8
encoding/src=UTF-8
+encoding/xtend-gen=UTF-8
diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.xtend.core.Xtend.prefs b/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.xtend.core.Xtend.prefs
index 56e3bbe88..2b65c6b65 100644
--- a/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.xtend.core.Xtend.prefs
+++ b/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.xtend.core.Xtend.prefs
@@ -2,5 +2,7 @@ BuilderConfiguration.is_project_specific=true
eclipse.preferences.version=1
outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true
outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false
+outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen
outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen
+outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen
outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true
diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/build.properties b/plugins/de.cau.cs.kieler.klighd.lsp/build.properties
index bf12396e8..d41815c23 100644
--- a/plugins/de.cau.cs.kieler.klighd.lsp/build.properties
+++ b/plugins/de.cau.cs.kieler.klighd.lsp/build.properties
@@ -5,5 +5,6 @@ bin.includes = .,\
plugin.xml,\
about.html
META-INF/,
-bin.excludes = **/*.xtend
+bin.excludes = **/*.xtend,\
+ **/*.java._trace
src.includes = about.html
diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/pom.xml b/plugins/de.cau.cs.kieler.klighd.lsp/pom.xml
index f674dc6cf..442f4c4de 100644
--- a/plugins/de.cau.cs.kieler.klighd.lsp/pom.xml
+++ b/plugins/de.cau.cs.kieler.klighd.lsp/pom.xml
@@ -10,7 +10,6 @@
de.cau.cs.kieler.klighd.lsp
- eclipse-plugin
KIELER Lightweight Diagrams as Language Server
KIELER Lightweight Diagrams as Language Server
diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend
index 16516a6bd..512d7e1f3 100644
--- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend
+++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend
@@ -3,7 +3,7 @@
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
- * Copyright 2018-2022 by
+ * Copyright 2018-2024 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
@@ -16,7 +16,6 @@
*/
package de.cau.cs.kieler.klighd.lsp
-import com.google.common.base.Strings
import com.google.common.base.Throwables
import com.google.common.io.ByteStreams
import com.google.inject.Inject
@@ -27,7 +26,6 @@ import de.cau.cs.kieler.klighd.Klighd
import de.cau.cs.kieler.klighd.KlighdDataManager
import de.cau.cs.kieler.klighd.ViewContext
import de.cau.cs.kieler.klighd.kgraph.KNode
-import de.cau.cs.kieler.klighd.lsp.launch.AbstractLanguageServer
import de.cau.cs.kieler.klighd.lsp.model.CheckImagesAction
import de.cau.cs.kieler.klighd.lsp.model.CheckedImagesAction
import de.cau.cs.kieler.klighd.lsp.model.DisplayedActionUIData
@@ -63,18 +61,7 @@ import org.eclipse.elk.graph.properties.IProperty
import org.eclipse.emf.ecore.EObject
import org.eclipse.sprotty.Action
import org.eclipse.sprotty.ActionMessage
-import org.eclipse.sprotty.ComputedBoundsApplicator
-import org.eclipse.sprotty.IDiagramExpansionListener
-import org.eclipse.sprotty.IDiagramOpenListener
-import org.eclipse.sprotty.IDiagramSelectionListener
-import org.eclipse.sprotty.ILayoutEngine
-import org.eclipse.sprotty.IModelUpdateListener
-import org.eclipse.sprotty.IPopupModelFactory
-import org.eclipse.sprotty.LayoutAction
import org.eclipse.sprotty.RejectAction
-import org.eclipse.sprotty.RequestBoundsAction
-import org.eclipse.sprotty.RequestModelAction
-import org.eclipse.sprotty.SModelCloner
import org.eclipse.sprotty.SModelElement
import org.eclipse.sprotty.SModelRoot
import org.eclipse.sprotty.SelectAction
@@ -90,7 +77,6 @@ import org.eclipse.xtend.lib.annotations.Accessors
* @author nre
*/
class KGraphDiagramServer extends LanguageAwareDiagramServer {
- static val LOG = Logger.getLogger(KGraphDiagramServer)
@Inject protected Injector injector
@@ -121,29 +107,13 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer {
@Accessors(PUBLIC_GETTER)
protected Object modelLock = new Object
- /**
- * Needed for KeithUpdateModelAction
- *
- * FIXME Remove this if UpdateModelAction has a cause.
- */
- protected String lastSubmittedModelType
-
- /**
- * Needed for KeithUpdateModelAction
- *
- * FIXME Remove this if UpdateModelAction has a cause.
- */
- protected int revision = 0
-
/**
* Needed for KeithUpdateModelAction
*
* FIXME Remove this if UpdateModelAction has a cause.
*/
new() {
- currentRoot = new SModelRoot();
- currentRoot.setType("NONE");
- currentRoot.setId("ROOT");
+ super()
// Create map of registered action kinds and handlers.
ServiceLoader.load(ISprottyActionHandler, KlighdDataManager.getClassLoader()).forEach[handler |
val Set kindsSupported = handler.supportedMessages.keySet
@@ -280,151 +250,6 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer {
notificationHandler.sendErrorAndThrow(e)
}
}
-
- /**
- * Submit a new or updated model to the client. If client layout is required, a {@link RequestBoundsAction}
- * is sent, otherwise either a {@link SetModelAction} or an {@link UpdateModelAction} is sent depending on
- * the {@code update} parameter.
- * Needed for KeithUpdateModelAction
- *
- * FIXME Remove this if UpdateModelAction has a cause.
- */
- override CompletableFuture submitModel(SModelRoot newRoot, boolean update, Action cause) {
- if (needsClientLayout(newRoot)) {
- if (!needsServerLayout(newRoot, cause)) {
- // In this case the client won't send us the computed bounds
- dispatch(new RequestBoundsAction(newRoot));
- val IModelUpdateListener listener = getModelUpdateListener();
- if (listener !== null) {
- listener.modelSubmitted(newRoot, this);
- }
- } else {
- return request(new RequestBoundsAction(newRoot)).handle([response, exception | {
- if (exception !== null) {
- LOG.error("RequestBoundsAction failed with an exception.", exception);
- } else {
- try {
- var SModelRoot model = handle(response);
- if (model !== null)
- doSubmitModel(model, true, cause);
- } catch (Exception exc) {
- LOG.error("Exception while processing ComputedBoundsAction.", exc);
- }
- }
- return null;
- }])
- }
- } else {
- doSubmitModel(newRoot, update, cause);
- }
- return CompletableFuture.completedFuture(null);
- }
-
- /**
- * Needed for KeithUpdateModelAction
- *
- * FIXME Remove this if UpdateModelAction has a cause.
- */
- override CompletableFuture setModel(SModelRoot newRoot) {
- if (newRoot === null)
- throw new NullPointerException();
- synchronized(modelLock) {
- newRoot.setRevision(revision + 1);
- revision++
- currentRoot = newRoot;
- }
- return submitModel(newRoot, false, null);
- }
-
- /**
- * Needed for KeithUpdateModelAction
- *
- * FIXME Remove this if UpdateModelAction has a cause.
- */
- override CompletableFuture updateModel(SModelRoot newRoot) {
- if (newRoot === null)
- throw new IllegalArgumentException("updateModel() cannot be called with null");
- synchronized(modelLock) {
- currentRoot = newRoot;
- newRoot.setRevision(revision + 1);
- revision++
- }
- return submitModel(newRoot, true, null);
- }
-
-
- /**
- * Needed for KeithUpdateModelAction
- *
- * FIXME Remove this if UpdateModelAction has a cause.
- */
- def void doSubmitModel(SModelRoot newRoot, boolean update, Action cause) {
- val ILayoutEngine layoutEngine = getLayoutEngine();
- if (needsServerLayout(newRoot, cause)) {
- AbstractLanguageServer.addToMainThreadQueue([
- layoutEngine.layout(newRoot, cause)
- ])
- }
- synchronized (modelLock) {
- if (newRoot.getRevision() == revision) {
- var String modelType = newRoot.getType();
- if (cause instanceof RequestModelAction
- && !Strings.isNullOrEmpty((cause as RequestModelAction).getRequestId())) {
- var RequestModelAction request = cause as RequestModelAction;
- var SetModelAction response = new SetModelAction(newRoot);
- response.setResponseId(request.getRequestId());
- dispatch(response);
- } else if (update && modelType !== null && modelType.equals(lastSubmittedModelType)) {
- dispatch(new UpdateModelAction(newRoot));
- } else {
- dispatch(new SetModelAction(newRoot));
- }
- lastSubmittedModelType = modelType;
- var IModelUpdateListener listener = getModelUpdateListener();
- if (listener !== null) {
- listener.modelSubmitted(newRoot, this);
- }
- }
- }
- }
-
- /**
- * Taken from {@code DefaultDiagramServer.handle(RequestModelAction)} to use this getModel.
- * Needed for KeithUpdateModelAction
- *
- * FIXME Remove this if UpdateModelAction has a cause.
- */
- override protected handle(RequestModelAction request) {
- if (model.type == 'NONE' && diagramLanguageServer !== null) {
- if (!request.requestId.nullOrEmpty)
- LOG.warn("Model requests are not supported by the Xtext diagram server.")
- copyOptions(request)
- diagramLanguageServer.diagramUpdater.updateDiagram(this)
- } else {
- super.handle(request)
- }
- }
-
- /**
- * Taken from {@code DefaultDiagramServer.handle(LayoutAction)} to use this getModel.
- * Needed for KeithUpdateModelAction
- *
- * FIXME Remove this if UpdateModelAction has a cause.
- */
- override void handle(LayoutAction action) {
- if (needsServerLayout(model,action)) {
- // Clone the current model, as it has already been sent to the client with the old revision
- val SModelCloner cloner = getSModelCloner();
- val SModelRoot newRoot = cloner.clone(model);
- synchronized(modelLock) {
- newRoot.setRevision(revision + 1);
- revision++
- currentRoot = newRoot;
- }
- // the actual layout is performed in doSubmitModel
- doSubmitModel(newRoot, true, action);
- }
- }
/**
* Called when a {@link PerformActionAction} is received.
@@ -645,57 +470,4 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer {
}
newModel = false
}
-
- /**
- * Needed for KeithUpdateModelAction
- *
- * FIXME Remove this if UpdateModelAction has a cause.
- */
- override SModelRoot getModel() {
- return currentRoot;
- }
-
- // Repeat injection of multiple methods of the DefaultDiagramServer as the javax.inject->jakarta.inject transition
- // broke something here.
- // TODO: remove when not necessary anymore
-
- @Inject
- override setModelUpdateListener(IModelUpdateListener listener) {
- super.modelUpdateListener = listener;
- }
-
- @Inject
- override setLayoutEngine(ILayoutEngine engine) {
- super.layoutEngine = engine;
- }
-
- @Inject
- override setComputedBoundsApplicator(ComputedBoundsApplicator computedBoundsApplicator) {
- super.computedBoundsApplicator = computedBoundsApplicator;
- }
-
- @Inject
- override setPopupModelFactory(IPopupModelFactory factory) {
- super.popupModelFactory = factory;
- }
-
- @Inject
- override setSelectionListener(IDiagramSelectionListener listener) {
- super.selectionListener = listener;
- }
-
- @Inject
- override setExpansionListener(IDiagramExpansionListener diagramExpansionListener) {
- super.expansionListener = diagramExpansionListener;
- }
-
- @Inject
- override setOpenListener(IDiagramOpenListener diagramOpenListener) {
- super.openListener = diagramOpenListener;
- }
-
- @Inject
- override setSModelCloner(SModelCloner smodelCloner) {
- super.SModelCloner = smodelCloner;
- }
}
diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramUpdater.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramUpdater.xtend
index 9755d54f2..7c6905338 100644
--- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramUpdater.xtend
+++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramUpdater.xtend
@@ -3,7 +3,7 @@
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
- * Copyright 2019, 2020, 2021 by
+ * Copyright 2019-2024 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
@@ -37,10 +37,12 @@ import java.util.Map
import java.util.concurrent.CompletableFuture
import org.eclipse.emf.common.util.URI
import org.eclipse.emf.ecore.EObject
+import org.eclipse.sprotty.Action
import org.eclipse.sprotty.IDiagramServer
import org.eclipse.sprotty.SGraph
import org.eclipse.sprotty.SModelElement
import org.eclipse.sprotty.xtext.ILanguageAwareDiagramServer
+import org.eclipse.sprotty.xtext.LanguageAwareDiagramServer
import org.eclipse.sprotty.xtext.ls.DiagramLanguageServer
import org.eclipse.sprotty.xtext.ls.DiagramUpdater
import org.eclipse.xtext.util.CancelIndicator
@@ -137,7 +139,19 @@ class KGraphDiagramUpdater extends DiagramUpdater {
}
override protected doUpdateDiagrams(String uri, List extends ILanguageAwareDiagramServer> diagramServers) {
- if (diagramServers.empty) {
+ diagramServers.forEach[updateDiagram(it as LanguageAwareDiagramServer, null)]
+ return CompletableFuture.completedFuture(null)
+ }
+
+ override updateDiagram(LanguageAwareDiagramServer server_, Action cause) {
+ if (!(server_ instanceof KGraphDiagramServer)) return super.updateDiagram(server_, cause)
+
+ val server = server_ as KGraphDiagramServer
+ val uri = server.sourceUri
+ if (uri.isNullOrEmpty) {
+ val exc = new RuntimeException("Missing property 'sourceUri'.")
+ server.rejectRemoteRequest(cause, exc)
+// LOG.error("Failed to update diagram.", exc)
return CompletableFuture.completedFuture(null)
}
return (languageServer as KGraphLanguageServerExtension).doRead(uri) [ resource, ci |
@@ -166,16 +180,13 @@ class KGraphDiagramUpdater extends DiagramUpdater {
new StringBuilder, [builder, error | builder.append("\n" + error)]).toString
model = new MessageModel("The model contains errors:\n" + errors)
}
- val model_ = model;
- (diagramServers as List).forEach [ KGraphDiagramServer server |
- // Only update an erroneous model if there was no diagram shown before.
- if (!hasErrors || server.currentRoot.type == "NONE") {
- synchronized (diagramState) {
- prepareModel(server, model_, uri)
- updateLayout(server)
- }
+ // Only update an erroneous model if there was no diagram shown before.
+ if (!hasErrors || server.currentRoot.type == "NONE") {
+ synchronized (diagramState) {
+ prepareModel(server, model, uri)
+ updateLayout(server)
}
- ]
+ }
return null as Void
]
}
diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLanguageServerExtension.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLanguageServerExtension.xtend
index 087b62b7b..4d707ad41 100644
--- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLanguageServerExtension.xtend
+++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLanguageServerExtension.xtend
@@ -134,8 +134,7 @@ class KGraphLanguageServerExtension extends SyncDiagramLanguageServer
override accept(ActionMessage message) {
if (message.action instanceof RequestModelAction) {
val action = message.action as RequestModelAction
- val diagramType = action.diagramType
- ?: action.options.get(DiagramOptions.OPTION_DIAGRAM_TYPE)
+ val diagramType = action.options.get(DiagramOptions.OPTION_DIAGRAM_TYPE)
val server = diagramServerManager.getDiagramServer(diagramType, message.clientId)
// If a diagram server is requested for the same client, but a different source file, then close the old server.
// If the server does not have options yet, the server has not been used yet and does not need to be relaunched.
diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLayoutEngine.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLayoutEngine.xtend
index 68be39e76..ff598dc4e 100644
--- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLayoutEngine.xtend
+++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLayoutEngine.xtend
@@ -3,7 +3,7 @@
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
- * Copyright 2018-2023 by
+ * Copyright 2018-2024 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
@@ -18,6 +18,7 @@ package de.cau.cs.kieler.klighd.lsp
import com.google.inject.Inject
import de.cau.cs.kieler.klighd.LightDiagramLayoutConfig
+import de.cau.cs.kieler.klighd.lsp.launch.AbstractLanguageServer
import de.cau.cs.kieler.klighd.lsp.utils.KGraphMappingUtil
import de.cau.cs.kieler.klighd.lsp.utils.RenderingPreparer
import java.io.ByteArrayOutputStream
@@ -48,16 +49,18 @@ class KGraphLayoutEngine extends ElkLayoutEngine {
public static val LOG = Logger.getLogger(KGraphLayoutEngine)
override layout(SModelRoot root, Action cause) {
- synchronized (diagramState) {
- if (root instanceof SGraph) {
- // The layout is executed on the KGraph, not the SGraph. So get the KGraph belonging to this SGraph from
- // the KGraphContext.
- onlyLayoutOnKGraph(root.id)
-
- // map layouted KGraph to SGraph
- KGraphMappingUtil.mapLayout(diagramState.getKGraphToSModelElementMap(root.id))
+ AbstractLanguageServer.addToMainThreadQueue([
+ synchronized (diagramState) {
+ if (root instanceof SGraph) {
+ // The layout is executed on the KGraph, not the SGraph. So get the KGraph belonging to this SGraph from
+ // the KGraphContext.
+ onlyLayoutOnKGraph(root.id)
+
+ // map layouted KGraph to SGraph
+ KGraphMappingUtil.mapLayout(diagramState.getKGraphToSModelElementMap(root.id))
+ }
}
- }
+ ])
}
/**
diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/model/Actions.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/model/Actions.xtend
index 75aa467b6..6682e4dbd 100644
--- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/model/Actions.xtend
+++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/model/Actions.xtend
@@ -239,36 +239,6 @@ class RefreshLayoutAction implements Action {
}
}
-/**
- * Updates the model and sends the cause to the client.
- * Extends to UpdateModelAction.
- * FIXME Remove this if the UpdateModelAction includes a cause.
- *
- * @author sdo
- */
-@Accessors
-@EqualsHashCode
-@ToString(skipNulls = true)
-public class KeithUpdateModelAction extends UpdateModelAction {
- public static val KIND = 'updateModel'
- String kind = KIND
-
-
- SModelRoot newRoot
- Boolean animate
- Action cause
-
- new() {}
- new(Consumer initializer) {
- initializer.accept(this)
- }
-
- new(SModelRoot newRoot, Action cause) {
- this.newRoot = newRoot
- this.cause = cause
- }
-}
-
/**
* Sent from client to request a certain piece of the diagram.
*
diff --git a/plugins/de.cau.cs.kieler.klighd.ui.wizard/build.properties b/plugins/de.cau.cs.kieler.klighd.ui.wizard/build.properties
index f07c6a911..f9b252e9c 100644
--- a/plugins/de.cau.cs.kieler.klighd.ui.wizard/build.properties
+++ b/plugins/de.cau.cs.kieler.klighd.ui.wizard/build.properties
@@ -7,3 +7,5 @@ bin.includes = META-INF/,\
plugin.xml,\
about.html
src.includes = about.html
+bin.excludes = **/*.xtend,\
+ **/*.java._trace
diff --git a/pom.xml b/pom.xml
index 8a6fd02f4..37b93201a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -56,8 +56,8 @@
32.1.3-jre
7.0.0
3.32.0
- 0.21.1
- 0.9.0
+ 0.22.0
+ 1.1.1
0.1.0
3.124.200
2.7.3