Commit 81dd0f86 authored by BZoennchen's avatar BZoennchen

the change of the name of an output file should now work from within the gui

parent 9e38e233
......@@ -57,6 +57,7 @@ import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
import org.fife.ui.rsyntaxtextarea.Theme;
import org.vadere.gui.components.utils.Messages;
import org.vadere.gui.components.view.JComboCheckBox;
import org.vadere.gui.projectview.model.ProjectViewModel;
import org.vadere.gui.projectview.utils.ClassFinder;
import org.vadere.simulator.projects.Scenario;
import org.vadere.simulator.projects.dataprocessing.DataProcessingJsonManager;
......@@ -87,7 +88,6 @@ class DataProcessingView extends JPanel implements IJsonView {
private Scenario currentScenario;
private boolean isEditable;
DataProcessingView() {
setLayout(new BorderLayout()); // force it to span across the whole available space
......@@ -240,6 +240,7 @@ class DataProcessingView extends JPanel implements IJsonView {
JButton addFileBtn = new JButton(new AbstractAction("Add") {
@Override
public void actionPerformed(ActionEvent e) {
String filename = "out.txt";
int count = 1;
while (outputFileNameAlreadyExists(filename)) { // ensure unique suggested filename
......
......@@ -50,6 +50,7 @@ public class ScenarioPanel extends JPanel implements IProjectChangeListener, Pro
private Scenario scenario;
private boolean initialized;
private ProjectViewModel model;
private static String activeJsonParsingErrorMsg = null;
......@@ -58,6 +59,7 @@ public class ScenarioPanel extends JPanel implements IProjectChangeListener, Pro
this.scenarioName = scenarioName;
this.onlineVisualization = new OnlineVisualization(true);
this.postVisualizationView = new PostvisualizationWindow(model.getCurrentProjectPath());
this.model = model;
setBorder(new EmptyBorder(5, 5, 5, 5));
setLayout(new CardLayout(0, 0));
......
......@@ -3,8 +3,15 @@
"description" : "",
"release" : "0.2",
"processWriters" : {
"files" : [ ],
"processors" : [ ],
"files" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.outputfile.TimestepPedestrianIdOutputFile",
"filename" : "out.txt",
"processors" : [ 1 ]
} ],
"processors" : [ {
"type" : "org.vadere.simulator.projects.dataprocessing.processor.PedestrianPositionProcessor",
"id" : 1
} ],
"isTimestamped" : true
},
"scenario" : {
......
......@@ -45,7 +45,14 @@ public abstract class OutputFile<K extends DataKey<K>> {
}
public void setRelativeFileName(final String fileName) {
this.fileName = new File(this.fileName).getParentFile().toPath().resolve(fileName).toString();
File file = new File(this.fileName);
if(file.getParentFile() != null) {
this.fileName = new File(this.fileName).getParentFile().toPath().resolve(fileName).toString();
}
else {
this.fileName = fileName;
}
}
public void setProcessorIds(final List<Integer> processorIds) {
......
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