/*     */ package main;
/*     */ 
/*     */ import java.awt.Color;
/*     */ import java.awt.Container;
/*     */ import java.awt.Dimension;
/*     */ import java.awt.event.ActionEvent;
/*     */ import java.awt.event.ActionListener;
/*     */ import java.awt.event.ComponentAdapter;
/*     */ import java.awt.event.ComponentEvent;
/*     */ import java.awt.event.KeyEvent;
/*     */ import java.awt.event.KeyListener;
/*     */ import java.awt.event.WindowEvent;
/*     */ import java.awt.image.BufferedImage;
/*     */ import java.io.File;
/*     */ import java.io.FileNotFoundException;
/*     */ import java.io.IOException;
/*     */ import java.io.PrintStream;
/*     */ import java.util.ArrayList;
/*     */ import javax.imageio.ImageIO;
/*     */ import javax.swing.JFileChooser;
/*     */ import javax.swing.JMenu;
/*     */ import javax.swing.JMenuBar;
/*     */ import javax.swing.JMenuItem;
/*     */ import javax.swing.JOptionPane;
/*     */ import javax.swing.JTabbedPane;
/*     */ import javax.swing.KeyStroke;
/*     */ import javax.swing.UIManager;
/*     */ import javax.swing.event.ChangeEvent;
/*     */ import javax.swing.filechooser.FileFilter;
/*     */ import save.Filter;
/*     */ import save.Slot;
/*     */ import signals.AsyncBus;
/*     */ import signals.AsyncSignal;
/*     */ import signals.Clock;
/*     */ import signals.Signals;
/*     */ import signals.SyncBus;
/*     */ import signals.SyncSignal;
/*     */ import useful.ButtonTabComponent;
/*     */ 
/*     */ public class ChronoWindow extends javax.swing.JFrame implements KeyListener, javax.swing.event.ChangeListener
/*     */ {
/*     */   private static final long serialVersionUID = 1L;
/*  43 */   public static int WIDTH = 800;
/*  44 */   public static int HEIGHT = 500;
/*     */   
/*  46 */   public static ArrayList<ChronoPanel> chrono = new ArrayList();
/*  47 */   public static int active = 0;
/*     */   
/*     */   public static JTabbedPane tabs;
/*  50 */   private JMenuBar menuBar = new JMenuBar();
/*  51 */   JFileChooser docChooser = new JFileChooser();
/*  52 */   JFileChooser imgChooser = new JFileChooser();
/*     */   
/*  54 */   private JMenu file = new JMenu("File");
/*  55 */   private JMenuItem file_new = new JMenuItem("New");
/*  56 */   private JMenuItem file_open = new JMenuItem("Open");
/*  57 */   private JMenuItem file_save = new JMenuItem("Save");
/*  58 */   private JMenuItem file_save_as = new JMenuItem("Save As..");
/*  59 */   private JMenuItem file_export = new JMenuItem("Export to..");
/*  60 */   private JMenuItem file_quit = new JMenuItem("Quit");
/*     */   
/*  62 */   private JMenu add = new JMenu("Add");
/*  63 */   private JMenuItem add_clock = new JMenuItem("Clock");
/*  64 */   private JMenuItem add_sync_signal = new JMenuItem("Synchronous Signal");
/*  65 */   private JMenuItem add_sync_bus = new JMenuItem("Synchronous Bus");
/*  66 */   private JMenuItem add_async_signal = new JMenuItem("Asynchronous Signal");
/*  67 */   private JMenuItem add_async_bus = new JMenuItem("Asynchronous Bus");
/*     */   
/*  69 */   private JMenu tools = new JMenu("Tools");
/*  70 */   private JMenu tools_timeLapse = new JMenu("Time Lapse");
/*  71 */   private JMenuItem tools_timeLapse_add = new JMenuItem("Add");
/*  72 */   private JMenuItem tools_timeLapse_removeAll = new JMenuItem("Remove all");
/*  73 */   private JMenu tools_back_lines = new JMenu("Background Lines");
/*  74 */   private JMenuItem tools_back_lines_show = new JMenuItem("Show/Hide");
/*  75 */   private JMenu tools_antialiasing = new JMenu("Antialiasing");
/*  76 */   private JMenuItem tools_antialiasing_on = new JMenuItem("On/Off");
/*  77 */   private JMenu tools_assertion = new JMenu("Assertion");
/*  78 */   private JMenuItem tools_assertion_add = new JMenuItem("Add");
/*  79 */   private JMenuItem tools_assertion_delete_all = new JMenuItem("Delete All");
/*     */   
/*     */   public ChronoWindow() {
/*  82 */     setTitle("Chronogram Editor v" + Main.version);
/*  83 */     setSize(WIDTH, HEIGHT);
/*  84 */     setLocationRelativeTo(null);
/*  85 */     addKeyListener(this);
/*     */     
/*     */ 
/*     */ 
/*  89 */     UIManager.put("TabbedPane.borderHightlightColor", Color.BLACK);
/*  90 */     UIManager.put("TabbedPane.contentAreaColor", Color.WHITE);
/*  91 */     UIManager.put("TabbedPane.selected", Color.WHITE);
/*     */     
/*  93 */     tabs = new JTabbedPane();
/*  94 */     tabs.addChangeListener(this);
/*  95 */     tabs.setFocusable(false);
/*     */     
/*  97 */     this.docChooser.addChoosableFileFilter(new Filter(".chr", "Chronogram File"));
/*  98 */     this.imgChooser.addChoosableFileFilter(new Filter(".jpg, .png, .gif", ""));
/*     */     
/* 100 */     addComponentListener(new ComponentAdapter() {
/*     */       public void componentResized(ComponentEvent e) {
/* 102 */         String sizeA = e.paramString().split(" ")[2];
/* 103 */         String size = "";
/* 104 */         for (int i = 0; i < sizeA.length(); i++) {
/* 105 */           if (sizeA.charAt(i) != ')') size = size + sizeA.charAt(i);
/*     */         }
/* 107 */         ChronoWindow.WIDTH = Integer.parseInt(size.split("x")[0]);
/* 108 */         ChronoWindow.HEIGHT = Integer.parseInt(size.split("x")[1]);
/* 109 */         ChronoWindow.this.repaint();
/*     */       }
/* 111 */     });
/* 112 */     setDefaultCloseOperation(0);
/* 113 */     addWindowListener(new java.awt.event.WindowAdapter() {
/*     */       public void windowClosing(WindowEvent e) {
/* 115 */         ChronoWindow.this.quit();
/*     */       }
/*     */       
/* 118 */     });
/* 119 */     this.file_new.setAccelerator(KeyStroke.getKeyStroke(78, 2));
/* 120 */     this.file.add(this.file_new);
/* 121 */     this.file_open.setAccelerator(KeyStroke.getKeyStroke(79, 2));
/* 122 */     this.file.add(this.file_open);
/* 123 */     this.file_save.setAccelerator(KeyStroke.getKeyStroke(83, 2));
/* 124 */     this.file.add(this.file_save);
/* 125 */     this.file.add(this.file_save_as);
/* 126 */     this.file.addSeparator();
/* 127 */     this.file_export.setAccelerator(KeyStroke.getKeyStroke(69, 2));
/* 128 */     this.file.add(this.file_export);
/* 129 */     this.file.addSeparator();
/* 130 */     this.file.add(this.file_quit);
/*     */     
/* 132 */     this.add.add(this.add_clock);
/* 133 */     this.add.addSeparator();
/* 134 */     this.add.add(this.add_sync_signal);
/* 135 */     this.add.add(this.add_sync_bus);
/* 136 */     this.add.addSeparator();
/* 137 */     this.add.add(this.add_async_signal);
/* 138 */     this.add.add(this.add_async_bus);
/*     */     
/*     */ 
/* 141 */     this.tools_timeLapse.add(this.tools_timeLapse_add);
/* 142 */     this.tools_timeLapse.add(this.tools_timeLapse_removeAll);
/* 143 */     this.tools.add(this.tools_timeLapse);
/* 144 */     this.tools_back_lines.add(this.tools_back_lines_show);
/* 145 */     this.tools.add(this.tools_back_lines);
/* 146 */     this.tools_antialiasing.add(this.tools_antialiasing_on);
/* 147 */     this.tools.add(this.tools_antialiasing);
/* 148 */     this.tools_assertion.add(this.tools_assertion_add);
/* 149 */     this.tools_assertion.add(this.tools_assertion_delete_all);
/* 150 */     this.tools.add(this.tools_assertion);
/*     */     
/* 152 */     initButtons();
/*     */     
/* 154 */     this.menuBar.add(this.file);
/* 155 */     this.menuBar.add(this.add);
/* 156 */     this.menuBar.add(this.tools);
/*     */     
/*     */ 
/*     */ 
/* 160 */     setJMenuBar(this.menuBar);
/* 161 */     getContentPane().add(tabs);
/*     */     
/* 163 */     setVisible(true);
/*     */   }
/*     */   
/*     */   public void initButtons() {
/* 167 */     this.file_new.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 169 */         ChronoWindow.this.newChrono();
/* 170 */         ChronoWindow.this.repaint();
/*     */       }
/*     */       
/* 173 */     });
/* 174 */     this.file_open.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 176 */         ChronoWindow.this.docChooser.setCurrentDirectory(new File("."));
/*     */         
/* 178 */         if (ChronoWindow.this.docChooser.showOpenDialog(null) == 0) {
/* 179 */           File choosenFile = ChronoWindow.this.docChooser.getSelectedFile();
/* 180 */           if (ChronoWindow.this.docChooser.getFileFilter().accept(choosenFile)) {
/* 181 */             ChronoWindow.this.newChrono();
/* 182 */             Slot.load(choosenFile);
/* 183 */             int maxId = 0;
/* 184 */             for (int i = 0; i < ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).signals.size(); i++) {
/* 185 */               maxId = Math.max(maxId, ((Signals)((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).signals.get(i)).id);
/*     */             }
/* 187 */             Signals.setIdBank(maxId + 1);
/* 188 */             ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).openedFile = choosenFile;
/* 189 */             ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).saveFileOk = true;
/* 190 */             ChronoWindow.this.changeActiveTabTitle(choosenFile.getName());
/*     */           }
/*     */           else {
/* 193 */             JOptionPane.showMessageDialog(null, "File extension did not match \nExptected .chr", "Error", 0);
/*     */           }
/*     */         }
/* 196 */         ChronoWindow.this.repaint();
/*     */       }
/*     */       
/* 199 */     });
/* 200 */     this.file_save.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 202 */         ChronoWindow.this.save(false, ChronoWindow.active);
/*     */       }
/*     */       
/* 205 */     });
/* 206 */     this.file_save_as.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 208 */         ChronoWindow.this.save(true, ChronoWindow.active);
/*     */       }
/*     */       
/* 211 */     });
/* 212 */     this.file_export.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 214 */         ChronoWindow.this.export();
/*     */       }
/*     */       
/* 217 */     });
/* 218 */     this.file_quit.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 220 */         ChronoWindow.this.quit();
/*     */       }
/*     */       
/* 223 */     });
/* 224 */     this.add_clock.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 226 */         DialogBox db = new DialogBox(null, "Add clock", new Clock(""));
/* 227 */         db.showDialog();
/* 228 */         if (db.name != null) {
/* 229 */           if ((db.clockDomain != -1) && (db.ratio > 0.0F)) {
/* 230 */             ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).add(new Clock(db.name, db.freq, db.clockDomain, db.ratio));
/*     */           }
/*     */           else {
/* 233 */             ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).add(new Clock(db.name, db.freq));
/*     */           }
/*     */           
/*     */         }
/*     */       }
/* 238 */     });
/* 239 */     this.add_sync_signal.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 241 */         DialogBox db = new DialogBox(null, "Add synchronous signal", new SyncSignal(""));
/* 242 */         db.showDialog();
/* 243 */         if (db.name != null) { ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).add(new SyncSignal(db.name, db.clockDomain));
/*     */         }
/*     */       }
/* 246 */     });
/* 247 */     this.add_sync_bus.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 249 */         DialogBox db = new DialogBox(null, "Add synchronous bus", new SyncBus(""));
/* 250 */         db.showDialog();
/* 251 */         if (db.name != null) { ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).add(new SyncBus(db.name, db.clockDomain));
/*     */         }
/*     */       }
/* 254 */     });
/* 255 */     this.add_async_signal.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 257 */         DialogBox db = new DialogBox(null, "Add asynchronous signal", new AsyncSignal(""));
/* 258 */         db.showDialog();
/* 259 */         if (db.name != null) { ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).add(new AsyncSignal(db.name, db.freq));
/*     */         }
/*     */       }
/* 262 */     });
/* 263 */     this.add_async_bus.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 265 */         DialogBox db = new DialogBox(null, "Add asynchronous bus", new AsyncBus(""));
/* 266 */         db.showDialog();
/* 267 */         if (db.name != null) { ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).add(new AsyncBus(db.name, db.freq));
/*     */         }
/*     */       }
/* 270 */     });
/* 271 */     this.tools_timeLapse_add.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 273 */         if (((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).nbrTimeLapse < 5) {
/* 274 */           ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).addTimeLapse();
/* 275 */           ChronoWindow.this.repaint();
/*     */         }
/*     */         else {
/* 278 */           JOptionPane.showMessageDialog(null, "Can not set more than 5 timelapses", "Error", 0);
/*     */         }
/*     */         
/*     */       }
/*     */       
/* 283 */     });
/* 284 */     this.tools_timeLapse_removeAll.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 286 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).removeTimeLapse();
/* 287 */         ChronoWindow.this.tools_timeLapse_add.setEnabled(true);
/* 288 */         ChronoWindow.this.repaint();
/*     */       }
/*     */       
/* 291 */     });
/* 292 */     this.tools_back_lines_show.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 294 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).displayBackLines = (!((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).displayBackLines);
/* 295 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).modifToSave = true;
/* 296 */         ChronoWindow.this.repaint();
/*     */       }
/*     */       
/* 299 */     });
/* 300 */     this.tools_antialiasing_on.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 302 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).antialiasing = (!((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).antialiasing);
/* 303 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).modifToSave = true;
/* 304 */         ChronoWindow.this.repaint();
/*     */       }
/*     */       
/* 307 */     });
/* 308 */     this.tools_assertion_add.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 310 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).newAssertion();
/* 311 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).modifToSave = true;
/* 312 */         ChronoWindow.this.repaint();
/*     */       }
/*     */       
/* 315 */     });
/* 316 */     this.tools_assertion_delete_all.addActionListener(new ActionListener() {
/*     */       public void actionPerformed(ActionEvent arg0) {
/* 318 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).removeAssertions();
/* 319 */         ((ChronoPanel)ChronoWindow.chrono.get(ChronoWindow.active)).modifToSave = true;
/* 320 */         ChronoWindow.this.repaint();
/*     */       }
/*     */     });
/*     */   }
/*     */   
/*     */   public void quit() {
/* 326 */     boolean okToQuit = true;
/*     */     
/* 328 */     for (int i = 0; i < chrono.size(); i++) {
/* 329 */       if (((ChronoPanel)chrono.get(i)).modifToSave) { okToQuit = false;
/*     */       }
/*     */     }
/* 332 */     if (!okToQuit) {
/* 333 */       int option = JOptionPane.showConfirmDialog(null, "Some chronograms are not saved.\nExit Chronogram Editor ?", "Confirm exit", 1, 3);
/* 334 */       if ((option != 2) && (option != -1) && 
/* 335 */         (option == 0)) {
/* 336 */         System.exit(0);
/*     */       }
/*     */     }
/*     */     else
/*     */     {
/* 341 */       System.exit(0);
/*     */     }
/*     */   }
/*     */   
/*     */   public void export() {
/* 346 */     if (((ChronoPanel)chrono.get(active)).openedFile != null) {
/* 347 */       this.imgChooser.setCurrentDirectory(((ChronoPanel)chrono.get(active)).openedFile.getParentFile());
/* 348 */       this.imgChooser.setSelectedFile(new File(((ChronoPanel)chrono.get(active)).openedFile.getName().replace("chr", "png")));
/*     */     } else {
/* 350 */       this.imgChooser.setCurrentDirectory(new File("."));
/*     */     }
/* 352 */     if (this.imgChooser.showSaveDialog(null) == 0) {
/* 353 */       File choosenFile = this.imgChooser.getSelectedFile();
/* 354 */       if (this.imgChooser.getFileFilter().accept(choosenFile))
/*     */       {
/* 356 */         ((ChronoPanel)chrono.get(active)).releaseSelection();
/*     */         
/* 358 */         BufferedImage bufImg = new BufferedImage((int)((ChronoPanel)chrono.get(active)).getSize().getWidth(), (int)((ChronoPanel)chrono.get(active)).getSize().getHeight(), 5);
/* 359 */         java.awt.Graphics g = bufImg.getGraphics();
/* 360 */         ((ChronoPanel)chrono.get(active)).paint(g);
/*     */         try {
/* 362 */           if (choosenFile.getName().endsWith("jpg")) ImageIO.write(bufImg, "JPG", choosenFile);
/* 363 */           if (choosenFile.getName().endsWith("png")) ImageIO.write(bufImg, "PNG", choosenFile);
/* 364 */           if (!choosenFile.getName().endsWith("gif")) return; ImageIO.write(bufImg, "GIF", choosenFile);
/*     */         } catch (FileNotFoundException e) {
/* 366 */           JOptionPane.showMessageDialog(null, "File directory error", "Error", 0);
/*     */         } catch (IOException e) {
/* 368 */           JOptionPane.showMessageDialog(null, "Error during exportation", "Error", 0);
/*     */         }
/*     */       }
/*     */       else {
/* 372 */         JOptionPane.showMessageDialog(null, "File extension error", "Error", 0);
/*     */       }
/*     */     }
/*     */   }
/*     */   
/*     */   public void save(boolean saveAs, int chronoIndex) {
/* 378 */     if ((((ChronoPanel)chrono.get(chronoIndex)).saveFileOk) && (!saveAs)) {
/* 379 */       Slot.save(((ChronoPanel)chrono.get(chronoIndex)).openedFile);
/* 380 */       ((ChronoPanel)chrono.get(chronoIndex)).modifToSave = false;
/*     */     }
/*     */     else {
/* 383 */       if (((ChronoPanel)chrono.get(chronoIndex)).openedFile != null) {
/* 384 */         this.docChooser.setCurrentDirectory(((ChronoPanel)chrono.get(chronoIndex)).openedFile.getParentFile());
/* 385 */         this.docChooser.setSelectedFile(new File(((ChronoPanel)chrono.get(active)).openedFile.getName()));
/*     */       } else {
/* 387 */         this.docChooser.setCurrentDirectory(new File("."));
/*     */       }
/* 389 */       if (this.docChooser.showSaveDialog(null) == 0) {
/* 390 */         File choosenFile = this.docChooser.getSelectedFile();
/*     */         
/* 392 */         String[] tmp = choosenFile.getName().split("[.]");
/* 393 */         String ext = "";
/* 394 */         if (tmp.length == 2) { ext = tmp[1];
/*     */         }
/*     */         
/* 397 */         if (ext == "") {
/* 398 */           choosenFile = new File(choosenFile.getPath() + ".chr");
/* 399 */           System.out.println(choosenFile.getPath());
/*     */         }
/*     */         
/* 402 */         if (this.docChooser.getFileFilter().accept(choosenFile)) {
/* 403 */           Slot.save(choosenFile);
/* 404 */           ((ChronoPanel)chrono.get(chronoIndex)).modifToSave = false;
/* 405 */           ((ChronoPanel)chrono.get(chronoIndex)).saveFileOk = true;
/* 406 */           ((ChronoPanel)chrono.get(chronoIndex)).openedFile = choosenFile;
/* 407 */           changeActiveTabTitle(choosenFile.getName());
/*     */         }
/*     */         else {
/* 410 */           JOptionPane.showMessageDialog(null, "File extension error", "Error", 0);
/*     */         }
/*     */       }
/*     */     }
/* 414 */     checkModifToSave();
/*     */   }
/*     */   
/*     */   public void newChrono() {
/* 418 */     chrono.add(new ChronoPanel());
/* 419 */     active = chrono.size() - 1;
/* 420 */     tabs.addTab("New", (java.awt.Component)chrono.get(active));
/* 421 */     tabs.setTabComponentAt(active, new ButtonTabComponent("New", active));
/* 422 */     tabs.setSelectedIndex(active);
/* 423 */     ((ChronoPanel)chrono.get(active)).saveFileOk = false;
/*     */   }
/*     */   
/*     */   public void changeActiveTabTitle(String title) {
/* 427 */     tabs.setTabComponentAt(active, new ButtonTabComponent(title, active));
/* 428 */     ((ChronoPanel)chrono.get(active)).fileName = title;
/*     */   }
/*     */   
/*     */   public void checkModifToSave() {
/* 432 */     if (((ChronoPanel)chrono.get(active)).modifToSave) {
/* 433 */       if (!((ChronoPanel)chrono.get(active)).fileName.endsWith("*")) {
/* 434 */         tabs.setTabComponentAt(active, new ButtonTabComponent(((ChronoPanel)chrono.get(active)).fileName + "*", active));
/* 435 */         ((ChronoPanel)chrono.get(active)).fileName += "*";
/*     */       }
/*     */       
/*     */     }
/* 439 */     else if (((ChronoPanel)chrono.get(active)).fileName.endsWith("*")) {
/* 440 */       ((ChronoPanel)chrono.get(active)).fileName = ((ChronoPanel)chrono.get(active)).fileName.substring(0, ((ChronoPanel)chrono.get(active)).fileName.length() - 1);
/* 441 */       tabs.setTabComponentAt(active, new ButtonTabComponent(((ChronoPanel)chrono.get(active)).fileName, active));
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public void keyPressed(KeyEvent e)
/*     */   {
/* 449 */     if (e.getKeyCode() == 127) {
/* 450 */       ((ChronoPanel)chrono.get(active)).removeSelected();
/* 451 */       repaint();
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public void keyReleased(KeyEvent e) {}
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public void keyTyped(KeyEvent e) {}
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public void stateChanged(ChangeEvent e)
/*     */   {
/* 470 */     JTabbedPane pane = (JTabbedPane)e.getSource();
/* 471 */     active = pane.getSelectedIndex();
/*     */   }
/*     */ }


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