Commit f0f46417 authored by Jakob Schöttl's avatar Jakob Schöttl

Rename view class

parent c8cf88c9
......@@ -23,7 +23,7 @@ import org.vadere.gui.components.control.ReflectionAttributeModifier;
import org.vadere.gui.components.model.IDefaultModel;
import org.vadere.gui.projectview.view.JsonValidIndicator;
import org.vadere.gui.projectview.view.ProjectView;
import org.vadere.gui.projectview.view.ScenarioJPanel;
import org.vadere.gui.projectview.view.ScenarioPanel;
import org.vadere.gui.topographycreator.model.AgentWrapper;
import org.vadere.gui.topographycreator.model.TopographyCreatorModel;
import org.vadere.state.attributes.Attributes;
......@@ -144,12 +144,12 @@ public class ScenarioElementView extends JPanel implements ISelectScenarioElemen
try {
Attributes attributes = StateJsonConverter.deserializeScenarioElementType(json, element.getType());
ReflectionAttributeModifier.setAttributes(element, attributes);
ScenarioJPanel.removeJsonParsingErrorMsg();
ScenarioPanel.removeJsonParsingErrorMsg();
ProjectView.getMainWindow().refreshScenarioNames();
jsonValidIndicator.setValid();
((TopographyCreatorModel) panelModel).getScenario().updateCurrentStateSerialized(); // casting should be safe her because in the other two modes (onlineVis and postVis), updateModel() won't be called because it's set to uneditable
} catch (IOException e) {
ScenarioJPanel.setActiveJsonParsingErrorMsg("TOPOGRAPHY CREATOR tab:\n" + e.getMessage()); // add name of scenario element?
ScenarioPanel.setActiveJsonParsingErrorMsg("TOPOGRAPHY CREATOR tab:\n" + e.getMessage()); // add name of scenario element?
jsonValidIndicator.setInvalid();
}
}
......
......@@ -6,7 +6,7 @@ import org.vadere.gui.components.utils.Messages;
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.ScenarioJPanel;
import org.vadere.gui.projectview.view.ScenarioPanel;
import org.vadere.gui.projectview.view.VDialogManager;
import org.vadere.gui.projectview.view.VTable;
import org.vadere.simulator.projects.Scenario;
......@@ -365,7 +365,7 @@ public class ProjectViewModel {
}
}
String errorMsg = ScenarioJPanel.getActiveJsonParsingErrorMsg();
String errorMsg = ScenarioPanel.getActiveJsonParsingErrorMsg();
if (errorMsg != null) {
VDialogManager.showMessageDialogWithBodyAndTextArea(
Messages.getString("RunScenarioJsonErrors.title"),
......
......@@ -37,7 +37,7 @@ public class JsonValidIndicator extends JPanel {
public void mouseReleased(MouseEvent e) {
VDialogManager.showMessageDialogWithTextArea(
Messages.getString("TextView.lbljsoninvalid.errorMsgPopup.title"),
ScenarioJPanel.getActiveJsonParsingErrorMsg(),
ScenarioPanel.getActiveJsonParsingErrorMsg(),
JOptionPane.ERROR_MESSAGE);
}
});
......
......@@ -98,7 +98,7 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
private JButton btnPauseRunningScenarios;
private JMenu mntmRecentProjects;
private ProgressPanel progressPanel = new ProgressPanel();
private ScenarioJPanel scenarioJPanel;
private ScenarioPanel scenarioJPanel;
private boolean scenariosRunning = false;
private Set<Action> projectSpecificActions = new HashSet<>(); // actions that should only be enabled, when a project is loaded
......@@ -644,7 +644,7 @@ public class ProjectView extends JFrame implements ProjectFinishedListener, Sing
ScenarioNamePanel.add(scenarioName);
scenarioName.setHorizontalAlignment(SwingConstants.CENTER);
scenarioJPanel = new ScenarioJPanel(scenarioName, model);
scenarioJPanel = new ScenarioPanel(scenarioName, model);
model.setScenarioNameLabel(scenarioName); // TODO [priority=low] [task=refactoring] breaking mvc pattern (?) - but I need access to refresh the scenarioName
model.addProjectChangeListener(scenarioJPanel);
rightSidePanel.add(scenarioJPanel, BorderLayout.CENTER);
......
......@@ -25,9 +25,9 @@ import javax.swing.*;
import javax.swing.border.EmptyBorder;
public class ScenarioJPanel extends JPanel implements IProjectChangeListener, ProjectFinishedListener {
public class ScenarioPanel extends JPanel implements IProjectChangeListener, ProjectFinishedListener {
private static Logger logger = LogManager.getLogger(ScenarioJPanel.class);
private static Logger logger = LogManager.getLogger(ScenarioPanel.class);
private static final long serialVersionUID = 0L;
private JTabbedPane tabbedPane;
......@@ -54,7 +54,7 @@ public class ScenarioJPanel extends JPanel implements IProjectChangeListener, Pr
private static String activeJsonParsingErrorMsg = null;
ScenarioJPanel(JLabel scenarioName, ProjectViewModel model) {
ScenarioPanel(JLabel scenarioName, ProjectViewModel model) {
this.scenarioName = scenarioName;
this.onlineVisualization = new OnlineVisualization(true);
this.postVisualizationView = new PostvisualizationWindow(model.getCurrentProjectPath());
......
......@@ -10,7 +10,7 @@ public class TabbedPaneWrapper extends JTabbedPane {
@Override
public void setSelectedIndex(int index) {
String errorMsg = ScenarioJPanel.getActiveJsonParsingErrorMsg();
String errorMsg = ScenarioPanel.getActiveJsonParsingErrorMsg();
if (errorMsg == null)
super.setSelectedIndex(index);
else
......
......@@ -192,11 +192,11 @@ public class TextView extends JPanel implements IJsonView {
break;
}
currentScenario.updateCurrentStateSerialized();
ScenarioJPanel.removeJsonParsingErrorMsg();
ScenarioPanel.removeJsonParsingErrorMsg();
ProjectView.getMainWindow().refreshScenarioNames();
jsonValidIndicator.setValid();
} catch (Exception e) {
ScenarioJPanel.setActiveJsonParsingErrorMsg(attributeType.name() + " tab:\n" + e.getMessage());
ScenarioPanel.setActiveJsonParsingErrorMsg(attributeType.name() + " tab:\n" + e.getMessage());
jsonValidIndicator.setInvalid();
}
}
......
......@@ -84,7 +84,7 @@ public class VDialogManager {
}
public static boolean continueSavingDespitePossibleJsonError() {
String errorMsg = ScenarioJPanel.getActiveJsonParsingErrorMsg();
String errorMsg = ScenarioPanel.getActiveJsonParsingErrorMsg();
if (errorMsg != null) {
int ret = VDialogManager.showConfirmDialogWithBodyAndTextArea(
Messages.getString("SaveDespiteJsonErrors.title"),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment