Starting from 2021-07-01, all LRZ GitLab users will be required to explicitly accept the GitLab Terms of Service. Please see the detailed information at https://doku.lrz.de/display/PUBLIC/GitLab and make sure that your projects conform to the requirements.

Commit c4a56750 authored by Stefan Schuhbaeck's avatar Stefan Schuhbaeck
Browse files

Merge branch 'master-fix'

parents 1feef8f6 fe4c839e
Pipeline #71452 failed with stages
in 66 minutes and 59 seconds
......@@ -2,6 +2,7 @@
target/
*.out
*.preferences.xml
swing-inspector-linux-1.2.3/
#Tools and build utils
bin/
......
......@@ -305,32 +305,46 @@ TopographyCreator.btnMakro.tooltip=Generate not set IDs.
select_shape_tooltip=Select Shape
# TopographyChecker
TopographyChecker.type.error=Error
TopographyChecker.type.warning=Warning
TopographyChecker.source.targetIdNotFound=The following target ids where not found in the scenario.
TopographyChecker.source.noTargetIdSet=No Target Ids set for Source.
TopographyChecker.source.noTargetIdAndNoSpawn=No Target Ids set for Source with SpawnNumber 0. This might be an error.
TopographyChecker.source.idNotUnique=Multiple Sources have the same ID.
TopographyChecker.stairs.wrongTreadDim=Stair treadDepth outside of allowed dimension.
TopographyChecker.target.unused=The target is not used in any source. Remove target to increase performance.
TopographyChecker.pedestrian.speedsetup=speedDistributionMean must be within min/max range.
TopographyChecker.pedestrian.speedNotLogical=Min or Max speed of pedestrian is bigger than world record.
TopographyChecker.pedestrian.speedIsNegative=Min or Max speed is negative.
TopographyChecker.overlap.stair.stair=Stairs cannot overlap.
TopographyChecker.overlap.target.stair=A target and a stairs element overlap in scenario.
TopographyChecker.overlap.source.stair=A source and a stairs element overlap in scenario.
TopographyChecker.overlap.source.target=A source and a target element overlap in scenario.
TopographyChecker.overlap.source.source=Two source overlap. This can cause overlapping when useFreeSpaceOnly is not set.
TopographyChecker.overlap.target.target=Two targets overlap.
TopographyChecker.overlap.obstacle.stairs.err=Stairs is completely contained in an obstacle.
TopographyChecker.overlap.obstacle.stairs.warn=Stairs contains an obstacle. This setup works put is not tested. Split in two stairs.
TopographyChecker.overlap.obstacle.target.err=Target is completely contained in an obstacle.
TopographyChecker.overlap.obstacle.target.warn=Target contains an obstacle. This setup works but reduces the actual size of the target.
TopographyChecker.overlap.obstacle.source=Obstacle overlaps with a source. This setup will spawn pedestrians within the obstacle.
TopographyChecker.overlap.obstacle.obstacle=Two obstacles overlap / is enclosed completely. Delete one for better performance.
# ScenarioChecker
ScenarioChecker.type.error=Error
ScenarioChecker.type.warning=Warning
ScenarioChecker.type.topography.error=Topography Error
ScenarioChecker.type.topography.warning=Topography Warning
ScenarioChecker.type.simulation.error=Simulations Attribute Error
ScenarioChecker.type.simulation.warning=Simulations Attribute Warning
ScenarioChecker.type.model.error=Model Attribute Error
ScenarioChecker.type.model.warning=Model Attribute Warning
ScenarioChecker.type.processor.error=Processor Error
ScenarioChecker.type.processor.warning=Processor Warning
ScenarioChecker.source.targetIdNotFound=The following target ids where not found in the scenario.
ScenarioChecker.source.noTargetIdSet=No Target Ids set for Source.
ScenarioChecker.source.noTargetIdAndNoSpawn=No Target Ids set for Source with SpawnNumber 0. This might be an error.
ScenarioChecker.source.idNotUnique=Multiple Sources have the same ID.
ScenarioChecker.stairs.wrongTreadDim=Stair treadDepth outside of allowed dimension. Change the thread numbers to compensate.
ScenarioChecker.target.unused=The target is not used in any source. Remove target to increase performance.
ScenarioChecker.pedestrian.speedsetup=speedDistributionMean must be within min/max range.
ScenarioChecker.pedestrian.speedNotLogical=Min or Max speed of pedestrian is bigger than world record.
ScenarioChecker.pedestrian.speedIsNegative=Min or Max speed is negative.
ScenarioChecker.overlap.stair.stair=Stairs cannot overlap.
ScenarioChecker.overlap.target.stair=A target and a stairs element overlap in scenario.
ScenarioChecker.overlap.source.stair=A source and a stairs element overlap in scenario.
ScenarioChecker.overlap.source.target=A source and a target element overlap in scenario.
ScenarioChecker.overlap.source.source=Two source overlap. This can cause overlapping when useFreeSpaceOnly is not set.
ScenarioChecker.overlap.target.target=Two targets overlap.
ScenarioChecker.overlap.obstacle.stairs.err=Stairs is completely contained in an obstacle.
ScenarioChecker.overlap.obstacle.stairs.warn=Stairs contains an obstacle. This setup works put is not tested. Split in two stairs.
ScenarioChecker.overlap.obstacle.target.err=Target is completely contained in an obstacle.
ScenarioChecker.overlap.obstacle.target.warn=Target contains an obstacle. This setup works but reduces the actual size of the target.
ScenarioChecker.overlap.obstacle.source=Obstacle overlaps with a source. This setup will spawn pedestrians within the obstacle.
ScenarioChecker.overlap.obstacle.obstacle=Two obstacles overlap / is enclosed completely. Delete one for better performance.
ScenarioChecker.simAttr.simTimeStepWrong=simTimeStep parameter outside of allowed range
ScenarioChecker.msg.ok=Scenario ok.
ScenarioChecker.msg.warn=Scenario contains warnings.
ScenarioChecker.msg.err=Scenario contains errors.
# tab titles Topography creator / postvis
Tab.Simulation.title=Simulation
......
......@@ -297,31 +297,46 @@ TopographyCreator.btnRectangle.label=Rechteck
TopographyCreator.btnChecker.tooltip=Topography Linter Nachrichten
TopographyCreator.btnMakro.tooltip=Erzeuge nicht gesetzte IDs.
# TopographyChecker
TopographyChecker.type.error=Fehler
TopographyChecker.type.warning=Warnung
TopographyChecker.source.targetIdNotFound=Die folgenden Ziel-IDs wurden nicht im Szenario gefunden.
TopographyChecker.source.noTargetIdSet=In der Quelle wurden keine Ziel Ids vergeben.
TopographyChecker.source.noTargetIdAndNoSpawn=In der Quelle wurden keine Ziel Ids vergeben, aber die Spawn Anzahl ist bei 0.
TopographyChecker.source.idNotUnique=Quellen haben keine eindeutige ID.
TopographyChecker.stairs.wrongTreadDim=Stufentiefe ist au\u00dferhalb des Definitionsbereichs.
TopographyChecker.target.unused=Das Ziel wird von keiner Quelle verwendet. Entferne das Ziel um die Performance zu erh\u00f6hen
TopographyChecker.pedestrian.speedsetup=speedDistributionMean muss im Bereich min/max liegen.
TopographyChecker.pedestrian.speedNotLogical=Min or Max Geschwindigkeit ist gr\u00f6\u00dfer als Weltrekord.
TopographyChecker.pedestrian.speedIsNegative=Min or Max Geschwindigkeit ist negativ.
TopographyChecker.overlap.stair.stair=Treppen d\u00fcrfen nicht \u00fcberlappen.
TopographyChecker.overlap.target.stair=Ein Ziel und eine Treppen \u00fcberlappen im Scenario.
TopographyChecker.overlap.source.stair=Eine Quelle und eine Treppe \u00fcberlappen im Scenario.
TopographyChecker.overlap.source.target=Eine Quelle und eine Ziel \u00fcberappen im Scenario.
TopographyChecker.overlap.source.source=Zwei Quellen \u00fcberlappen. Wenn useFreeSpaceOnly nicht gesetzt ist kann dies zu \u00fcberlappungen von Pedestrians f\u00fchren.
TopographyChecker.overlap.target.target=Zwei Ziele \u00fcberlappen.
TopographyChecker.overlap.obstacle.stairs.err=Treppe ist komplett in einem Hinderniss eingeschossen.
TopographyChecker.overlap.obstacle.stairs.warn=Treppe hat ein Hinderiss in sich. Dies ist m\u00f6glich aber nicht getestet. Wenn m\u00f6glich in zwei treppen aufteilen.
TopographyChecker.overlap.obstacle.target.err=Ziel ist komplett in einem Hinderniss eingeschlossen
TopographyChecker.overlap.obstacle.target.warn=Ziel hat ein Hinderniss in sich. Dies ist m\u00f6glich reduziert aber die tats\u00c4chliche Fl\u00c4che des Ziels.
TopographyChecker.overlap.obstacle.source=Hinderniss \u00fcberdeckt Quelle. Die f\u00fchrt dazu, dass Pedestrians im Hinderniss erzeugt werden.
TopographyChecker.overlap.obstacle.obstacle=Zwei identische bzw. eingeschlossene Obstacles gefunden. L\u00f6sche eins f\u00fcr bessere Performance
# ScenarioChecker
ScenarioChecker.type.error=Error
ScenarioChecker.type.warning=Warning
ScenarioChecker.type.topography.error=Topography Fehler
ScenarioChecker.type.topography.warning=Topography Warnung
ScenarioChecker.type.simulation.error=Simulations Attribut Fehler
ScenarioChecker.type.simulation.warning=Simulations Attribut Wahrnung
ScenarioChecker.type.model.error=Model Attribute Fehler
ScenarioChecker.type.model.warning=Model Attribute Warnung
ScenarioChecker.type.processor.error=Processor Fehler
ScenarioChecker.type.processor.warning=Procesor Warnung
ScenarioChecker.source.targetIdNotFound=Die folgenden Ziel-IDs wurden nicht im Szenario gefunden.
ScenarioChecker.source.noTargetIdSet=In der Quelle wurden keine Ziel Ids vergeben.
ScenarioChecker.source.noTargetIdAndNoSpawn=In der Quelle wurden keine Ziel Ids vergeben, aber die Spawn Anzahl ist bei 0.
ScenarioChecker.source.idNotUnique=Quellen haben keine eindeutige ID.
ScenarioChecker.stairs.wrongTreadDim=Stufentiefe ist au\u00dferhalb des Definitionsbereichs. Passen Sie die Anzahl der Stufen entsprechend an.
ScenarioChecker.target.unused=Das Ziel wird von keiner Quelle verwendet. Entferne das Ziel um die Performance zu erh\u00f6hen
ScenarioChecker.pedestrian.speedsetup=speedDistributionMean muss im Bereich min/max liegen.
ScenarioChecker.pedestrian.speedNotLogical=Min or Max Geschwindigkeit ist gr\u00f6\u00dfer als Weltrekord.
ScenarioChecker.pedestrian.speedIsNegative=Min or Max Geschwindigkeit ist negativ.
ScenarioChecker.overlap.stair.stair=Treppen d\u00fcrfen nicht \u00fcberlappen.
ScenarioChecker.overlap.target.stair=Ein Ziel und eine Treppen \u00fcberlappen im Scenario.
ScenarioChecker.overlap.source.stair=Eine Quelle und eine Treppe \u00fcberlappen im Scenario.
ScenarioChecker.overlap.source.target=Eine Quelle und eine Ziel \u00fcberappen im Scenario.
ScenarioChecker.overlap.source.source=Zwei Quellen \u00fcberlappen. Wenn useFreeSpaceOnly nicht gesetzt ist kann dies zu \u00fcberlappungen von Pedestrians f\u00fchren.
ScenarioChecker.overlap.target.target=Zwei Ziele \u00fcberlappen.
ScenarioChecker.overlap.obstacle.stairs.err=Treppe ist komplett in einem Hinderniss eingeschossen.
ScenarioChecker.overlap.obstacle.stairs.warn=Treppe hat ein Hinderiss in sich. Dies ist m\u00f6glich aber nicht getestet. Wenn m\u00f6glich in zwei treppen aufteilen.
ScenarioChecker.overlap.obstacle.target.err=Ziel ist komplett in einem Hinderniss eingeschlossen
ScenarioChecker.overlap.obstacle.target.warn=Ziel hat ein Hinderniss in sich. Dies ist m\u00f6glich reduziert aber die tats\u00c4chliche Fl\u00c4che des Ziels.
ScenarioChecker.overlap.obstacle.source=Hinderniss \u00fcberdeckt Quelle. Die f\u00fchrt dazu, dass Pedestrians im Hinderniss erzeugt werden.
ScenarioChecker.overlap.obstacle.obstacle=Zwei identische bzw. eingeschlossene Obstacles gefunden. L\u00f6sche eins f\u00fcr bessere Performance
ScenarioChecker.simAttr.simTimeStepWrong=simTimeStep Parameter au\u00dferhalb des Definitionsbereichs
ScenarioChecker.msg.ok=Scenario ok.
ScenarioChecker.msg.warn=Scenario hat Warnungen.
ScenarioChecker.msg.err=Scenario ist Fehlerhaft.
# tab titles Topography creator / postvis
Tab.Simulation.title=Simulation
......
package org.vadere.gui.components.control;
import org.vadere.gui.projectview.view.ScenarioNamePanel;
import org.vadere.gui.projectview.view.ScenarioPanel;
import org.vadere.gui.projectview.view.VDialogManager;
import org.vadere.gui.topographycreator.model.IDrawPanelModel;
import org.vadere.simulator.projects.Scenario;
import org.vadere.simulator.util.ScenarioChecker;
import org.vadere.simulator.util.ScenarioCheckerMessage;
import java.awt.event.ActionEvent;
import java.util.Observable;
import java.util.Observer;
import java.util.PriorityQueue;
import javax.swing.*;
public class ActionScenarioChecker extends AbstractAction implements Observer {
private PriorityQueue<ScenarioCheckerMessage> messages;
private ScenarioCheckerMessageDocumentView msgDocument;
private IDrawPanelModel model;
private ScenarioNamePanel view;
public
ActionScenarioChecker(String name, ScenarioNamePanel view) {
super(name);
this.messages = new PriorityQueue<>();
this.view = view;
}
/**
* Handel click on traffic light icon and show all ScenarioChecker messages generated for the
* current state of the topography.
*/
@Override
public void actionPerformed(ActionEvent e) {
VDialogManager.showMessageDialogWithBodyAndTextEditorPane(
"Topography Checker",
"The following problems where found",
msgDocument,
JOptionPane.INFORMATION_MESSAGE
);
}
public void observerModel(IDrawPanelModel model){
model.addObserver(this);
this.model = model;
}
/**
* After each change of the Topography which yields a valid json representation check run the
* {@link ScenarioChecker} and change the icon respectively. This function also creates the
* message document presented in various dialog windows.
*/
@Override
public void update(Observable o, Object arg) {
if(model != null){
check(model.getScenario());
}
}
public void check(final Scenario scenario){
ScenarioChecker checker = new ScenarioChecker(scenario);
messages.clear();
ScenarioPanel.setActiveTopographyErrorMsg(null);
messages = checker.checkBuildingStep();
msgDocument = new ScenarioCheckerMessageDocumentView(model);
msgDocument.setMessages(messages);
view.setGreen();
if (messages.size() > 0){
if(messages.peek().getMsgType().isWarnMsg()) {
view.setYellow();
}
if (messages.peek().getMsgType().isErrorMsg()) {
view.setRed();
ScenarioPanel.setActiveTopographyErrorMsg(msgDocument);
}
}
}
}
package org.vadere.gui.components.control;
import org.vadere.gui.components.utils.GuiScenarioCheckerMessageFormatter;
import org.vadere.gui.topographycreator.model.IDrawPanelModel;
import org.vadere.simulator.util.ScenarioCheckerMessage;
import org.vadere.simulator.util.ScenarioCheckerMessageFormatter;
import org.vadere.state.scenario.ScenarioElement;
import java.util.HashMap;
import java.util.PriorityQueue;
import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
public class ScenarioCheckerMessageDocumentView extends JEditorPane {
private final IDrawPanelModel model;
private final ScenarioCheckerMessageFormatter formatter;
HashMap<String, ScenarioElement> linkMap;
int id;
public ScenarioCheckerMessageDocumentView(IDrawPanelModel model) {
this.model = model;
this.formatter = new GuiScenarioCheckerMessageFormatter(this);
linkMap = new HashMap<>();
id = 0;
setContentType("text/html");
setEditable(false);
addHyperlinkListener(e -> {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
ScenarioElement element = linkMap.getOrDefault(e.getDescription(), null);
if (element != null && this.model != null) {
this.model.setSelectedElement(element);
}
}
});
}
public void setMessages(PriorityQueue<ScenarioCheckerMessage> messages){
setText(formatter.formatMessages(messages));
}
public int makeLink(ScenarioElement element) {
int currId = id;
id++;
linkMap.put("element/id/" + currId, element);
return currId;
}
}
package org.vadere.gui.components.utils;
import org.vadere.gui.components.control.ScenarioCheckerMessageDocumentView;
import org.vadere.simulator.util.AbstractScenarioCheckerMessageFormatter;
import org.vadere.simulator.util.ScenarioCheckerMessage;
import org.vadere.simulator.util.ScenarioCheckerMessageType;
import org.vadere.state.types.ScenarioElementType;
import java.util.Comparator;
import java.util.PriorityQueue;
public class GuiScenarioCheckerMessageFormatter extends AbstractScenarioCheckerMessageFormatter {
final ScenarioCheckerMessageDocumentView view;
boolean currentTypeChanged;
String currTabString;
boolean currTabStringChanged;
public GuiScenarioCheckerMessageFormatter(ScenarioCheckerMessageDocumentView view) {
this.view = view;
currentTypeChanged = false;
currTabStringChanged = false;
currentType = null;
currTabString = null;
}
/**
* Sort messages by tabs based on gui view
* @return
*/
@Override
protected Comparator<ScenarioCheckerMessage> getComparator() {
return ScenarioCheckerMessage::compareOrdinal;
}
@Override
protected boolean isNewType(ScenarioCheckerMessage msg) {
String tabString = getTabName(msg.getMsgType());
if (currTabString == null || !currTabString.equals(tabString)){
currTabString = tabString;
currTabStringChanged = true;
} else {
currTabStringChanged = false;
}
if (currentType == null || !currentType.equals(msg.getMsgType())){
currentType = msg.getMsgType();
currentTypeChanged = true;
} else {
currentTypeChanged = false;
}
return currentTypeChanged || currTabStringChanged;
}
private String getTabName(ScenarioCheckerMessageType type){
String ret="";
switch (type){
case TOPOGRAPHY_ERROR: case TOPOGRAPHY_WARN:
ret = Messages.getString("Tab.Topography.title");
break;
case DATA_PROCESSOR_ERROR: case DATA_PROCESSOR_WARN:
ret = Messages.getString("Tab.OutputProcessors.title");
break;
case MODEL_ATTR_ERROR: case MODEL_ATTR_WARN:
ret = Messages.getString("Tab.Model.title");
break;
case SIMULATION_ATTR_ERROR: case SIMULATION_ATTR_WARN:
ret = Messages.getString("Tab.Simulation.title");
break;
}
return ret;
}
@Override
protected void writeHeader(ScenarioCheckerMessage msg) {
if (currTabStringChanged){
if(sb.length() > 0){
sb.append("<br>");
}
sb.append("<h3>")
.append(currTabString)
.append(" Tab")
.append("</h3>");
}
if (currentTypeChanged){
sb.append("<h4>")
.append(Messages.getString(msg.getMsgType().getLocalTypeId()))
.append("</h4>");
}
}
@Override
protected void writeMsg(ScenarioCheckerMessage msg) {
if (msg.hasTarget()){
sb.append("[");
msg.getMsgTarget().getTargets().forEach(element -> {
int id = view.makeLink(element);
sb.append("<a href='element/id/")
.append(id).append("'>")
.append(element.getClass().getSimpleName())
.append("{Id:").append(element.getId()).append("}")
.append("</a>");
sb.append(", ");
});
sb.setLength(sb.length()-2);
sb.append("] ");
}
sb.append("Reason: ").append(Messages.getString(msg.getReason().getLocalMessageId()));
if (!msg.getReasonModifier().isEmpty()) {
sb.append(" ").append(msg.getReasonModifier());
}
sb.append("<br>");
}
}
......@@ -83,7 +83,7 @@ public class Resources {
properties.load(in);
} catch (IOException e) {
e.printStackTrace();
logger.error("error while loading properties for application: " + applicationName);
logger.error("topographyError while loading properties for application: " + applicationName);
} finally {
try {
in.close();
......
package org.vadere.gui.components.view;
import org.vadere.gui.projectview.view.AttributeType;
import org.vadere.gui.projectview.view.TextView;
import org.vadere.state.scenario.ScenarioElement;
import java.util.HashMap;
import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
public class ScenarioCheckerView extends JEditorPane {
}
\ No newline at end of file
......@@ -14,7 +14,6 @@ import org.vadere.gui.projectview.view.ProjectView;
import org.vadere.gui.projectview.view.ScenarioPanel;
import org.vadere.gui.topographycreator.model.AgentWrapper;
import org.vadere.gui.topographycreator.model.TopographyCreatorModel;
import org.vadere.simulator.util.TopographyChecker;
import org.vadere.state.attributes.Attributes;
import org.vadere.state.scenario.Pedestrian;
import org.vadere.state.scenario.ScenarioElement;
......
......@@ -139,7 +139,7 @@ public class PotentialFieldContainer {
if (y < grid.getNumPointsY() && (x - 2) < grid.getNumPointsX()) {
grid.setValue(x - 2, y, state);
} else {
logger.warn("Index error " + "y=" + y + " rows=" + grid.getNumPointsY() + " x=" + x + " cols="
logger.warn("Index topographyError " + "y=" + y + " rows=" + grid.getNumPointsY() + " x=" + x + " cols="
+ grid.getNumPointsX());
}
}
......
......@@ -47,7 +47,7 @@ public abstract class ActionAbstractAddScenario extends AbstractAction {
return;
addScenario(vadere);
} catch (IOException e) {
logger.error(String.format("error during output load: '%s'", e.getLocalizedMessage()));
logger.error(String.format("topographyError during output load: '%s'", e.getLocalizedMessage()));
}
} else {
IOUtils.errorBox(Messages.getString("renameErrorDialog.text"),
......
package org.vadere.gui.projectview.model;
import org.vadere.simulator.projects.Scenario;
public interface IScenarioChecker {
void checkScenario(final Scenario scenario);
}
......@@ -7,9 +7,11 @@ import org.vadere.gui.projectview.VadereApplication;
import org.vadere.gui.projectview.control.IOutputFileRefreshListener;
import org.vadere.gui.projectview.control.IProjectChangeListener;
import org.vadere.gui.projectview.view.ProjectView;
import org.vadere.gui.projectview.view.ScenarioNamePanel;
import org.vadere.gui.projectview.view.ScenarioPanel;
import org.vadere.gui.projectview.view.VDialogManager;
import org.vadere.gui.projectview.view.VTable;
import org.vadere.gui.topographycreator.model.IDrawPanelModel;
import org.vadere.simulator.projects.Scenario;
import org.vadere.simulator.projects.VadereProject;
import org.vadere.simulator.projects.ProjectWriter;
......@@ -24,7 +26,7 @@ import java.util.concurrent.Executors;
import java.util.prefs.Preferences;
import java.util.stream.Collectors;
public class ProjectViewModel {
public class ProjectViewModel implements IScenarioChecker {
private static Logger logger = LogManager.getLogger(ProjectViewModel.class);
private VadereProject project;
......@@ -42,7 +44,8 @@ public class ProjectViewModel {
private final Collection<IOutputFileRefreshListener> outputRefreshListeners;
private final Collection<IProjectChangeListener> projectChangeListeners;
private JLabel scenarioNameLabel; // to add or remove the "*" to indicate unsaved changes
private List<IScenarioChecker> scenarioCheckerListeners;
private ScenarioNamePanel scenarioNamePanel; // to add or remove the "*" to indicate unsaved changes and ScenarioChecker indicator
private boolean showSimulationResultDialog;
public ProjectViewModel() {
......@@ -54,6 +57,7 @@ public class ProjectViewModel {
this.refreshOutputExecutor = Executors.newSingleThreadExecutor();
this.showSimulationResultDialog = Preferences.userNodeForPackage(VadereApplication.class)
.getBoolean("Project.simulationResult.show", true);
this.scenarioCheckerListeners = new ArrayList<>();
}
public void deleteOutputFiles(final int[] rows) throws IOException {
......@@ -269,12 +273,12 @@ public class ProjectViewModel {
projectChangeListeners.add(listener);
}
public void setScenarioNameLabel(JLabel scenarioName) {
this.scenarioNameLabel = scenarioName;
public void setScenarioNamePanel(ScenarioNamePanel scenarioNamePanel) {
this.scenarioNamePanel = scenarioNamePanel;
}
public void setScenarioNameLabel(final String name) {
this.scenarioNameLabel.setText(name);
public void setScenarioNameLabelString(final String name) {
this.scenarioNamePanel.setScenarioName(name);
}
private class OutputRefresher implements Runnable {
......@@ -404,7 +408,7 @@ public class ProjectViewModel {
public void refreshScenarioNames() {
if (scenarioTable.getRowCount() > 0) {
scenarioTable.repaint();
scenarioNameLabel.setText(currentScenario.getDisplayName());
scenarioNamePanel.setScenarioName(currentScenario.getDisplayName());
}
}
......@@ -423,4 +427,22 @@ public class ProjectViewModel {
public void setShowSimulationResultDialog(boolean showSimulationResultDialog) {
this.showSimulationResultDialog = showSimulationResultDialog;
}
public void scenarioCheckerStopObserve(){
scenarioNamePanel.stopObserver();
}
public void scenarioCheckerStartObserve(IDrawPanelModel model){
scenarioNamePanel.observerIDrawPanelModel(model);
}
public void scenarioCheckerCheck(final Scenario scenario){
scenarioNamePanel.check(scenario);
}
@Override