MATSIM
Gui.java
Go to the documentation of this file.
1 
2 /* *********************************************************************** *
3  * project: org.matsim.*
4  * Gui.java
5  * *
6  * *********************************************************************** *
7  * *
8  * copyright : (C) 2019 by the members listed in the COPYING, *
9  * LICENSE and WARRANTY file. *
10  * email : info at matsim dot org *
11  * *
12  * *********************************************************************** *
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * See also COPYING, LICENSE and WARRANTY file *
19  * *
20  * *********************************************************************** */
21 
22 package org.matsim.run.gui;
23 
24 import com.google.common.base.Preconditions;
25 import org.matsim.core.config.Config;
28 import org.matsim.core.gbl.Gbl;
29 import org.matsim.core.utils.io.IOUtils;
30 import org.matsim.run.RunMatsim;
31 
32 import javax.swing.*;
33 import javax.swing.GroupLayout.Alignment;
34 import javax.swing.LayoutStyle.ComponentPlacement;
35 import java.awt.*;
36 import java.io.File;
37 import java.io.IOException;
38 import java.util.LinkedHashMap;
39 import java.util.Map;
40 import java.util.concurrent.Future;
41 import java.util.concurrent.FutureTask;
42 import java.util.concurrent.RunnableFuture;
43 
47 public class Gui extends JFrame {
48 
49  private static final long serialVersionUID = 1L;
50 
51  private static final JLabel lblFilepaths = new JLabel(
52  "Filepaths must either be absolute or relative to the location of the config file.");
53  private static final JLabel lblJavaLocation = new JLabel("Java Location:");
54  private static final JLabel lblConfigurationFile = new JLabel("Configuration file:");
55  private static final JLabel lblOutputDirectory = new JLabel("Output Directory:");
56  private static final JLabel lblMemory = new JLabel("Memory:");
57  private static final JLabel lblMb = new JLabel("MB");
58  private static final JLabel lblYouAreUsingJavaVersion = new JLabel("You are using Java version:");
59  private static final JLabel lblYouAreUsingMATSimVersion = new JLabel("You are using MATSim version:");
60 
61  private JTextField txtConfigfilename;
62  private JTextField txtMatsimversion;
63  private JTextField txtRam;
64  private JTextField txtJvmversion;
65  private JTextField txtJvmlocation;
66  private JTextField txtOutput;
67 
68  private JButton btnStartMatsim;
69  private JProgressBar progressBar;
70 
71  private JTextArea textStdOut;
72  private JScrollPane scrollPane;
73  private JButton btnEdit;
74 
75  Map<String, JButton> preprocessButtons = new LinkedHashMap<>();
76  Map<String, JButton> postprocessButtons = new LinkedHashMap<>();
77 
78  // volatile because set outside EDT (AWT thread), but EDT checks if it is null
79  private volatile ExeRunner exeRunner = null;
80 
81  private JMenuBar menuBar;
82  private JMenu mnTools;
83  private JMenuItem mntmCompressFile;
84  private JMenuItem mntmUncompressFile;
85  private JMenuItem mntmCreateDefaultConfig;
86  private JMenuItem mntmCreateSamplePopulation;
87 
88  private PopulationSampler popSampler = null;
89  private JTextArea textErrOut;
90  private final String mainClass;
91 
92  private File configFile;
93  private File lastUsedDirectory;
94 
98  private File workingDirectory = null;
99  private ConfigEditor editor = null;
101 
102  private Gui(final String title, final Class<?> mainClass) {
103  setTitle(title);
104  this.mainClass = mainClass.getCanonicalName();
105  setDefaultCloseOperation(DISPOSE_ON_CLOSE);
106  }
107 
108  private void createLayout() {
109  this.lastUsedDirectory = new File(".");
110 
111  txtConfigfilename = new JTextField();
112  txtConfigfilename.setText("");
113  txtConfigfilename.setColumns(10);
114 
115  btnStartMatsim = new JButton("Start MATSim");
116  btnStartMatsim.setEnabled(false);
117 
118  for (JButton button : preprocessButtons.values()) {
119  button.setEnabled(false);
120  }
121  for (JButton button : postprocessButtons.values()) {
122  button.setEnabled(false);
123  }
124 
125  JButton btnChoose = new JButton("Choose");
126  btnChoose.addActionListener(e -> {
127  JFileChooser chooser = new JFileChooser();
128  chooser.setCurrentDirectory(lastUsedDirectory);
129  int result = chooser.showOpenDialog(null);
130  if (result == JFileChooser.APPROVE_OPTION) {
131  File f = chooser.getSelectedFile();
132  lastUsedDirectory = f.getParentFile();
133  loadConfigFile(f);
134  if (editor != null) {
135  editor.closeEditor();
136  editor = null;
137  }
138  }
139  });
140 
141  this.btnEdit = new JButton("Edit…");
142  this.btnEdit.setEnabled(false);
143  this.btnEdit.addActionListener(e -> {
144  if (editor == null) {
145  this.editor = new ConfigEditor(this, configFile, Gui.this::loadConfigFile);
146  }
147  editor.showEditor();
148  editor.toFront();
149  });
150 
151  txtMatsimversion = new JTextField();
152  txtMatsimversion.setEditable(false);
153  txtMatsimversion.setText(Gbl.getBuildInfoString());
154  txtMatsimversion.setColumns(10);
155 
156  txtRam = new JTextField();
157  txtRam.setText("1024");
158  txtRam.setColumns(10);
159 
160  String javaVersion = System.getProperty("java.version")
161  + "; "
162  + System.getProperty("java.vm.vendor")
163  + "; "
164  + System.getProperty("java.vm.info")
165  + "; "
166  + System.getProperty("sun.arch.data.model")
167  + "-bit";
168 
169  txtJvmversion = new JTextField();
170  txtJvmversion.setEditable(false);
171  txtJvmversion.setText(javaVersion);
172  txtJvmversion.setColumns(10);
173 
174  String jvmLocation;
175  if (System.getProperty("os.name").startsWith("Win")) {
176  jvmLocation = System.getProperties().getProperty("java.home")
177  + File.separator
178  + "bin"
179  + File.separator
180  + "java.exe";
181  } else {
182  jvmLocation = System.getProperties().getProperty("java.home")
183  + File.separator
184  + "bin"
185  + File.separator
186  + "java";
187  }
188 
189  txtJvmlocation = new JTextField();
190  txtJvmlocation.setEditable(false);
191  txtJvmlocation.setText(jvmLocation);
192  txtJvmlocation.setColumns(10);
193 
194  txtOutput = new JTextField();
195  txtOutput.setEditable(false);
196  txtOutput.setText("");
197  txtOutput.setColumns(10);
198 
199  progressBar = new JProgressBar();
200  progressBar.setEnabled(false);
201  progressBar.setIndeterminate(true);
202  progressBar.setVisible(false);
203 
204  btnStartMatsim.addActionListener(e -> {
205  if (exeRunner == null) {
206  startMATSim();
207  } else {
208  stopMATSim();
209  }
210  });
211 
212  JButton btnOpen = new JButton("Open");
213  btnOpen.addActionListener(e -> {
214  if (!txtOutput.getText().isEmpty()) {
215  try {
216  File f = new File(txtOutput.getText());
217  Desktop.getDesktop().open(f);
218  } catch (IOException ex) {
219  ex.printStackTrace();
220  }
221  }
222  });
223 
224  JButton btnDelete = new JButton("Delete");
225  btnDelete.addActionListener(e -> {
226  if (!txtOutput.getText().isEmpty()) {
227  int i = JOptionPane.showOptionDialog(Gui.this,
228  "Do you really want to delete the output directory? This action cannot be undone.",
229  "Delete Output Directory", JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE, null,
230  new String[] { "Cancel", "Delete" }, "Cancel");
231  if (i == 1) {
232  try {
233  IOUtils.deleteDirectoryRecursively(new File(txtOutput.getText()).toPath());
234  } catch (Exception ex) {
235  ex.printStackTrace();
236  }
237  }
238  }
239  });
240 
241  JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
242  // scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
243 
244  GroupLayout groupLayout = new GroupLayout(getContentPane());
245 
246  final GroupLayout.SequentialGroup prebuttonsSequentialGroup = groupLayout.createSequentialGroup();
247  final GroupLayout.ParallelGroup prebuttonsParallelGroup = groupLayout.createParallelGroup();
248  for (JButton button : preprocessButtons.values()) {
249  prebuttonsSequentialGroup.addComponent(button);
250  prebuttonsParallelGroup.addComponent(button);
251  }
252 
253  final GroupLayout.SequentialGroup postbuttonsSequentialGroup = groupLayout.createSequentialGroup();
254  final GroupLayout.ParallelGroup postbuttonsParallelGroup = groupLayout.createParallelGroup();
255  for (JButton button : postprocessButtons.values()) {
256  postbuttonsSequentialGroup.addComponent(button);
257  postbuttonsParallelGroup.addComponent(button);
258  }
259 
260  groupLayout.setHorizontalGroup(groupLayout.createParallelGroup(Alignment.TRAILING)
261  .addGroup(Alignment.LEADING, groupLayout.createSequentialGroup()
262  .addContainerGap()
263  .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
264  // a bunch of stuff that can in principle stretch from left to right (although most of it won't):
265  .addComponent(tabbedPane, GroupLayout.DEFAULT_SIZE, 729, Short.MAX_VALUE)
266  .addComponent(lblFilepaths) // "Filepaths must either ..."
267  .addGroup(prebuttonsSequentialGroup)
268  .addGroup(postbuttonsSequentialGroup)
269  .addGroup(groupLayout.createSequentialGroup()
270  .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
271  // some stuff that stretches from left to somewhere1:
272  .addComponent(lblYouAreUsingMATSimVersion)
273  .addComponent(lblYouAreUsingJavaVersion)
274  .addComponent(lblJavaLocation)
275  .addComponent(lblConfigurationFile)
276  .addComponent(lblOutputDirectory)
277  .addComponent(lblMemory)
278  .addComponent(btnStartMatsim))
279  // a gap from somewhere1 to somewhere2:
280  .addPreferredGap(ComponentPlacement.RELATED)
281  .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
282  // stuff that stretches from somewhere2 to right:
283  .addGroup(groupLayout.createSequentialGroup()
284  .addComponent(txtRam, GroupLayout.PREFERRED_SIZE, 69,
285  GroupLayout.PREFERRED_SIZE)
286  .addPreferredGap(ComponentPlacement.RELATED)
287  .addComponent(lblMb))
288  .addComponent(txtMatsimversion, GroupLayout.DEFAULT_SIZE, 285,
289  Short.MAX_VALUE)
290  .addComponent(txtJvmversion, GroupLayout.DEFAULT_SIZE, 285,
291  Short.MAX_VALUE)
292  .addComponent(txtJvmlocation, GroupLayout.DEFAULT_SIZE, 285,
293  Short.MAX_VALUE)
294  .addGroup(groupLayout.createSequentialGroup()
295  .addComponent(txtConfigfilename, GroupLayout.DEFAULT_SIZE, 188,
296  Short.MAX_VALUE)
297  .addPreferredGap(ComponentPlacement.RELATED)
298  .addComponent(btnChoose)
299  .addPreferredGap(ComponentPlacement.RELATED)
300  .addComponent(btnEdit))
301  .addComponent(progressBar, GroupLayout.DEFAULT_SIZE, 285,
302  Short.MAX_VALUE)
303  .addGroup(groupLayout.createSequentialGroup()
304  .addComponent(txtOutput, GroupLayout.DEFAULT_SIZE, 112,
305  Short.MAX_VALUE)
306  .addPreferredGap(ComponentPlacement.RELATED)
307  .addComponent(btnOpen)
308  .addPreferredGap(ComponentPlacement.RELATED)
309  .addComponent(btnDelete)))))
310  .addContainerGap()));
311  groupLayout.setVerticalGroup(groupLayout.createParallelGroup(Alignment.LEADING)
312  .addGroup(groupLayout.createSequentialGroup()
313  .addContainerGap()
314  .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
315  .addComponent(lblYouAreUsingMATSimVersion)
316  .addComponent(txtMatsimversion, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
317  GroupLayout.PREFERRED_SIZE))
318  .addPreferredGap(ComponentPlacement.RELATED)
319  .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
320  .addComponent(lblYouAreUsingJavaVersion)
321  .addComponent(txtJvmversion, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
322  GroupLayout.PREFERRED_SIZE))
323  .addPreferredGap(ComponentPlacement.RELATED)
324  .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
325  .addComponent(lblJavaLocation)
326  .addComponent(txtJvmlocation, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
327  GroupLayout.PREFERRED_SIZE))
328  .addPreferredGap(ComponentPlacement.RELATED)
329  .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
330  .addComponent(lblConfigurationFile)
331  .addComponent(txtConfigfilename, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
332  GroupLayout.PREFERRED_SIZE)
333  .addComponent(btnChoose)
334  .addComponent(btnEdit))
335  .addPreferredGap(ComponentPlacement.RELATED)
336  .addComponent(lblFilepaths)
337  .addPreferredGap(ComponentPlacement.RELATED)
338  .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
339  .addComponent(lblOutputDirectory)
340  .addComponent(txtOutput, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
341  GroupLayout.PREFERRED_SIZE)
342  .addComponent(btnDelete)
343  .addComponent(btnOpen))
344  .addPreferredGap(ComponentPlacement.RELATED)
345  .addGroup(groupLayout.createParallelGroup(Alignment.BASELINE)
346  .addComponent(lblMemory)
347  .addComponent(txtRam, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
348  GroupLayout.PREFERRED_SIZE)
349  .addComponent(lblMb))
350  .addPreferredGap(ComponentPlacement.UNRELATED)
351  .addGroup(prebuttonsParallelGroup)
352  .addPreferredGap(ComponentPlacement.UNRELATED)
353  .addGroup(groupLayout.createParallelGroup(Alignment.LEADING)
354  .addComponent(btnStartMatsim)
355  .addComponent(progressBar, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE,
356  GroupLayout.PREFERRED_SIZE))
357  .addPreferredGap(ComponentPlacement.UNRELATED)
358  .addGroup(postbuttonsParallelGroup)
359  .addPreferredGap(ComponentPlacement.RELATED)
360  .addComponent(tabbedPane, GroupLayout.DEFAULT_SIZE, 180, Short.MAX_VALUE)
361  .addContainerGap()));
362 
363  textStdOut = new JTextArea();
364  textStdOut.setWrapStyleWord(true);
365  textStdOut.setTabSize(4);
366  textStdOut.setEditable(false);
367  scrollPane = new JScrollPane(textStdOut);
368  tabbedPane.addTab("Output", null, scrollPane, null);
369 
370  JScrollPane scrollPane_1 = new JScrollPane();
371  tabbedPane.addTab("Warnings & Errors", null, scrollPane_1, null);
372 
373  textErrOut = new JTextArea();
374  textErrOut.setWrapStyleWord(true);
375  textErrOut.setTabSize(4);
376  textErrOut.setEditable(false);
377  scrollPane_1.setViewportView(textErrOut);
378 
379  getContentPane().setLayout(groupLayout);
380 
381  menuBar = new JMenuBar();
382  setJMenuBar(menuBar);
383 
384  mnTools = new JMenu("Tools");
385  menuBar.add(mnTools);
386 
387  mntmCompressFile = new JMenuItem("Compress File…");
388  mnTools.add(mntmCompressFile);
389  mntmCompressFile.addActionListener(e -> GUnZipper.gzipFile());
390 
391  mntmUncompressFile = new JMenuItem("Uncompress File…");
392  mnTools.add(mntmUncompressFile);
393  mntmUncompressFile.addActionListener(e -> GUnZipper.gunzipFile());
394 
395  mnTools.addSeparator();
396 
397  mntmCreateDefaultConfig = new JMenuItem("Create Default config.xml…");
398  mnTools.add(mntmCreateDefaultConfig);
399  mntmCreateDefaultConfig.addActionListener(e -> {
400  SaveFileSaver chooser = new SaveFileSaver();
401  chooser.setSelectedFile(new File("defaultConfig.xml"));
402  int saveResult = chooser.showSaveDialog(null);
403  if (saveResult == JFileChooser.APPROVE_OPTION) {
404  File destFile = chooser.getSelectedFile();
405  Config config = ConfigUtils.createConfig();
406  new ConfigWriter(config).write(destFile.getAbsolutePath());
407  }
408  });
409 
410  mntmCreateSamplePopulation = new JMenuItem("Create Sample Population…");
411  mnTools.add(mntmCreateSamplePopulation);
412  mntmCreateSamplePopulation.addActionListener(e -> {
413  if (popSampler == null) {
414  popSampler = new PopulationSampler(this);
415  popSampler.pack();
416  }
417  popSampler.setVisible(true);
418  });
419 
420  JMenuItem mntmTransitValidator = new JMenuItem("Validate TransitSchedule…");
421  this.mnTools.add(mntmTransitValidator);
422  mntmTransitValidator.addActionListener(e -> {
423  if (this.transitValidator == null) {
424  this.transitValidator = new ScheduleValidatorWindow(this);
425  }
426  String configFilename = this.txtConfigfilename.getText();
427  if (!configFilename.isEmpty()) {
428  Config config = ConfigUtils.createConfig();
429  try {
430  ConfigUtils.loadConfig(config, configFilename);
431  this.transitValidator.loadFromConfig(config, new File(configFilename).getParentFile());
432  } catch (Exception ignore) {
433  }
434  }
435  this.transitValidator.setVisible(true);
436  });
437  }
438 
439  private void startMATSim() {
440  progressBar.setVisible(true);
441  progressBar.setEnabled(true);
442  this.btnStartMatsim.setEnabled(false);
443 
444  textStdOut.setText("");
445  textErrOut.setText("");
446 
447  String cwd = workingDirectory == null ? new File(txtConfigfilename.getText()).getParent() : workingDirectory.getAbsolutePath();
448 
449  new Thread(() -> {
450  String classpath = System.getProperty("java.class.path");
451  String[] cpParts = classpath.split(File.pathSeparator);
452  StringBuilder absoluteClasspath = new StringBuilder();
453  for (String cpPart : cpParts) {
454  if (absoluteClasspath.length() > 0) {
455  absoluteClasspath.append(File.pathSeparatorChar);
456  }
457  absoluteClasspath.append(new File(cpPart).getAbsolutePath());
458  }
459  String[] cmdArgs = new String[] { txtJvmlocation.getText(),
460  "-cp", absoluteClasspath.toString(),
461  "-Xmx" + txtRam.getText() + "m",
462  "--add-exports", "java.base/java.lang=ALL-UNNAMED",
463  "--add-exports", "java.desktop/sun.awt=ALL-UNNAMED",
464  "--add-exports", "java.desktop/sun.java2d=ALL-UNNAMED",
465  mainClass, txtConfigfilename.getText() };
466  // see https://jogamp.org/bugzilla/show_bug.cgi?id=1317#c21 and/or https://github.com/matsim-org/matsim-libs/pull/2940
467  exeRunner = ExeRunner.run(cmdArgs, textStdOut, textErrOut, cwd);
468  int exitcode = exeRunner.waitForFinish();
469  exeRunner = null;
470 
471  SwingUtilities.invokeLater(() -> {
472  progressBar.setVisible(false);
473  btnStartMatsim.setText("Start MATSim");
474  btnStartMatsim.setEnabled(true);
475  if (exitcode != 0) {
476  textStdOut.append("\n");
477  textStdOut.append("The simulation did not run properly. Error/Exit code: " + exitcode);
478  textStdOut.setCaretPosition(textStdOut.getDocument().getLength());
479  textErrOut.append("\n");
480  textErrOut.append("The simulation did not run properly. Error/Exit code: " + exitcode);
481  textErrOut.setCaretPosition(textErrOut.getDocument().getLength());
482  }
483  });
484 
485  if (exitcode != 0) {
486  throw new RuntimeException("There was a problem running MATSim. exit code: " + exitcode);
487  }
488 
489  }).start();
490 
491  btnStartMatsim.setText("Stop MATSim");
492  btnStartMatsim.setEnabled(true);
493  }
494 
495  public void loadConfigFile(final File configFile) {
496  this.configFile = configFile;
497  String configFilename = configFile.getAbsolutePath();
498 
499  Config config = ConfigUtils.createConfig();
500  try {
501  ConfigUtils.loadConfig(config, configFilename);
502  } catch (Exception e) {
503  textStdOut.setText("");
504  textStdOut.append("The configuration file could not be loaded. Error message:\n");
505  textStdOut.append(e.getMessage());
506  textErrOut.setText("");
507  textErrOut.append("The configuration file could not be loaded. Error message:\n");
508  textErrOut.append(e.getMessage());
509  return;
510  }
511  txtConfigfilename.setText(configFilename);
512 
513  File par = configFile.getParentFile();
514  File outputDir = new File(par, config.controller().getOutputDirectory());
515  try {
516  txtOutput.setText(outputDir.getCanonicalPath());
517  } catch (IOException e1) {
518  txtOutput.setText(outputDir.getAbsolutePath());
519  }
520 
521  btnStartMatsim.setEnabled(true);
522  btnEdit.setEnabled(true);
523  for (JButton button : preprocessButtons.values()) {
524  button.setEnabled(true);
525  }
526  for (JButton button : postprocessButtons.values()) {
527  button.setEnabled(true);
528  }
529  }
530 
531  private void stopMATSim() {
532  ExeRunner runner = this.exeRunner;
533  if (runner != null) {
534  runner.killProcess();
535 
536  //TODO Double check if this works
537  exeRunner = null;
538 
539  progressBar.setVisible(false);
540  btnStartMatsim.setText("Start MATSim");
541  btnStartMatsim.setEnabled(true);
542 
543  textStdOut.append("\n");
544  textStdOut.append("The simulation was stopped forcefully.");
545  textStdOut.setCaretPosition(textStdOut.getDocument().getLength());
546  textErrOut.append("\n");
547  textErrOut.append("The simulation was stopped forcefully.");
548  textErrOut.setCaretPosition(textErrOut.getDocument().getLength());
549  }
550  }
551 
552  public static Future<Gui> show(final String title, final Class<?> mainClass) {
553  return show(title, mainClass, null);
554  }
555 
559  public static Future<Gui> show(final String title, final Class<?> mainClass, File configFile) {
560  System.setProperty("apple.laf.useScreenMenuBar", "true");
561 
562  RunnableFuture<Gui> rf = new FutureTask<>(() -> {
563  Gui gui = new Gui(title, mainClass);
564  gui.createLayout();
565  gui.pack();
566  gui.setLocationByPlatform(true);
567  gui.setVisible(true);
568  if (configFile != null && configFile.exists()) {
569  gui.loadConfigFile(configFile);
570  }
571 
572  return gui;
573  });
574 
575  SwingUtilities.invokeLater(rf);
576  return rf;
577  }
578 
579  public static void main(String[] args) {
580  Preconditions.checkArgument(args.length < 2);
581  Gui.show("MATSim", RunMatsim.class, args.length == 1 ? new File(args[0]) : null);
582  }
583 
584  public void setWorkingDirectory(File cwd) {
585  this.workingDirectory = cwd;
586  }
587 
588  // Is it a problem to make the following available to the outside? If so, why? Would it
589  // be better to rather copy/paste the above code and start from there? kai, jun/aug'18
590 
591  // final JMenu getToolsMenu() {
592  // // Is it a problem to make this available? If so, why? kai, jun'18
593  // return this.mnTools ;
594  // }
595  // final void addToMenuBar(JMenu menuItem) {
596  // this.menuBar.add(menuItem) ;
597  // }
598  // final void addPreprocessButton( String str, JButton button ) {
599  // this.preprocessButtons.put( str, button );
600  // }
601  //
602  // /**
603  // * @param str -- name. These are named so that they can be replaced, and in theory removed. Maybe not necessary. kai, sep'18
604  // * @param button
605  // */
606  // final void addPostprocessButton( String str, JButton button ) {
607  // this.postprocessButtons.put( str, button );
608  // }
609  // JTextArea getTextStdOut() {
610  // return textStdOut;
611  // }
612  // JTextArea getTextErrOut() {
613  // return textErrOut;
614  // }
615  // JTextField getTxtJvmlocation() {
616  // return txtJvmlocation ;
617  // }
618  // JTextField getTxtRam() {
619  // return this.txtRam ;
620  // }
621  // @Deprecated // this should not be necessary. kai, aug'18
622  // String getMainClass() {
623  // return this.mainClass ;
624  // }
625  // JTextField getTxtConfigfilename() {
626  // return this.txtConfigfilename ;
627  // }
628 
629 }
static final JLabel lblConfigurationFile
Definition: Gui.java:54
static void deleteDirectoryRecursively(Path path)
Definition: IOUtils.java:446
static final JLabel lblFilepaths
Definition: Gui.java:51
static final JLabel lblOutputDirectory
Definition: Gui.java:55
static Config loadConfig(final String filename, ConfigGroup... customModules)
final void write(final String filename)
void loadFromConfig(Config config, File configDirectory)
void setWorkingDirectory(File cwd)
Definition: Gui.java:584
JMenuItem mntmCreateDefaultConfig
Definition: Gui.java:85
JTextArea textStdOut
Definition: Gui.java:71
final String mainClass
Definition: Gui.java:90
JTextField txtConfigfilename
Definition: Gui.java:61
void loadConfigFile(final File configFile)
Definition: Gui.java:495
PopulationSampler popSampler
Definition: Gui.java:88
JMenuItem mntmCreateSamplePopulation
Definition: Gui.java:86
static void main(String[] args)
Definition: Gui.java:579
JMenuItem mntmUncompressFile
Definition: Gui.java:84
volatile ExeRunner exeRunner
Definition: Gui.java:79
JTextField txtOutput
Definition: Gui.java:66
JProgressBar progressBar
Definition: Gui.java:69
ScheduleValidatorWindow transitValidator
Definition: Gui.java:100
static final long serialVersionUID
Definition: Gui.java:49
JTextField txtJvmversion
Definition: Gui.java:64
static final JLabel lblMemory
Definition: Gui.java:56
static Future< Gui > show(final String title, final Class<?> mainClass)
Definition: Gui.java:552
static final String getBuildInfoString()
Definition: Gbl.java:79
JTextArea textErrOut
Definition: Gui.java:89
JScrollPane scrollPane
Definition: Gui.java:72
static final JLabel lblJavaLocation
Definition: Gui.java:53
static final JLabel lblYouAreUsingMATSimVersion
Definition: Gui.java:59
JTextField txtMatsimversion
Definition: Gui.java:62
JButton btnStartMatsim
Definition: Gui.java:68
ConfigEditor editor
Definition: Gui.java:99
Gui(final String title, final Class<?> mainClass)
Definition: Gui.java:102
JMenuBar menuBar
Definition: Gui.java:81
JMenuItem mntmCompressFile
Definition: Gui.java:83
JTextField txtRam
Definition: Gui.java:63
static final JLabel lblYouAreUsingJavaVersion
Definition: Gui.java:58
JTextField txtJvmlocation
Definition: Gui.java:65
final ControllerConfigGroup controller()
Definition: Config.java:399
static final JLabel lblMb
Definition: Gui.java:57
File lastUsedDirectory
Definition: Gui.java:93
static Config createConfig(final String context)
static Future< Gui > show(final String title, final Class<?> mainClass, File configFile)
Definition: Gui.java:559