diff options
author | 2023-09-12 21:59:50 +0200 | |
---|---|---|
committer | 2023-09-12 21:59:50 +0200 | |
commit | a2a4696fdbd6440269d576aeba7b25b2ea40d9bf (patch) | |
tree | 5cbdf981a51a09fbe162e7748555d213ca518ff4 /subprojects/language-semantics/src/main/java/tools | |
parent | fix: avoid GLOP error message on stderr (diff) | |
download | refinery-a2a4696fdbd6440269d576aeba7b25b2ea40d9bf.tar.gz refinery-a2a4696fdbd6440269d576aeba7b25b2ea40d9bf.tar.zst refinery-a2a4696fdbd6440269d576aeba7b25b2ea40d9bf.zip |
feat: connect model generator to UI
Diffstat (limited to 'subprojects/language-semantics/src/main/java/tools')
-rw-r--r-- | subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/metadata/MetadataCreator.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/metadata/MetadataCreator.java b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/metadata/MetadataCreator.java index 0c18b1b3..d6115c5c 100644 --- a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/metadata/MetadataCreator.java +++ b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/metadata/MetadataCreator.java | |||
@@ -47,12 +47,22 @@ public class MetadataCreator { | |||
47 | } | 47 | } |
48 | 48 | ||
49 | public List<NodeMetadata> getNodesMetadata() { | 49 | public List<NodeMetadata> getNodesMetadata() { |
50 | var nodes = new NodeMetadata[initializer.getNodeCount()]; | 50 | return getNodesMetadata(initializer.getNodeCount()); |
51 | } | ||
52 | |||
53 | public List<NodeMetadata> getNodesMetadata(int nodeCount) { | ||
54 | var nodes = new NodeMetadata[Math.max(initializer.getNodeCount(), nodeCount)]; | ||
51 | for (var entry : initializer.getNodeTrace().keyValuesView()) { | 55 | for (var entry : initializer.getNodeTrace().keyValuesView()) { |
52 | var node = entry.getOne(); | 56 | var node = entry.getOne(); |
53 | var id = entry.getTwo(); | 57 | var id = entry.getTwo(); |
54 | nodes[id] = getNodeMetadata(node); | 58 | nodes[id] = getNodeMetadata(node); |
55 | } | 59 | } |
60 | for (int i = 0; i < nodes.length; i++) { | ||
61 | if (nodes[i] == null) { | ||
62 | var nodeName = "#" + i; | ||
63 | nodes[i] = new NodeMetadata(nodeName, nodeName, NodeKind.IMPLICIT); | ||
64 | } | ||
65 | } | ||
56 | return List.of(nodes); | 66 | return List.of(nodes); |
57 | } | 67 | } |
58 | 68 | ||