Skip to content

Commit e71d388

Browse files
committed
Ensure system properties are refreshed in Simulator when loaded
1 parent ec3ebd1 commit e71d388

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/main/java/nl/utwente/groove/gui/SimulatorModel.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,7 @@ private void setEnabled(ResourceKind kind, Set<QualName> names) throws IOExcepti
166166
}
167167
getStore().putGraphs(ResourceKind.RULE, newRules, false);
168168
break;
169-
case HOST:
170-
case TYPE:
171-
case PROLOG:
172-
case CONTROL:
169+
case HOST, TYPE, PROLOG, CONTROL:
173170
GrammarProperties newProperties = getGrammar().getProperties().clone();
174171
List<QualName> actives = new ArrayList<>(newProperties.getActiveNames(kind));
175172
actives.sort(null);
@@ -181,7 +178,6 @@ private void setEnabled(ResourceKind kind, Set<QualName> names) throws IOExcepti
181178
newProperties.setActiveNames(kind, actives);
182179
getStore().putProperties(newProperties);
183180
break;
184-
case PROPERTIES:
185181
default:
186182
throw Exceptions.UNREACHABLE;
187183
}

src/main/java/nl/utwente/groove/gui/action/LoadSystemPropertiesAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ public void load(File propertiesFile) throws IOException, FormatException {
5353
try (InputStream s = new FileInputStream(propertiesFile)) {
5454
properties.load(s);
5555
}
56+
properties.check(getGrammarModel());
5657
properties = properties.repairVersion().addDerivedProperties(grammarPath);
57-
getGrammarModel().setProperties(properties);
58+
getSimulatorModel().doSetProperties(properties);
5859
}
5960
}

0 commit comments

Comments
 (0)