Changeset 25

Show
Ignore:
Timestamp:
07/09/07 12:31:21 (1 year ago)
Author:
altglass
Message:

Release 0.3.5a finished
All items are rendered more or less properly (except sliders, there only the background is rendered)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/README.TXT

    r17 r25  
    1 VLC Skin Editor release 0.3.0b 
     1VLC Skin Editor release 0.3.5a 
    22----------------------------------------------------------- 
    33Changelog: 
    44----------------------------------------------------------- 
     50.3.5a - Preview of Layouts 
     6       - XML parsing/generating fixes 
    570.3.0b - All items can be edited 
    68       - Theme attributes can be edited 
     
    2628System Requirements 
    2729----------------------------------------------------------- 
    28 Java Runtime Environment 6+ (java.sun.com) 
    29 at least 256MB RAM and a half-decent cpu 
     30Java SE RE 6 or later (DL at java.sun.com) 
     31approximately at least 256MB RAM and a 500-1000MHz CPU 
    3032----------------------------------------------------------- 
    3133Usage: 
     
    3335To run the skin editor simply open the jar file. 
    3436Or manually run "java -jar VLCSkinEditor.jar". 
    35  
    36 To edit things select the item in the trees and click on 
    37 the edit button. To add things use the add buttons. Self- 
    38 explanatory isn't it? 
    3937----------------------------------------------------------- 
    4038Copyright: 
    4139----------------------------------------------------------- 
    42 (c)2007 Daniel "aLtgLasS" Dreibrodt (altglass@nurfuerspam.de) 
     40(c)2007 Daniel "aLtgLasS" Dreibrodt  
     41        (altglass@nurfuerspam.de)     
    4342See LICENSE.TXT for further details 
  • trunk/src/vlcskineditor/Items/Playtree.java

    r22 r25  
    2626import java.awt.*; 
    2727import java.awt.event.*; 
     28import java.awt.image.*; 
    2829import javax.swing.*; 
    2930import javax.swing.tree.*; 
     
    6667   
    6768  Slider slider = null; 
    68    
    6969   
    7070  JFrame frame = null; 
     
    547547    g.setFont(f); 
    548548    FontMetrics fm = g.getFontMetrics(); 
    549     if(!bgimage.startsWith("none")) { 
     549    if(!bgimage.equals("none")) { 
    550550      g.drawImage(s.getBitmapImage(bgimage),x+x_,y+y_,null); 
    551551    } 
     
    558558      } 
    559559    } 
     560    int liney = y+y_;     
     561    BufferedImage cfi = s.getBitmapImage(closedimage); 
     562    BufferedImage ofi = s.getBitmapImage(openimage); 
     563    BufferedImage iti = s.getBitmapImage(itemimage); 
     564    int lineheight = fm.getHeight();     
     565    if(cfi!=null) { 
     566      if(cfi.getHeight()>lineheight) lineheight=cfi.getHeight(); 
     567    } 
     568    if(ofi!=null) { 
     569      if(ofi.getHeight()>lineheight) lineheight=ofi.getHeight(); 
     570    } 
     571    if(iti!=null) { 
     572      if(iti.getHeight()>lineheight) lineheight=iti.getHeight(); 
     573    } 
     574    int text_offset = (lineheight-fm.getAscent())/2; 
     575    int cfi_offset = (lineheight-cfi.getHeight())/2; 
     576    int ofi_offset = (lineheight-ofi.getHeight())/2; 
     577    int iti_offset = (lineheight-iti.getHeight())/2;     
     578     
     579    g.setColor(Color.decode(fgcolor)); 
     580    if(cfi!=null && !flat) {         
     581      g.drawImage(cfi,x+x_,liney+cfi_offset,null); 
     582      liney+=lineheight; 
     583      g.drawString("Closed folder",x+x_+cfi.getWidth()+2,liney-text_offset);           
     584    } 
     585    if(ofi!=null && !flat) { 
     586      g.drawImage(ofi,x+x_,liney+ofi_offset,null); 
     587      liney+=lineheight; 
     588      g.drawString("Open folder",x+x_+ofi.getWidth()+2,liney-text_offset);           
     589    } 
     590    if(ofi!=null && iti!=null && !flat) { 
     591      g.drawImage(iti,x+x_+ofi.getWidth()+2,liney+iti_offset,null); 
     592      liney+=lineheight; 
     593      g.drawString("Normal item",x+x_+ofi.getWidth()+iti.getWidth()+4,liney-text_offset); 
     594    } 
     595    else if(iti!=null) { 
     596      g.drawImage(iti,x+x_,liney+iti_offset,null); 
     597      liney+=fm.getHeight(); 
     598      g.drawString("Normal item",x+x_+iti.getWidth()+4,liney-text_offset); 
     599    } 
     600    else { 
     601      liney+=fm.getHeight(); 
     602      g.drawString("Normal item",x+x_,liney-text_offset); 
     603    } 
     604    g.setColor(Color.decode(playcolor)); 
     605    if(ofi!=null && iti!=null && !flat) { 
     606      g.drawImage(iti,x+x_+ofi.getWidth()+2,liney+iti_offset,null); 
     607      liney+=lineheight; 
     608      g.drawString("Playing item",x+x_+ofi.getWidth()+iti.getWidth()+4,liney-text_offset); 
     609    } 
     610    else if(iti!=null) { 
     611      g.drawImage(iti,x+x_,liney+iti_offset,null); 
     612      liney+=lineheight; 
     613      g.drawString("Playing item",x+x_+iti.getWidth()+2,liney-text_offset); 
     614    } 
     615    else { 
     616      liney+=lineheight; 
     617      g.drawString("Playing item",x+x_,liney-text_offset); 
     618    } 
     619    g.setColor(Color.decode(selcolor)); 
     620    g.fillRect(x+x_,liney,width,lineheight); 
     621    g.setColor(Color.decode(fgcolor)); 
     622    if(ofi!=null && iti!=null && !flat) { 
     623      g.drawImage(iti,x+x_+ofi.getWidth()+2,liney+iti_offset,null); 
     624      liney+=lineheight; 
     625      g.drawString("Selected item",x+x_+ofi.getWidth()+iti.getWidth()+4,liney-text_offset); 
     626    } 
     627    else if(iti!=null) { 
     628      g.drawImage(iti,x+x_,liney+iti_offset,null); 
     629      liney+=lineheight; 
     630      g.drawString("Selected item",x+x_+iti.getWidth()+2,liney-text_offset); 
     631    } 
     632    else { 
     633      liney+=lineheight; 
     634      g.drawString("Selected item",x+x_,liney-text_offset); 
     635    } 
     636     
    560637    slider.draw(g); 
    561638  } 
  • trunk/src/vlcskineditor/Items/Text.java

    r22 r25  
    349349    else { 
    350350      g2d.drawString(text,0,0+g2d.getFontMetrics().getAscent());   
    351     } 
    352      
    353      
    354      
    355      
    356     g.drawImage(bi,x+x_,y+y_,null);       
    357      
     351    }    
     352    g.drawImage(bi,x+x_,y+y_,null);          
    358353  } 
    359354  public DefaultMutableTreeNode getTreeNode() { 
  • trunk/src/vlcskineditor/Resources/Bitmap.java

    r22 r25  
    110110    try { 
    111111      image = ImageIO.read(new File(s.skinfolder+file));  
    112       image = image.getSubimage(0,0,image.getWidth(),image.getHeight()/nbframes);             
     112      image = image.getSubimage(0,0,image.getWidth(),image.getHeight()/nbframes);  
     113      BufferedImage bi = new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_ARGB); 
     114      Graphics g2d = bi.createGraphics();       
     115      int alphargb = Color.decode(alphacolor).getRGB(); 
     116      for(int x=0;x<image.getWidth();x++) { 
     117        for(int y=0;y<image.getHeight();y++) { 
     118          if(image.getRGB(x,y)!=alphargb) { 
     119            g2d.setColor(new Color(image.getRGB(x,y))); 
     120            g2d.drawRect(x,y,0,0); 
     121          } 
     122        }         
     123      } 
     124      image = bi; 
    113125      for(int i=0;i<SubBitmaps.size();i++) { 
    114126        SubBitmaps.get(i).update(image); 
  • trunk/src/vlcskineditor/Resources/Font.java

    r22 r25  
    6767      } 
    6868      else { 
    69         JOptionPane.showMessageDialog(frame,"You have chosen an OpenType font, VLC will display it correctly but the Skin Editor can not display it. In the Skin Editor you will see instead of the chosen font the default font FreeSans","Notice",JOptionPane.INFORMATION_MESSAGE); 
     69        JOptionPane.showMessageDialog(frame,"You have chosen an OpenType font, VLC will display it correctly but the Skin Editor can not display it.\nIn the Skin Editor you will see instead of the chosen font the default font FreeSans","Notice",JOptionPane.INFORMATION_MESSAGE); 
    7070        try {       
    7171          f = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT,new File(Main.class.getResource("FreeSans.ttf").toString())); 
     
    9191    catch(Exception e) { 
    9292      e.printStackTrace(); 
    93       JOptionPane.showMessageDialog(frame,"Error while loading font file!\n Please choose another file","Font file not valid",JOptionPane.INFORMATION_MESSAGE); 
    94       showOptions(); 
     93      if(file.indexOf(".otf")==-1) { 
     94        JOptionPane.showMessageDialog(frame,"Error while loading font file!\n Please choose another file\n","Font file not valid",JOptionPane.ERROR_MESSAGE); 
     95        showOptions(); 
     96      } 
     97      else { 
     98        JOptionPane.showMessageDialog(frame,"You have chosen an OpenType font, VLC will display it correctly but the Skin Editor can not display it.\nIn the Skin Editor you will see instead of the chosen font the default font FreeSans","Notice",JOptionPane.INFORMATION_MESSAGE); 
     99        try {       
     100          f = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT,new File(Main.class.getResource("FreeSans.ttf").toString())); 
     101          f = f.deriveFont(12); 
     102        } 
     103        catch(Exception ex) { 
     104          ex.printStackTrace(); 
     105          f=null; 
     106        } 
     107      }   
    95108    } 
    96109  } 
     
    106119    catch(Exception e) { 
    107120      e.printStackTrace(); 
    108       JOptionPane.showMessageDialog(frame,"Error while loading font file!\n Please choose another file","Font file not valid",JOptionPane.INFORMATION_MESSAGE); 
    109       showOptions(); 
     121      if(file.indexOf(".otf")==-1) { 
     122        JOptionPane.showMessageDialog(frame,"Error while loading font file!\n Please choose another file\n","Font file not valid",JOptionPane.ERROR_MESSAGE); 
     123        showOptions(); 
     124      } 
     125      else { 
     126        JOptionPane.showMessageDialog(frame,"You have chosen an OpenType font, VLC will display it correctly but the Skin Editor can not display it.\nIn the Skin Editor you will see instead of the chosen font the default font FreeSans","Notice",JOptionPane.INFORMATION_MESSAGE); 
     127        try {       
     128          f = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT,new File(Main.class.getResource("FreeSans.ttf").toString())); 
     129          f = f.deriveFont(12); 
     130        } 
     131        catch(Exception ex) { 
     132          ex.printStackTrace(); 
     133          f=null; 
     134        } 
     135      }   
    110136    } 
    111137  } 
     
    133159    catch(Exception e) { 
    134160      e.printStackTrace(); 
    135       JOptionPane.showMessageDialog(frame,"Error while loading font file!\n Please choose another file","Font file not valid",JOptionPane.INFORMATION_MESSAGE); 
    136       showOptions(); 
     161      if(file.indexOf(".otf")==-1) { 
     162        JOptionPane.showMessageDialog(frame,"Error while loading font file!\n Please choose another file\n","Font file not valid",JOptionPane.ERROR_MESSAGE); 
     163        showOptions(); 
     164      } 
     165      else { 
     166        JOptionPane.showMessageDialog(frame,"You have chosen an OpenType font, VLC will display it correctly but the Skin Editor can not display it.\nIn the Skin Editor you will see instead of the chosen font the default font FreeSans","Notice",JOptionPane.INFORMATION_MESSAGE); 
     167        try {       
     168          f = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT,new File(Main.class.getResource("FreeSans.ttf").toString())); 
     169          f = f.deriveFont(12); 
     170        } 
     171        catch(Exception ex) { 
     172          ex.printStackTrace(); 
     173          f=null; 
     174        } 
     175      }   
    137176    } 
    138177     
  • trunk/src/vlcskineditor/Resources/SubBitmap.java

    r17 r25  
    6363    s=s_; 
    6464    parent=parent_; 
     65    type="Bitmap"; 
    6566    id = "Unnamed subbitmap #"+s.getNewId(); 
    6667    x = 0; 
     
    7273  } 
    7374  public void update() { 
    74     image = parent.getSubimage(x,y,width,height); 
     75    image = parent.getSubimage(x,y,width,height);     
    7576    s.updateResources();     
    7677  } 
  • trunk/src/vlcskineditor/Skin.java

    r22 r25  
    2626import java.awt.*; 
    2727import java.awt.event.*; 
     28import java.awt.image.*; 
    2829import java.io.*; 
    2930import javax.swing.*; 
     
    380381  } 
    381382  /** Returns the image object of a bitmap **/ 
    382   public Image getBitmapImage(String id) { 
     383  public BufferedImage getBitmapImage(String id) { 
    383384    Resource r = getResource(id); 
    384385    if(r==null) {