Combined Agenda

This commit is contained in:
2015-04-08 16:38:55 +02:00
parent ab91a7f1aa
commit 9d853babdc
20 changed files with 180 additions and 357 deletions
+5 -1
View File
@@ -11,6 +11,7 @@ import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.filechooser.FileFilter;
import Agenda.Agenda;
import Objects.DrawObject;
public class SaveLoad {
@@ -66,6 +67,7 @@ public class SaveLoad {
try {
FileOutputStream fos = new FileOutputStream(file);
ObjectOutputStream oos = new ObjectOutputStream(fos);
oos.writeObject(panel.getAgenda());
for (DrawObject object : panel.objects) {
oos.writeObject(object);
}
@@ -124,8 +126,10 @@ public class SaveLoad {
ois = new ObjectInputStream(fis);
Object object;
object = ois.readObject();
Agenda a = (Agenda) ois.readObject();
panel.setAgenda(a);
try {
object = ois.readObject();
panel.clearObjects();
while (object != null) {
panel.objects.add((DrawObject) object);