public void useGrammarWindowGraph() {
        NetworkGraph graph = grammarWindow.getGrammarParser().getGraph();
        String massesAsCsv = GraphConverter.toMassesCsv(graph);
        String connectionMapAsCsv = GraphConverter.toConnectionMapCsv(graph);
        String directory = grammarWindow.getDirectoryOfInitalisationFile();
        String timestamp = new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss").format(new Date());

        String massesFilename = getMassesFilename(directory, timestamp);
        String connectionMapFilename = getConnectionMapFilename(directory, timestamp);

        try {
            FileUtils.writeStringToFile(new File(massesFilename), massesAsCsv);
            FileUtils.writeStringToFile(new File(connectionMapFilename), connectionMapAsCsv);
        } catch (IOException ex) {
            JOptionPane.showMessageDialog(grammarWindow, "Could not store the file: " + ex.getMessage(), "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }

        mainWindow.setMassesFilePath(massesFilename);
        mainWindow.setConnectionMapFilePath(connectionMapFilename);
    }