private boolean saveProject(Project project) { try { if (project == null) return true;  File file; String fileName = project.getFileName();  if (!fileName.startsWith("<")) { file = new File(fileName); } else { JFileChooser chooser = new JFileChooser(); chooser.setFileFilter(projectFileFilter);  int result = chooser.showSaveDialog(this); if (result == JFileChooser.CANCEL_OPTION) return false; file = chooser.getSelectedFile(); }  FileOutputStream out = new FileOutputStream(file); project.write(out); logger.logMessage(ConsoleLogger.INFO, "Project saved"); project.setFileName(file.getPath());  return true; } catch (IOException e) { logger.logMessage(ConsoleLogger.ERROR, "Could not save project: " + e.toString()); JOptionPane.showMessageDialog(this, "Error saving project: " + e.toString(), "Error", JOptionPane.ERROR_MESSAGE); return false; }
private boolean saveProject(Project project, String dialogTitle) { return saveProject(project, dialogTitle, false);
    private boolean saveProject(Project project) {        try {            if (project == null)                return true;                        File file;            String fileName = project.getFileName();                        if (!fileName.startsWith("<")) {                file = new File(fileName);            } else {                JFileChooser chooser = new JFileChooser();                chooser.setFileFilter(projectFileFilter);                                int result = chooser.showSaveDialog(this);                if (result == JFileChooser.CANCEL_OPTION)                    return false;                file = chooser.getSelectedFile();            }                        FileOutputStream out = new FileOutputStream(file);            project.write(out);            logger.logMessage(ConsoleLogger.INFO, "Project saved");            project.setFileName(file.getPath());                        return true;        } catch (IOException e) {            logger.logMessage(ConsoleLogger.ERROR, "Could not save project: " + e.toString());            JOptionPane.showMessageDialog(this, "Error saving project: " + e.toString(),            "Error", JOptionPane.ERROR_MESSAGE);            return false;        }    }