public void saveGuiState() {
	try {
	    fos = new FileOutputStream(filename);
	    out = new ObjectOutputStream(fos);
	    out.writeObject(model);
	    out.close();
	} catch (FileNotFoundException ex) {
	    Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);
	} catch (IOException ex) {
	    Logger.getLogger(Controller.class.getName()).log(Level.SEVERE, null, ex);
	}
    }