2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit ce962337 authored by Benedikt Zoennchen's avatar Benedikt Zoennchen
Browse files

Merge branch 'master' of https://gitlab.lrz.de/vadere/vadere

parents 837ecc13 50f028be
...@@ -10,16 +10,20 @@ import org.vadere.gui.components.model.DefaultSimulationConfig; ...@@ -10,16 +10,20 @@ import org.vadere.gui.components.model.DefaultSimulationConfig;
import org.vadere.gui.components.model.SimulationModel; import org.vadere.gui.components.model.SimulationModel;
public class ActionSetPedestrianColor extends ActionSetColor { public class ActionSetPedestrianColor extends ActionSetColor {
private final JComboBox<Integer> comboBox; private final JComboBox<Integer> comboBox;
public ActionSetPedestrianColor(final String name, final SimulationModel<? extends DefaultSimulationConfig> model, final JPanel coloredPanel, public ActionSetPedestrianColor(final String name, final SimulationModel<? extends DefaultSimulationConfig> model, final JPanel coloredPanel,
final JComboBox<Integer> comboBox) { final JComboBox<Integer> comboBox) {
super(name, model, coloredPanel); super(name, model, coloredPanel);
this.comboBox = comboBox; this.comboBox = comboBox;
} }
@Override @Override
protected void saveColor(Color color) { protected void saveColor(Color color) {
model.config.setPedestrianColor(comboBox.getSelectedIndex() + 1, color); Integer selectedTargetId = comboBox.getItemAt(comboBox.getSelectedIndex());
}
if (selectedTargetId != null) {
model.config.setPedestrianColor(selectedTargetId, color);
}
}
} }
...@@ -34,17 +34,18 @@ public class DialogFactory { ...@@ -34,17 +34,18 @@ public class DialogFactory {
} }
public static JDialog createSettingsDialog(final SimulationModel<? extends DefaultSimulationConfig> model) { public static JDialog createSettingsDialog(final SimulationModel<? extends DefaultSimulationConfig> model) {
//SwingUtilities.invokeLater() currentModel = model;
if (settingsDialog == null || currentModel == null || !currentModel.equals(model)) {
currentModel = model; // Instead of reusing an old "SettingsDialog", create a new one to avoid any problems.
if(model instanceof PostvisualizationModel) { if(model instanceof PostvisualizationModel) {
settingsDialog = new org.vadere.gui.postvisualization.view.SettingsDialog((PostvisualizationModel)model); settingsDialog = new org.vadere.gui.postvisualization.view.SettingsDialog((PostvisualizationModel)model);
} }
else { else {
settingsDialog = new SettingsDialog(model); settingsDialog = new SettingsDialog(model);
}
settingsDialog.initComponents();
} }
settingsDialog.initComponents();
return settingsDialog; return settingsDialog;
} }
} }
...@@ -58,7 +58,7 @@ public class SettingsDialog extends org.vadere.gui.components.view.SettingsDialo ...@@ -58,7 +58,7 @@ public class SettingsDialog extends org.vadere.gui.components.view.SettingsDialo
additionalLayeredPane.add(chShowAllTrajOnSnapshot, cc.xy(2, 8)); additionalLayeredPane.add(chShowAllTrajOnSnapshot, cc.xy(2, 8));
JCheckBox chShowEvacTimeColor = new JCheckBox(Messages.getString("PostVis.chShowEvacTimeColor.text")); JCheckBox chShowEvacTimeColor = new JCheckBox(Messages.getString("PostVis.chShowEvacTimeColor.text"));
getColorLayeredPane().add(chShowEvacTimeColor, cc.xyw(2, 26, 8)); getColorSettingsPane().add(chShowEvacTimeColor, cc.xyw(2, 26, 8));
chShowEvacTimeColor.addItemListener(e -> { chShowEvacTimeColor.addItemListener(e -> {
model.config.setUseEvacuationTimeColor(!model.config.isUseEvacuationTimeColor()); model.config.setUseEvacuationTimeColor(!model.config.isUseEvacuationTimeColor());
...@@ -66,7 +66,7 @@ public class SettingsDialog extends org.vadere.gui.components.view.SettingsDialo ...@@ -66,7 +66,7 @@ public class SettingsDialog extends org.vadere.gui.components.view.SettingsDialo
}); });
PedestrianColorPanel pedestrianColorPanel = new PedestrianColorPanel(model.getPedestrianColorTableModel()); PedestrianColorPanel pedestrianColorPanel = new PedestrianColorPanel(model.getPedestrianColorTableModel());
getColorLayeredPane().add(pedestrianColorPanel, cc.xyw(2, 22, 8)); getColorSettingsPane().add(pedestrianColorPanel, cc.xyw(2, 22, 8));
......
...@@ -260,7 +260,6 @@ public class VadereConfig { ...@@ -260,7 +260,6 @@ public class VadereConfig {
defaultConfig.put("ProjectView.defaultDirectoryAttributes", defaultSearchDirectory); defaultConfig.put("ProjectView.defaultDirectoryAttributes", defaultSearchDirectory);
defaultConfig.put("ProjectView.defaultDirectoryScenarios", defaultSearchDirectory); defaultConfig.put("ProjectView.defaultDirectoryScenarios", defaultSearchDirectory);
defaultConfig.put("ProjectView.defaultDirectoryOutputProcessors", defaultSearchDirectory); defaultConfig.put("ProjectView.defaultDirectoryOutputProcessors", defaultSearchDirectory);
defaultConfig.put("SettingsDialog.maxNumberOfTargets", "10");
defaultConfig.put("SettingsDialog.dataFormat", "yyyy_MM_dd_HH_mm_ss"); defaultConfig.put("SettingsDialog.dataFormat", "yyyy_MM_dd_HH_mm_ss");
defaultConfig.put("SettingsDialog.outputDirectory.path", "."); defaultConfig.put("SettingsDialog.outputDirectory.path", ".");
defaultConfig.put("SettingsDialog.snapshotDirectory.path", "."); defaultConfig.put("SettingsDialog.snapshotDirectory.path", ".");
......
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