Skip to content

Commit

Permalink
load persisted data on graph elements in KGraph Synthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRentzCAU committed Mar 14, 2024
1 parent 1b1ece7 commit 68e3f60
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import de.cau.cs.kieler.klighd.SynthesisOption
import de.cau.cs.kieler.klighd.kgraph.EMapPropertyHolder
import de.cau.cs.kieler.klighd.kgraph.KEdge
import de.cau.cs.kieler.klighd.kgraph.KGraphData
import de.cau.cs.kieler.klighd.kgraph.KGraphElement
import de.cau.cs.kieler.klighd.kgraph.KNode
import de.cau.cs.kieler.klighd.kgraph.KPort
import de.cau.cs.kieler.klighd.kgraph.util.KGraphDataUtil
Expand Down Expand Up @@ -64,9 +65,10 @@ class KGraphDiagramSynthesis extends AbstractStyledDiagramSynthesis<KNode> {

// The next two definitions are used to load possibly persisted klighd information
// that is ignored by ELK, e.g. the expansion state of nodes
private static val PREDICATE_IS_KGRAPHDATA = new Predicate<EMapPropertyHolder>() {
private static val PREDICATE_IS_KGRAPH_OR_DATA = new Predicate<EMapPropertyHolder>() {
override apply(EMapPropertyHolder input) {
return input instanceof KGraphData;
return input instanceof KGraphData
|| input instanceof KGraphElement;
}
}
private static val KNOWN_PROPS = ImmutableList.of(KlighdProperties.EXPAND,
Expand Down Expand Up @@ -158,7 +160,7 @@ class KGraphDiagramSynthesis extends AbstractStyledDiagramSynthesis<KNode> {
// but until now nobody knows about any persisted entries that originate from KLighD.
// First, this might be the expansion state of nodes. Second, also KRendering elements
// may carry persisted entries that have to be parsed before we build the view model.
KGraphDataUtil.loadDataElements(result, PREDICATE_IS_KGRAPHDATA, KNOWN_PROPS)
KGraphDataUtil.loadDataElements(result, PREDICATE_IS_KGRAPH_OR_DATA, KNOWN_PROPS)

// Evaluate the defaults property
try {
Expand Down

0 comments on commit 68e3f60

Please sign in to comment.