/** SimulationController Constructor, creates a SimulationController object. */
  public SimulationController() {
    dataReceiver = new DataReceiver();
    simulationBox = new SimulationBox(dataReceiver);
    simulationBox.setState(new NetworkEditing());
    screen = new SimulatorScreen(simulationBox);
    networkHistory = new ArrayList<>();
    transitHistory = new ArrayList<>();
    analyser = NetworkAnalyser.getInstance();

    currentNetwork = networkFactory.getNetworkElementFactory(NETWORK_NAME);
    currentTransit = networkFactory.getTransitFactory(NETWORK_NAME);

    animator = new Animator();

    updateNetworkData();

    RootListener root = new RootListener(simulationBox);
    RootWheelListener rootWheel = new RootWheelListener(simulationBox);
    RootMotionListener rootMotion = new RootMotionListener(simulationBox);
    RootKeyListener rootKey = new RootKeyListener(simulationBox);

    screen.getRenderer().addMouseListener(root);
    screen.getRenderer().addMouseWheelListener(rootWheel);
    screen.getRenderer().addMouseMotionListener(rootMotion);
    screen.getRenderer().requestFocus();
    screen.getRenderer().addKeyListener(rootKey);

    screen.startDisplay();
  }
 private void load() {
   JFileChooser fileChooser = initFileChooser("Load");
   int result = fileChooser.showOpenDialog(screen.getScreen());
   if (result == JFileChooser.APPROVE_OPTION) {
     File selectedFile = fileChooser.getSelectedFile();
     String path = selectedFile.getAbsolutePath();
     networkFactory.load(path);
     currentNetwork = networkFactory.getNetworkElementFactory(NETWORK_NAME);
     currentTransit = networkFactory.getTransitFactory(NETWORK_NAME);
     updateNetworkData();
   }
 }