Changeset 84

Show
Ignore:
Timestamp:
24/12/07 19:23:44 (1 year ago)
Author:
altglass
Message:

Deletion of Bitmaps, Fonts, Windows, Layouts and any Item can be un- and redone. RELEASE 0.6.0b

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/vlcskineditor/Main.java

    r74 r84  
    2828import java.io.*; 
    2929import javax.swing.*; 
    30 import javax.swing.border.Border; 
    3130import javax.swing.filechooser.*; 
    3231import javax.swing.tree.*; 
     
    4746 */ 
    4847public class Main extends javax.swing.JFrame implements ActionListener, TreeSelectionListener, WindowListener, MouseListener{ 
    49   /** 
    50   * The version identification of the current build. 
    51   */ 
    52   public final String VERSION = "0.6.0a"; 
     48   
     49  //The version identification of the current build.    
     50  public final String VERSION = "0.6.0b"; 
     51  //The directory in which the VLC executable is found 
    5352  String vlc_dir = ""; 
     53  //The directory from which VLC loads its skins 
    5454  String vlc_skins_dir = ""; 
    5555  JMenuBar mbar; 
     
    109109  //Specifies if a file was opened 
    110110  boolean opened = false; 
    111    
     111  //Handles undoing and redoing of actions 
    112112  public History hist; 
    113113   
     
    538538     
    539539    if(System.getProperty("os.name").indexOf("Windows")!=-1) { 
    540       try {       
    541         Registry r = new Registry();                
    542         RegistryKey vlc_key = r.openSubkey(Registry.HKEY_LOCAL_MACHINE,"Software\\VideoLAN\\VLC",RegistryKey.ACCESS_READ);         
     540      try { 
     541        RegistryKey vlc_key = Registry.openSubkey(Registry.HKEY_LOCAL_MACHINE,"Software\\VideoLAN\\VLC",RegistryKey.ACCESS_READ);         
    543542        String installDir = vlc_key.getStringValue("InstallDir");       
    544543        vlc_dir = installDir+File.separator; 
     
    10081007                                       JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,options[1]); 
    10091008        if(n==0) { 
    1010           s.resources.remove(s.getResource(selected_resource)); 
     1009          Resource r = s.getResource(selected_resource); 
     1010          ResourceDeletionEvent rde = new ResourceDeletionEvent(s,r,s.resources.indexOf(r)); 
     1011          hist.addEvent(rde); 
     1012          s.resources.remove(r); 
    10111013          s.updateResources();           
    10121014        } 
     
    10741076                                         JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,options[1]); 
    10751077          if(n==0) { 
     1078            LayoutDeletionEvent lde = new LayoutDeletionEvent(w, l, w.layouts.indexOf(l), s); 
    10761079            pvwin.clearLayout(); 
    10771080            w.layouts.remove(l); 
    10781081            s.updateWindows(); 
    10791082            s.updateItems(); 
     1083            hist.addEvent(lde); 
    10801084          } 
    10811085        } 
     
    10881092                                         JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,options[1]); 
    10891093          if(n==0) { 
     1094            WindowDeletionEvent wde = new WindowDeletionEvent(w, s, s.windows.indexOf(w)); 
    10901095            s.windows.remove(w); 
    10911096            s.updateWindows(); 
     1097            hist.addEvent(wde); 
    10921098          } 
    10931099        } 
     
    12421248                                         JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE,null,options,options[1]); 
    12431249          if(n==0) { 
     1250            Item i = s.getItem(selected_item); 
     1251            ItemDeletionEvent ide = new ItemDeletionEvent(p,i,p.indexOf(i),s); 
    12441252            p.remove(s.getItem(selected_item)); 
    1245             s.updateItems(); 
     1253            s.updateItems();             
     1254            hist.addEvent(ide); 
    12461255          } 
    12471256        }        
     
    12881297          s.updateItems(); 
    12891298        } 
    1290       } 
    1291        
     1299        else { 
     1300          selected_window = null; 
     1301          selected_layout = null; 
     1302          pvwin.clearLayout(); 
     1303          pvwin.setVisible(false); 
     1304          s.updateItems(); 
     1305        } 
     1306      }       
    12921307    } 
    12931308    else if(e.getSource().equals(items_tree)) {