Skip to content

Commit

Permalink
refreshDiagramAction may now change viewer options.
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRentzCAU committed Nov 5, 2024
1 parent d5ff27b commit fe13113
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* http://rtsys.informatik.uni-kiel.de/kieler
*
* Copyright 2018-2021 by
* Copyright 2018-2024 by
* + Kiel University
* + Department of Computer Science
* + Real-Time and Embedded Systems Group
Expand Down Expand Up @@ -40,6 +40,7 @@ import de.cau.cs.kieler.klighd.lsp.model.SKLabel
import de.cau.cs.kieler.klighd.lsp.model.SKNode
import de.cau.cs.kieler.klighd.lsp.model.SKPort
import de.cau.cs.kieler.klighd.lsp.utils.KGraphElementIdGenerator
import de.cau.cs.kieler.klighd.lsp.utils.KGraphMappingUtil
import de.cau.cs.kieler.klighd.lsp.utils.SprottyProperties
import de.cau.cs.kieler.klighd.util.KlighdPredicates
import de.cau.cs.kieler.klighd.util.KlighdProperties
Expand All @@ -60,7 +61,6 @@ import org.eclipse.sprotty.SPort
import org.eclipse.sprotty.xtext.IDiagramGenerator
import org.eclipse.xtend.lib.annotations.Accessors
import org.eclipse.xtext.util.CancelIndicator
import de.cau.cs.kieler.klighd.lsp.utils.KGraphMappingUtil

/**
* A diagram generator that can create Sprotty {@link SGraph} from any {@link Object} that has a registered view
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer {
* Tells the server that the diagram should be refreshed.
*/
protected def handle(RefreshDiagramAction action) {
getOptions().putAll(action.options)
updateDiagram()
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -18,6 +18,7 @@ package de.cau.cs.kieler.klighd.lsp.model

import de.cau.cs.kieler.klighd.krendering.KImage
import java.util.List
import java.util.Map
import java.util.Set
import java.util.function.Consumer
import org.eclipse.sprotty.Action
Expand Down Expand Up @@ -213,6 +214,8 @@ class RefreshDiagramAction implements Action {
public static val KIND = 'refreshDiagram'
String kind = KIND

Map<String, String> options

new() {}
new(Consumer<RefreshDiagramAction> initializer) {
initializer.accept(this)
Expand Down

0 comments on commit fe13113

Please sign in to comment.