public void savefile(List<CADShape> data, boolean SaveAs) {
        if ((MainView.Saved == false) || (SaveAs==true)) {
            JFileChooser SAVE = new JFileChooser();
            FileNameExtensionFilter filter = new FileNameExtensionFilter(".cad files", "cad");
            SAVE.setFileFilter(filter);
            SAVE.setDialogTitle("Save as ...");
            SAVE.setDialogType(JFileChooser.SAVE_DIALOG);
            int returnVal = SAVE.showSaveDialog(null); // Dialog an Parent-Window anhaengen 
            if (returnVal == JFileChooser.APPROVE_OPTION) {
                System.out.println("Ihre Wahl zum Speichern: " + SAVE.getSelectedFile().getName());
            }
           FileName = SAVE.getSelectedFile().getAbsolutePath();
            try {
                saveToFile(SAVE.getSelectedFile().getAbsolutePath(), data);
                MainView.Save = true;
                MainView.Saved = true;
            } catch (IOException e) {
                e.printStackTrace();
                JOptionPane.showMessageDialog(null, "Datei konnte nicht gespeichert werden", "File not saved", JOptionPane.OK_CANCEL_OPTION);
            }
        } else {
            try {
                saveToFile(FileName, data);
                MainView.Save = true;
            } catch (IOException e) {
                e.printStackTrace();
                JOptionPane.showMessageDialog(null, "Datei konnte nicht gespeichert werden", "File not saved", JOptionPane.OK_CANCEL_OPTION);
            }
        }
    }