/*    */ package save;
/*    */ 
/*    */ import java.io.BufferedInputStream;
/*    */ import java.io.BufferedOutputStream;
/*    */ import java.io.File;
/*    */ import java.io.FileInputStream;
/*    */ import java.io.FileNotFoundException;
/*    */ import java.io.FileOutputStream;
/*    */ import java.io.IOException;
/*    */ import java.io.ObjectInputStream;
/*    */ import java.io.ObjectOutputStream;
/*    */ import java.util.ArrayList;
/*    */ import main.ChronoPanel;
/*    */ import main.ChronoWindow;
/*    */ import signals.AdaptSignals;
/*    */ import signals.Signals;
/*    */ import tools.Arrow;
/*    */ 
/*    */ public class Slot
/*    */ {
/*    */   public static void save(File saveDir)
/*    */   {
/*    */     try
/*    */     {
/* 25 */       ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(saveDir)));
/*    */       
/* 27 */       oos.writeObject(Integer.valueOf(((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).signals.size()));
/* 28 */       for (int i = 0; i < ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).signals.size(); i++) {
/* 29 */         oos.writeObject(((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).signals.get(i));
/*    */       }
/* 31 */       oos.writeObject(Integer.valueOf(((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).nbrTimeLapse));
/* 32 */       oos.writeObject(((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).timeLapse);
/* 33 */       oos.writeObject(Boolean.valueOf(((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).displayBackLines));
/* 34 */       oos.writeObject(main.Main.version);
/*    */       
/* 36 */       oos.writeObject(Boolean.valueOf(((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).antialiasing));
/* 37 */       oos.writeObject(Integer.valueOf(((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).arrows.size()));
/* 38 */       for (int i = 0; i < ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).arrows.size(); i++) {
/* 39 */         oos.writeObject(((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).arrows.get(i));
/*    */       }
/* 41 */       oos.close();
/*    */     }
/*    */     catch (FileNotFoundException e)
/*    */     {
/* 45 */       e.printStackTrace();
/*    */     } catch (IOException e) {
/* 47 */       e.printStackTrace();
/*    */     }
/*    */   }
/*    */   
/*    */   public static void load(File openDir)
/*    */   {
/* 53 */     int size = 0;
/*    */     try {
/* 55 */       ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream(openDir)));
/*    */       try
/*    */       {
/* 58 */         size = ((Integer)ois.readObject()).intValue();
/* 59 */         for (int i = 0; i < size; i++)
/*    */         {
/* 61 */           ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).signals.add(new AdaptSignals((Signals)ois.readObject()));
/*    */         }
/* 63 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).nbrTimeLapse = ((Integer)ois.readObject()).intValue();
/* 64 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).timeLapse = ((int[][])ois.readObject());
/* 65 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).displayBackLines = ((Boolean)ois.readObject()).booleanValue();
/* 66 */         String version = (String)ois.readObject();
/*    */         
/* 68 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).antialiasing = ((Boolean)ois.readObject()).booleanValue();
/* 69 */         int arrowSize = ((Integer)ois.readObject()).intValue();
/* 70 */         for (int i = 0; i < arrowSize; i++) {
/* 71 */           ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).arrows.add((Arrow)ois.readObject());
/*    */         }
/*    */       }
/*    */       catch (ClassNotFoundException e) {
/* 75 */         e.printStackTrace();
/*    */       }
/* 77 */       ois.close();
/*    */     } catch (FileNotFoundException e) {
/* 79 */       e.printStackTrace();
/*    */     } catch (IOException e) {
/* 81 */       e.printStackTrace();
/*    */     }
/*    */   }
/*    */ }


/* Location:              F:\JAVA\WORKSPACE\chronoEditor_v2.3.jar!\save\Slot.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */