Changeset 92

Show
Ignore:
Timestamp:
31/12/07 15:43:11 (11 months ago)
Author:
altglass
Message:

Attempt to make the use of window handles as minimal as possible.

Files:

Legend:

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

    r91 r92  
    114114  public History hist; 
    115115   
    116   /** 
     116  /** 
    117117   * Launches the skin editor and initializes the GUI. 
    118118   * @param args Command line arguments passed by the console. 
  • trunk/src/vlcskineditor/Skin.java

    r91 r92  
    3434import javax.swing.tree.*; 
    3535import java.util.*; 
     36import javax.swing.border.EtchedBorder; 
    3637 
    3738/** 
     
    7677  public GlobalVariables gvars = new GlobalVariables(); 
    7778   
     79  //Central window handle for all editing dialogs of res/win/layout/items 
     80  public JFrame edit_frame;  
     81   
    7882  public Skin(Main m_) { 
    79     m=m_; 
     83    m=m_;     
    8084  } 
    8185  /** Creates the file in which to save the new skin **/ 
    8286  public void createNew(File f) { 
    8387    skinfile=f; 
    84     skinfolder = f.getParentFile().getAbsolutePath()+f.separator;     
     88    skinfolder = f.getParentFile().getAbsolutePath()+File.separator;     
    8589    try { 
    8690      skinfile.createNewFile(); 
     
    9599    windows.clear(); 
    96100    skinfile=f; 
    97     skinfolder = f.getParentFile().getAbsolutePath()+f.separator;     
     101    skinfolder = f.getParentFile().getAbsolutePath()+File.separator;     
    98102    try { 
    99103      //System.out.println("Creating Buffered Reader..."); 
     
    233237      theme_frame.setResizable(false); 
    234238      theme_frame.setLayout(new FlowLayout()); 
    235       theme_frame.setDefaultCloseOperation(theme_frame.HIDE_ON_CLOSE); 
     239      theme_frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); 
    236240       
    237241      JLabel themeinfo_name_l = new JLabel("Name:"); 
     
    282286      themeinfo_webpage_l.setBounds(5,105,150,24); 
    283287      themeinfo_webpage_tf.setBounds(160,105,150,24);       
    284       themeinfo_p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.DARK_GRAY), "Theme Information")); 
     288      themeinfo_p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Theme Information")); 
    285289      themeinfo_p.setMinimumSize(new Dimension(315,135)); 
    286290      themeinfo_p.setMaximumSize(new Dimension(315,135)); 
     
    301305      theme_movealpha_l.setBounds(5,75,150,24); 
    302306      theme_movealpha_tf.setBounds(160,75,150,24); 
    303       theme_p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.DARK_GRAY), "Theme Attributes")); 
     307      theme_p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Theme Attributes")); 
    304308      theme_p.setMinimumSize(new Dimension(315,105)); 
    305309      theme_p.setMaximumSize(new Dimension(315,105)); 
     
    345349      theme_movealpha = Integer.parseInt(theme_movealpha_tf.getText()); 
    346350      theme_frame.setVisible(false); 
     351      theme_frame.dispose(); 
     352      theme_frame = null; 
    347353      tee.setNew(); 
    348354      m.hist.addEvent(tee); 
     
    363369      } 
    364370    } 
    365     else if(e.getSource().equals(theme_cancel_btn)) theme_frame.setVisible(false); 
     371    else if(e.getSource().equals(theme_cancel_btn)) { 
     372      theme_frame.setVisible(false); 
     373      theme_frame.dispose(); 
     374      theme_frame = null; 
     375    } 
    366376  } 
    367377  /** Generates a new number for unnamed items so that every id is unique **/   
     
    537547    code += HEADER+"\n"; 
    538548    code += "<Theme version=\""+theme_version+"\""; 
    539     if(theme_tooltipfont!=THEME_TOOLTIPFONT_DEFAULT) code+=" tooltipfont=\""+theme_tooltipfont+"\""; 
     549    if(!theme_tooltipfont.equals(THEME_TOOLTIPFONT_DEFAULT)) code+=" tooltipfont=\""+theme_tooltipfont+"\""; 
    540550    if(theme_magnet!=THEME_MAGNET_DEFAULT) code+=" magnet=\""+String.valueOf(theme_magnet)+"\""; 
    541551    if(theme_alpha!=THEME_ALPHA_DEFAULT) code+=" alpha=\""+String.valueOf(theme_alpha)+"\""; 
  • trunk/src/vlcskineditor/items/Anchor.java

    r83 r92  
    108108      s.updateItems(); 
    109109      s.expandItem(id); 
    110       frame.setDefaultCloseOperation(frame.HIDE_ON_CLOSE); 
     110      frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE); 
    111111      created = true; 
    112112      ItemAddEvent aae = new ItemAddEvent(s.getParentListOf(id),this); 
     
    134134      frame.setResizable(false); 
    135135      frame.setLayout(new FlowLayout()); 
    136       if(!created) frame.setDefaultCloseOperation(frame.DO_NOTHING_ON_CLOSE); 
     136      if(!created) frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); 
    137137      JLabel id_l = new JLabel("ID:"); 
    138138      id_tf = new JTextField(); 
     
    240240        } 
    241241      } 
     242      update(); 
    242243      frame.setVisible(false); 
    243       update(); 
     244      frame.dispose(); 
     245      frame = null;       
    244246    } 
    245247    else if(e.getSource().equals(help_btn)) { 
     
    264266      } 
    265267      frame.setVisible(false); 
     268      frame.dispose(); 
     269      frame = null; 
    266270    } 
    267271  } 
     
    271275    if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\""; 
    272276    code+=" priority=\""+String.valueOf(priority)+"\""; 
    273     if (lefttop!=LEFTTOP_DEFAULT) code+=" lefttop=\""+lefttop+"\"";     
     277    if (!lefttop.equals(LEFTTOP_DEFAULT)) code+=" lefttop=\""+lefttop+"\"";     
    274278    code+="/>"; 
    275279    //if (id!=ID_DEFAULT) code+="<!-- id=\""+id+"\" -->"; 
     
    293297    } 
    294298  } 
     299  @Override 
    295300  public boolean contains(int x_, int y_) { 
    296     int h = b.getHeight(); 
     301    return true; 
     302    /*int h = b.getHeight(); 
    297303    int w = b.getWidth(); 
    298     return (x_>=x+offsetx && x_<=x+offsetx+w && y_>=y+offsety && y_<=y+offsety+h);   
     304    return (x_>=x+offsetx && x_<=x+offsetx+w && y_>=y+offsety && y_<=y+offsety+h);*/ 
    299305  } 
    300306  public DefaultMutableTreeNode getTreeNode() { 
  • trunk/src/vlcskineditor/items/Button.java

    r89 r92  
    320320      } 
    321321      update(); 
    322       frame.setVisible(false);       
     322      frame.setVisible(false); 
     323      frame.dispose(); 
     324      frame = null; 
    323325    } 
    324326    else if(e.getSource().equals(help_btn)) { 
     
    362364      } 
    363365      frame.setVisible(false); 
    364     } 
    365   } 
     366      frame.dispose(); 
     367      frame = null; 
     368    } 
     369  } 
     370  @Override 
    366371  public void actionWasEdited(ActionEditor ae) { 
    367372    if(ae==action_ae) action_tf.setText(ae.getCode()); 
     
    370375    String code = "<Button"; 
    371376    code+=" up=\""+up+"\""; 
    372     if (down!=DOWN_DEFAULT) code+=" down=\""+down+"\""; 
    373     if (over!=OVER_DEFAULT) code+=" over=\""+over+"\""; 
    374     if (action!=ACTION_DEFAULT) code+=" action=\""+action+"\""; 
    375     if (id!=ID_DEFAULT) code+=" id=\""+id+"\""; 
     377    if (!down.equals(DOWN_DEFAULT)) code+=" down=\""+down+"\""; 
     378    if (!over.equals(OVER_DEFAULT)) code+=" over=\""+over+"\""; 
     379    if (!action.equals(ACTION_DEFAULT)) code+=" action=\""+action+"\""; 
     380    if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\""; 
    376381    if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\""; 
    377382    if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\""; 
    378     if (lefttop!=LEFTTOP_DEFAULT) code+=" lefttop=\""+lefttop+"\""; 
    379     if (rightbottom!=RIGHTBOTTOM_DEFAULT) code+=" rightbottom=\""+rightbottom+"\""; 
     383    if (!lefttop.equals(LEFTTOP_DEFAULT)) code+=" lefttop=\""+lefttop+"\""; 
     384    if (!rightbottom.equals(RIGHTBOTTOM_DEFAULT)) code+=" rightbottom=\""+rightbottom+"\""; 
    380385    if (xkeepratio!=XKEEPRATIO_DEFAULT) code+=" xkeepratio=\""+String.valueOf(xkeepratio)+"\""; 
    381386    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    382     if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
    383     if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
    384     if (tooltiptext!=TOOLTIPTEXT_DEFAULT) code+=" tooltiptext=\""+tooltiptext+"\""; 
     387    if (!help.equals(HELP_DEFAULT)) code+=" help=\""+help+"\""; 
     388    if (!visible.equals(VISIBLE_DEFAULT)) code+=" visible=\""+visible+"\""; 
     389    if (!tooltiptext.equals(TOOLTIPTEXT_DEFAULT)) code+=" tooltiptext=\""+tooltiptext+"\""; 
    385390    code+="/>"; 
    386391    return code; 
  • trunk/src/vlcskineditor/items/Checkbox.java

    r89 r92  
    436436      } 
    437437      update(); 
    438       frame.setVisible(false);       
     438      frame.setVisible(false);  
     439      frame.dispose(); 
     440      frame = null; 
    439441    } 
    440442    else if(e.getSource().equals(help_btn)) { 
     
    497499      } 
    498500      frame.setVisible(false); 
     501      frame.dispose(); 
     502      frame = null; 
    499503    } 
    500504  } 
     
    507511    String code = "<Checkbox"; 
    508512    code+=" state=\""+state+"\" up1=\""+up1+"\" up2=\""+up2+"\""; 
    509     if (down1!=ID_DEFAULT) code+=" down1=\""+down1+"\""; 
    510     if (down2!=ID_DEFAULT) code+=" down2=\""+down2+"\""; 
    511     if (over1!=ID_DEFAULT) code+=" over1=\""+over1+"\""; 
    512     if (over2!=ID_DEFAULT) code+=" over2=\""+over2+"\""; 
    513     if (action1!=ID_DEFAULT) code+=" action1=\""+action1+"\""; 
    514     if (action2!=ID_DEFAULT) code+=" action2=\""+action2+"\""; 
    515     if (tooltiptext1!=ID_DEFAULT) code+=" tooltiptext1=\""+tooltiptext1+"\""; 
    516     if (tooltiptext2!=ID_DEFAULT) code+=" tooltiptext2=\""+tooltiptext2+"\""; 
    517     if (id!=ID_DEFAULT) code+=" id=\""+id+"\""; 
     513    if (!down1.equals(ID_DEFAULT)) code+=" down1=\""+down1+"\""; 
     514    if (!down2.equals(ID_DEFAULT)) code+=" down2=\""+down2+"\""; 
     515    if (!over1.equals(ID_DEFAULT)) code+=" over1=\""+over1+"\""; 
     516    if (!over2.equals(ID_DEFAULT)) code+=" over2=\""+over2+"\""; 
     517    if (!action1.equals(ID_DEFAULT)) code+=" action1=\""+action1+"\""; 
     518    if (!action2.equals(ID_DEFAULT)) code+=" action2=\""+action2+"\""; 
     519    if (!tooltiptext1.equals(ID_DEFAULT)) code+=" tooltiptext1=\""+tooltiptext1+"\""; 
     520    if (!tooltiptext2.equals(ID_DEFAULT)) code+=" tooltiptext2=\""+tooltiptext2+"\""; 
     521    if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\""; 
    518522    if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\""; 
    519523    if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\""; 
    520     if (lefttop!=LEFTTOP_DEFAULT) code+=" lefttop=\""+lefttop+"\""; 
    521     if (rightbottom!=RIGHTBOTTOM_DEFAULT) code+=" rightbottom=\""+rightbottom+"\""; 
     524    if (!lefttop.equals(LEFTTOP_DEFAULT)) code+=" lefttop=\""+lefttop+"\""; 
     525    if (!rightbottom.equals(RIGHTBOTTOM_DEFAULT)) code+=" rightbottom=\""+rightbottom+"\""; 
    522526    if (xkeepratio!=XKEEPRATIO_DEFAULT) code+=" xkeepratio=\""+String.valueOf(xkeepratio)+"\""; 
    523527    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    524     if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
    525     if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
     528    if (!help.equals(HELP_DEFAULT)) code+=" help=\""+help+"\""; 
     529    if (!visible.equals(VISIBLE_DEFAULT)) code+=" visible=\""+visible+"\""; 
    526530    code+="/>"; 
    527531    return code; 
  • trunk/src/vlcskineditor/items/Group.java

    r89 r92  
    216216        } 
    217217      } 
     218      update(); 
    218219      frame.setVisible(false); 
    219       update(); 
     220      frame.dispose(); 
     221      frame = null;       
    220222    } 
    221223    else if(e.getSource().equals(help_btn)) { 
     
    240242      } 
    241243      frame.setVisible(false); 
     244      frame.dispose(); 
     245      frame = null; 
    242246    } 
    243247  } 
  • trunk/src/vlcskineditor/items/Image.java

    r89 r92  
    306306      } 
    307307      update(); 
    308       frame.setVisible(false);       
     308      frame.setVisible(false); 
     309      frame.dispose(); 
     310      frame = null; 
    309311    } 
    310312    else if(e.getSource().equals(help_btn)) { 
     
    345347      } 
    346348      frame.setVisible(false); 
     349      frame.dispose(); 
     350      frame = null; 
    347351    } 
    348352  } 
     
    352356  } 
    353357  public String returnCode() { 
    354     String code = "<Image"; 
    355     if (id!=ID_DEFAULT) code+=" id=\""+id+"\"";     
    356     code+=" image=\""+image+"\""; 
    357     if (action!=ACTION_DEFAULT) code+=" action=\""+action+"\""; 
    358     if (action2!=ACTION2_DEFAULT) code+=" action2=\""+action2+"\""; 
     358    String code = "<Image";     
     359    if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\""; 
    359360    if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\""; 
    360361    if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\""; 
    361     if (lefttop!=LEFTTOP_DEFAULT) code+=" lefttop=\""+lefttop+"\""; 
    362     if (rightbottom!=RIGHTBOTTOM_DEFAULT) code+=" rightbottom=\""+rightbottom+"\""; 
     362     
     363    code+=" image=\""+image+"\""; 
     364    if (!action.equals(ACTION_DEFAULT)) code+=" action=\""+action+"\""; 
     365    if (!action2.equals(ACTION2_DEFAULT)) code+=" action2=\""+action2+"\""; 
     366     
     367    if (!lefttop.equals(LEFTTOP_DEFAULT)) code+=" lefttop=\""+lefttop+"\""; 
     368    if (!rightbottom.equals(RIGHTBOTTOM_DEFAULT)) code+=" rightbottom=\""+rightbottom+"\""; 
    363369    if (xkeepratio!=XKEEPRATIO_DEFAULT) code+=" xkeepratio=\""+String.valueOf(xkeepratio)+"\""; 
    364370    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    365     if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
    366     if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
     371    if (!help.equals(HELP_DEFAULT)) code+=" help=\""+help+"\""; 
     372    if (!visible.equals(VISIBLE_DEFAULT)) code+=" visible=\""+visible+"\""; 
    367373    code+="/>"; 
    368374    return code; 
  • trunk/src/vlcskineditor/items/Panel.java

    r89 r92  
    324324      } 
    325325      update(); 
    326       frame.setVisible(false);       
     326      frame.setVisible(false);   
     327      frame.dispose(); 
     328      frame = null; 
    327329    } 
    328330    else if(e.getSource().equals(help_btn)) { 
     
    347349      } 
    348350      frame.setVisible(false); 
     351      frame.dispose(); 
     352      frame = null; 
    349353    } 
    350354  } 
     
    354358    if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\""; 
    355359    code+=" width=\""+String.valueOf(width)+"\" height=\""+String.valueOf(height)+"\""; 
    356     if (lefttop!=LEFTTOP_DEFAULT) code+=" lefttop=\""+lefttop+"\""; 
    357     if (rightbottom!=RIGHTBOTTOM_DEFAULT) code+=" rightbottom=\""+rightbottom+"\""; 
     360    if (!lefttop.equals(LEFTTOP_DEFAULT)) code+=" lefttop=\""+lefttop+"\""; 
     361    if (!rightbottom.equals(RIGHTBOTTOM_DEFAULT)) code+=" rightbottom=\""+rightbottom+"\""; 
    358362    if (xkeepratio!=XKEEPRATIO_DEFAULT) code+=" xkeepratio=\""+String.valueOf(xkeepratio)+"\""; 
    359363    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    360364    code+=">"; 
    361     if (id!=ID_DEFAULT) code+="<!--  id=\""+id+"\" -->"; 
     365    if (!id.equals(ID_DEFAULT)) code+="<!--  id=\""+id+"\" -->"; 
    362366    for (int i=0;i<items.size();i++) { 
    363367      code+="\n"+items.get(i).returnCode(); 
  • trunk/src/vlcskineditor/items/Playtree.java

    r89 r92  
    491491      } 
    492492      update(); 
    493       frame.setVisible(false);            
     493      frame.setVisible(false); 
     494      frame.dispose(); 
     495      frame = null; 
    494496    } 
    495497    else if (e.getSource().equals(bgcolor1_btn)) { 
     
    596598      } 
    597599      frame.setVisible(false); 
     600      frame.dispose(); 
     601      frame = null; 
    598602    } 
    599603  } 
    600604  public String returnCode() { 
    601605    String code = "<Playtree"; 
    602     if (id!=ID_DEFAULT) code+=" id=\""+id+"\""; 
     606    if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\""; 
    603607    code+=" font=\""+font+"\""; 
    604     if(bgcolor1!=BGCOLOR1_DEFAULT) code+=" bgcolor1=\""+bgcolor1+"\""; 
    605     if(bgcolor2!=BGCOLOR2_DEFAULT) code+=" bgcolor2=\""+bgcolor2+"\""; 
    606     if(fgcolor!=FGCOLOR_DEFAULT) code+=" fgcolor=\""+fgcolor+"\""; 
    607     if(selcolor!=SELCOLOR_DEFAULT) code+=" selcolor=\""+selcolor+"\""; 
    608     if(playcolor!=PLAYCOLOR_DEFAULT) code+=" playcolor=\""+playcolor+"\""; 
    609     if(bgimage!=BGIMAGE_DEFAULT) code+=" bgimage=\""+bgimage+"\""; 
    610     if(itemimage!=ITEMIMAGE_DEFAULT) code+=" itemimage=\""+itemimage+"\""; 
    611     if(openimage!=OPENIMAGE_DEFAULT) code+=" openimage=\""+openimage+"\""; 
    612     if(closedimage!=CLOSEDIMAGE_DEFAULT) code+=" closedimage=\""+closedimage+"\""; 
    613     if(var!=VAR_DEFAULT) code+=" var=\""+var+"\""; 
     608    if(!bgcolor1.equals(BGCOLOR1_DEFAULT)) code+=" bgcolor1=\""+bgcolor1+"\""; 
     609    if(!bgcolor2.equals(BGCOLOR2_DEFAULT)) code+=" bgcolor2=\""+bgcolor2+"\""; 
     610    if(!fgcolor.equals(FGCOLOR_DEFAULT)) code+=" fgcolor=\""+fgcolor+"\""; 
     611    if(!selcolor.equals(SELCOLOR_DEFAULT)) code+=" selcolor=\""+selcolor+"\""; 
     612    if(!playcolor.equals(PLAYCOLOR_DEFAULT)) code+=" playcolor=\""+playcolor+"\""; 
     613    if(!bgimage.equals(BGIMAGE_DEFAULT)) code+=" bgimage=\""+bgimage+"\""; 
     614    if(!itemimage.equals(ITEMIMAGE_DEFAULT)) code+=" itemimage=\""+itemimage+"\""; 
     615    if(!openimage.equals(OPENIMAGE_DEFAULT)) code+=" openimage=\""+openimage+"\""; 
     616    if(!closedimage.equals(CLOSEDIMAGE_DEFAULT)) code+=" closedimage=\""+closedimage+"\""; 
     617    if(!var.equals(VAR_DEFAULT)) code+=" var=\""+var+"\""; 
    614618    if(flat!=FLAT_DEFAULT) code+=" flat=\""+String.valueOf(flat)+"\""; 
    615619    if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\""; 
    616620    if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\""; 
    617     if (width!=WIDTH_DEFAULT) code+=" width=\""+String.valueOf(width)+"\""; 
    618     if (height!=HEIGHT_DEFAULT) code+=" height=\""+String.valueOf(height)+"\""; 
    619     if (lefttop!=LEFTTOP_DEFAULT) code+=" lefttop=\""+lefttop+"\""; 
    620     if (rightbottom!=RIGHTBOTTOM_DEFAULT) code+=" rightbottom=\""+rightbottom+"\""; 
     621    if (!lefttop.equals(LEFTTOP_DEFAULT)) code+=" lefttop=\""+lefttop+"\""; 
     622    if (!rightbottom.equals(RIGHTBOTTOM_DEFAULT)) code+=" rightbottom=\""+rightbottom+"\""; 
    621623    if (xkeepratio!=XKEEPRATIO_DEFAULT) code+=" xkeepratio=\""+String.valueOf(xkeepratio)+"\""; 
    622624    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    623     if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
    624     if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
     625    if (!help.equals(HELP_DEFAULT)) code+=" help=\""+help+"\""; 
     626    if (!visible.equals(VISIBLE_DEFAULT)) code+=" visible=\""+visible+"\"";     
    625627    code+=">\n";     
    626628    code+=slider.returnCode(); 
  • trunk/src/vlcskineditor/items/Slider.java

    r89 r92  
    453453      } 
    454454      update(); 
    455       frame.setVisible(false);       
     455      frame.setVisible(false); 
     456      frame.dispose(); 
     457      frame = null; 
    456458    } 
    457459    else if(e.getSource().equals(help_btn)) { 
     
    504506      } 
    505507      frame.setVisible(false); 
     508      frame.dispose(); 
     509      frame = null; 
    506510    } 
    507511  } 
     
    514518  public String returnCode() { 
    515519    String code = "<Slider"; 
    516     if (id!=ID_DEFAULT) code+=" id=\""+id+"\""; 
     520    if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\""; 
    517521    if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\""; 
    518522    if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\""; 
    519523    code+=" points=\""+points+"\""; 
    520524    if (thickness!=THICKNESS_DEFAULT) code+=" thickness=\""+String.valueOf(thickness)+"\""; 
    521     if (value!=VALUE_DEFAULT) code+=" value=\""+value+"\""; 
    522     if (tooltiptext!=TOOLTIPTEXT_DEFAULT) code+=" tooltiptext=\""+tooltiptext+"\""; 
     525    if (!value.equals(VALUE_DEFAULT)) code+=" value=\""+value+"\""; 
     526    if (!tooltiptext.equals(TOOLTIPTEXT_DEFAULT)) code+=" tooltiptext=\""+tooltiptext+"\""; 
    523527    code+=" up=\""+up+"\""; 
    524     if (down!=DOWN_DEFAULT) code+=" down=\""+down+"\""; 
    525     if (over!=OVER_DEFAULT) code+=" over=\""+over+"\""; 
    526     if (lefttop!=LEFTTOP_DEFAULT) code+=" lefttop=\""+lefttop+"\""; 
    527     if (rightbottom!=RIGHTBOTTOM_DEFAULT) code+=" rightbottom=\""+rightbottom+"\""; 
     528    if (!down.equals(DOWN_DEFAULT)) code+=" down=\""+down+"\""; 
     529    if (!over.equals(OVER_DEFAULT)) code+=" over=\""+over+"\""; 
     530    if (!lefttop.equals(LEFTTOP_DEFAULT)) code+=" lefttop=\""+lefttop+"\""; 
     531    if (!rightbottom.equals(RIGHTBOTTOM_DEFAULT)) code+=" rightbottom=\""+rightbottom+"\""; 
    528532    if (xkeepratio!=XKEEPRATIO_DEFAULT) code+=" xkeepratio=\""+String.valueOf(xkeepratio)+"\""; 
    529533    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    530     if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
    531     if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
     534    if (!help.equals(HELP_DEFAULT)) code+=" help=\""+help+"\""; 
     535    if (!visible.equals(VISIBLE_DEFAULT)) code+=" visible=\""+visible+"\""; 
    532536    if (sbg==null) { 
    533537      code+="/>"; 
  • trunk/src/vlcskineditor/items/SliderBackground.java

    r89 r92  
    219219      } 
    220220      update(); 
    221       frame.setVisible(false);       
     221      frame.setVisible(false); 
     222      frame.dispose(); 
     223      frame = null; 
    222224    } 
    223225    else if(e.getSource().equals(help_btn)) { 
     
    241243    else if(e.getSource().equals(cancel_btn)) { 
    242244      frame.setVisible(false); 
     245      frame.dispose(); 
     246      frame = null; 
    243247      if(!created) sl.removeBG();       
    244248    } 
     
    246250  public String returnCode() { 
    247251    String code = "<SliderBackground"; 
    248     if (id!=ID_DEFAULT) code+=" id=\""+id+"\""; 
     252    if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\""; 
    249253    code+=" image=\""+image+"\""; 
    250254    if (nbhoriz!=NBHORIZ_DEFAULT) code+=" nbhoriz=\""+String.valueOf(nbhoriz)+"\""; 
  • trunk/src/vlcskineditor/items/Text.java

    r89 r92  
    327327      } 
    328328      update(); 
    329       frame.setVisible(false);       
     329      frame.setVisible(false); 
     330      frame.dispose(); 
     331      frame = null; 
    330332    } 
    331333    else if(e.getSource().equals(help_btn)) { 
     
    378380      } 
    379381      frame.setVisible(false); 
     382      frame.dispose(); 
     383      frame = null; 
    380384    } 
    381385  } 
     
    384388    code+=" text=\""+text+"\""; 
    385389    code+=" font=\""+font+"\""; 
    386     if(alignment!=ALIGNMENT_DEFAULT) code+=" alignment=\""+alignment+"\""; 
    387     if (color!=COLOR_DEFAULT) code+=" color=\""+color+"\""; 
    388     if (id!=ID_DEFAULT) code+=" id=\""+id+"\""; 
     390    if (!alignment.equals(ALIGNMENT_DEFAULT)) code+=" alignment=\""+alignment+"\""; 
     391    if (!color.equals(COLOR_DEFAULT)) code+=" color=\""+color+"\""; 
     392    if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\""; 
    389393    if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\""; 
    390394    if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\""; 
    391395    if (width!=WIDTH_DEFAULT) code+=" width=\""+String.valueOf(width)+"\""; 
    392     if (lefttop!=LEFTTOP_DEFAULT) code+=" lefttop=\""+lefttop+"\""; 
    393     if (rightbottom!=RIGHTBOTTOM_DEFAULT) code+=" rightbottom=\""+rightbottom+"\""; 
     396    if (!lefttop.equals(LEFTTOP_DEFAULT)) code+=" lefttop=\""+lefttop+"\""; 
     397    if (!rightbottom.equals(RIGHTBOTTOM_DEFAULT)) code+=" rightbottom=\""+rightbottom+"\""; 
    394398    if (xkeepratio!=XKEEPRATIO_DEFAULT) code+=" xkeepratio=\""+String.valueOf(xkeepratio)+"\""; 
    395399    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    396     if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
    397     if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
     400    if (!help.equals(HELP_DEFAULT)) code+=" help=\""+help+"\""; 
     401    if (!visible.equals(VISIBLE_DEFAULT)) code+=" visible=\""+visible+"\""; 
    398402    code+="/>"; 
    399403    return code; 
  • trunk/src/vlcskineditor/items/Video.java

    r83 r92  
    283283      }       
    284284      update(); 
    285       frame.setVisible(false);       
     285      frame.setVisible(false); 
     286      frame.dispose(); 
     287      frame = null; 
    286288    } 
    287289    else if(e.getSource().equals(help_btn)) { 
     
    321323      } 
    322324      frame.setVisible(false); 
     325      frame.dispose(); 
     326      frame = null; 
    323327    } 
    324328  } 
    325329  public String returnCode() { 
    326330    String code = "<Video"; 
    327     if (id!=ID_DEFAULT) code+=" id=\""+id+"\""; 
     331    if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\""; 
    328332    if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\""; 
    329333    if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\""; 
     
    331335    if (height!=HEIGHT_DEFAULT) code+=" height=\""+String.valueOf(height)+"\""; 
    332336    if (autoresize!=AUTORESIZE_DEFAULT) code+=" autoresize=\""+String.valueOf(autoresize)+"\""; 
    333     if (lefttop!=LEFTTOP_DEFAULT) code+=" lefttop=\""+lefttop+"\""; 
    334     if (rightbottom!=RIGHTBOTTOM_DEFAULT) code+=" rightbottom=\""+rightbottom+"\""; 
     337    if (!lefttop.equals(LEFTTOP_DEFAULT)) code+=" lefttop=\""+lefttop+"\""; 
     338    if (!rightbottom.equals(RIGHTBOTTOM_DEFAULT)) code+=" rightbottom=\""+rightbottom+"\""; 
    335339    if (xkeepratio!=XKEEPRATIO_DEFAULT) code+=" xkeepratio=\""+String.valueOf(xkeepratio)+"\""; 
    336340    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    337     if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
    338     if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
     341    if (!help.equals(HELP_DEFAULT)) code+=" help=\""+help+"\""; 
     342    if (!visible.equals(VISIBLE_DEFAULT)) code+=" visible=\""+visible+"\""; 
    339343    code+="/>"; 
    340344    return code; 
  • trunk/src/vlcskineditor/resources/Bitmap.java

    r91 r92  
    324324        return; 
    325325      }       
     326      update();     
    326327      frame.setVisible(false); 
    327       update();       
     328      frame.dispose(); 
     329      frame = null;         
    328330    } 
    329331    else if(e.getSource().equals(help_btn)) { 
     
    344346    else if(e.getSource().equals(cancel_btn)) { 
    345347      frame.setVisible(false); 
     348      frame.dispose(); 
     349      frame = null; 
    346350    } 
    347351  } 
     
    370374    return node; 
    371375  } 
     376  @Override 
    372377  public Resource getParentOf(String id_) { 
    373378    for(SubBitmap sbmp:SubBitmaps) { 
  • trunk/src/vlcskineditor/resources/Font.java

    r88 r92  
    241241        return; 
    242242      } 
     243      update();  
    243244      frame.setVisible(false); 
    244       update();       
     245      frame.dispose(); 
     246      frame = null;            
    245247    } 
    246248    else if(e.getSource().equals(help_btn)) { 
     
    261263    else if(e.getSource().equals(cancel_btn)) { 
    262264      frame.setVisible(false); 
     265      frame.dispose(); 
     266      frame = null; 
    263267    } 
    264268  } 
  • trunk/src/vlcskineditor/resources/SubBitmap.java

    r91 r92  
    108108      nbframes=Integer.parseInt(nbframes_tf.getText()); 
    109109      fps=Integer.parseInt(fps_tf.getText());    
    110       frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);     
     110      //frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);     
    111111      updateImage(); 
    112112      s.updateResources(); 
     
    124124      nbframes=Integer.parseInt(nbframes_tf.getText()); 
    125125      fps=Integer.parseInt(fps_tf.getText());    
    126       frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);     
     126      //frame.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);     
    127127      updateImage(); 
    128128      s.updateResources(); 
     
    273273        return; 
    274274      } 
    275       frame.setVisible(false);             
     275      update();       
     276      frame.setVisible(false);         
    276277      destroyEditWindow(); 
    277       update();       
     278      frame.dispose(); 
     279      frame = null;       
    278280    } 
    279281    else if(e.getSource().equals(help_btn)) { 
     
    293295    } 
    294296    else if(e.getSource().equals(cancel_btn)) { 
    295       frame.setVisible(false); 
     297      frame.setVisible(false);       
    296298      destroyEditWindow(); 
     299      frame.dispose(); 
     300      frame = null; 
    297301      if(!created) parent.SubBitmaps.remove(this);       
    298302    } 
     
    305309    height_tf.removeKeyListener(sbew); 
    306310    frame.removeWindowListener(sbew); 
     311    sbew.frame.dispose(); 
    307312    sbew.frame = null; 
    308313    sbew = null;