Changeset 37

Show
Ignore:
Timestamp:
11/09/07 19:35:18 (1 year ago)
Author:
altglass
Message:

alphacolor/transparency interpretation improvement
XML parsing/generating fixes
font display rework => build scripts modified

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build.bat

    r26 r37  
    33javac -d ../build vlcskineditor/Main.java 
    44cd .. 
    5 copy src\vlcskineditor\FreeSans.ttf build\vlcskineditor\FreeSans.ttf 
    65md build\vlcskineditor\icons 
    76copy src\vlcskineditor\icons build\vlcskineditor\icons\ 
  • trunk/build.sh

    r31 r37  
    55`javac -d ../build vlcskineditor/Main.java` 
    66cd .. 
    7 cp src/vlcskineditor/FreeSans.ttf build/vlcskineditor/ 
    87cp src/vlcskineditor/icons/* build/vlcskineditor/icons 
    98echo "Main-Class: vlcskineditor.Main" > manifest_no_nb 
  • trunk/src/vlcskineditor/Items/Anchor.java

    r32 r37  
    208208    if (lefttop!=LEFTTOP_DEFAULT) code+=" lefttop=\""+lefttop+"\"";     
    209209    code+="/>"; 
    210     if (id!=ID_DEFAULT) code+="<!-- id=\""+id+"\" -->"; 
     210    //if (id!=ID_DEFAULT) code+="<!-- id=\""+id+"\" -->"; 
    211211    return code; 
    212212  } 
  • trunk/src/vlcskineditor/Items/Button.java

    r36 r37  
    300300    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    301301    if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
     302    if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
    302303    if (tooltiptext!=TOOLTIPTEXT_DEFAULT) code+=" tooltiptext=\""+tooltiptext+"\""; 
    303304    code+="/>"; 
  • trunk/src/vlcskineditor/Items/Checkbox.java

    r35 r37  
    405405    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    406406    if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
     407    if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
    407408    code+="/>"; 
    408409    return code; 
  • trunk/src/vlcskineditor/Items/Image.java

    r35 r37  
    278278    if (id!=ID_DEFAULT) code+=" id=\""+id+"\"";     
    279279    code+=" image=\""+image+"\""; 
    280     if (action!=ACTION_DEFAULT) code+=" id=\""+id+"\""; 
    281     if (action2!=ACTION2_DEFAULT) code+=" id=\""+id+"\""; 
     280    if (action!=ACTION_DEFAULT) code+=" action=\""+action+"\""; 
     281    if (action2!=ACTION2_DEFAULT) code+=" action2=\""+action2+"\""; 
    282282    if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\""; 
    283283    if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\""; 
     
    287287    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    288288    if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
     289    if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
    289290    code+="/>"; 
    290291    return code; 
  • trunk/src/vlcskineditor/Items/Playtree.java

    r34 r37  
    539539    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    540540    if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
     541    if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
    541542    code+=">\n";     
    542543    code+=slider.returnCode(); 
  • trunk/src/vlcskineditor/Items/RadialSlider.java

    r19 r37  
    8888    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    8989    if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
     90    if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
    9091    code+="/>"; 
    9192    return code; 
  • trunk/src/vlcskineditor/Items/Slider.java

    r34 r37  
    426426    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    427427    if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
     428    if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
    428429    if (sbg==null) { 
    429430      code+="/>"; 
  • trunk/src/vlcskineditor/Items/Text.java

    r36 r37  
    322322    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    323323    if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
     324    if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
    324325    code+="/>"; 
    325326    return code; 
     
    331332    if(s.gvars.parseBoolean(visible)==false) return; 
    332333    Font f = s.getFont(font); 
     334    if(f==null) { 
     335      Resource fr = s.getResource(font); 
     336      if(fr.type.equals("Font")) { 
     337        vlcskineditor.Resources.Font fnt = (vlcskineditor.Resources.Font)fr; 
     338        f = new Font(Font.SANS_SERIF,Font.PLAIN,fnt.size); 
     339      } 
     340      else { 
     341        f = new Font(Font.SANS_SERIF,Font.PLAIN,12); 
     342      }       
     343    } 
    333344    g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); 
    334345    g.setFont(f); 
  • trunk/src/vlcskineditor/Items/Video.java

    r34 r37  
    266266    if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 
    267267    if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 
     268    if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 
    268269    code+="/>"; 
    269270    return code; 
  • trunk/src/vlcskineditor/Main.java

    r35 r37  
    828828          s.resources.add(new vlcskineditor.Resources.Bitmap(s,files[i])); 
    829829        } 
     830        s.updateResources(); 
    830831      }       
    831832    } 
  • trunk/src/vlcskineditor/Resources/Bitmap.java

    r36 r37  
    111111    try { 
    112112      image = ImageIO.read(new File(s.skinfolder+file));        
    113       image = image.getSubimage(0,0,image.getWidth(),image.getHeight()/nbframes);  
    114       System.err.println("Bitmap "+id+" is of type: "+image.getType()); 
     113      image = image.getSubimage(0,0,image.getWidth(),image.getHeight()/nbframes);    
     114      System.err.println("Loaded "+file+" as "+id+" with the image type "+image.getType()); 
    115115      if(image.getType()!=13) { //If PNG is not indexed 
    116116        BufferedImage bi = new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_ARGB); 
     
    119119        for(int x=0;x<image.getWidth();x++) { 
    120120          for(int y=0;y<image.getHeight();y++) { 
    121             if(image.getRGB(x,y)!=alphargb) { 
     121            int argb = image.getRGB(x,y); 
     122            int red = (argb >> 16) & 0xff; 
     123            int green = (argb >> 8) & 0xff; 
     124            int blue = argb & 0xff; 
     125            int alpha = (argb >> 24) & 0xff;             
     126            if(image.getRGB(x,y)!=alphargb && alpha>=255) { 
    122127              g2d.setColor(new Color(image.getRGB(x,y))); 
    123128              g2d.drawRect(x,y,0,0); 
    124             } 
     129            }              
    125130          }         
    126131        } 
  • trunk/src/vlcskineditor/Resources/Font.java

    r32 r37  
    6464      if(file.indexOf(".otf")==-1) { 
    6565        JOptionPane.showMessageDialog(frame,"Error while loading font file!\n Please choose another file\n","Font file not valid",JOptionPane.ERROR_MESSAGE); 
     66        f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size); 
    6667        showOptions(); 
    6768      } 
    6869      else { 
    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); 
     70        JOptionPane.showMessageDialog(frame,"You have chosen an OpenType font, VLC will display it correctly but the Skin Editor can not display it.\nYou will see another font instead.","Notice",JOptionPane.INFORMATION_MESSAGE); 
    7071        try {       
    71           f = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT,new File(Main.class.getResource("FreeSans.ttf").toURI())); 
     72          f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size); 
    7273          f = f.deriveFont(12); 
    7374        } 
    7475        catch(Exception ex) { 
    7576          ex.printStackTrace(); 
    76           f=null
     77          f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size)
    7778        } 
    7879      }       
     
    9394      if(file.indexOf(".otf")==-1) { 
    9495        JOptionPane.showMessageDialog(frame,"Error while loading font file!\n Please choose another file\n","Font file not valid",JOptionPane.ERROR_MESSAGE); 
     96        f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size); 
    9597        showOptions(); 
    9698      } 
     
    103105        catch(Exception ex) { 
    104106          ex.printStackTrace(); 
    105           f=null
     107          f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size)
    106108        } 
    107109      }   
     
    121123      if(file.indexOf(".otf")==-1) { 
    122124        JOptionPane.showMessageDialog(frame,"Error while loading font file!\n Please choose another file\n","Font file not valid",JOptionPane.ERROR_MESSAGE); 
     125        f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size); 
    123126        showOptions(); 
    124127      } 
     
    131134        catch(Exception ex) { 
    132135          ex.printStackTrace(); 
    133           f=null
     136          f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size)
    134137        } 
    135138      }   
     
    162165      if(file.indexOf(".otf")==-1) { 
    163166        JOptionPane.showMessageDialog(frame,"Error while loading font file!\n Please choose another file\n","Font file not valid",JOptionPane.ERROR_MESSAGE); 
     167        f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size); 
    164168        showOptions(); 
    165169      } 
     
    172176        catch(Exception ex) { 
    173177          ex.printStackTrace(); 
    174           f=null
     178          f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size)
    175179        } 
    176180      }   
  • trunk/src/vlcskineditor/Skin.java

    r34 r37  
    411411  public java.awt.Font getFont(String id) { 
    412412    if(id.equals("defaultfont")) { 
    413       java.awt.Font f = null; 
    414       try {       
    415         f = java.awt.Font.createFont(java.awt.Font.TRUETYPE_FONT,new File(Main.class.getResource("FreeSans.ttf").toURI())); 
    416         f = f.deriveFont(12); 
    417       } 
    418       catch(Exception e) { 
    419         e.printStackTrace(); 
    420         f=null; 
    421       } 
    422       return f; 
     413      return (new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,12)); 
    423414    } 
    424415    Resource r = getResource(id); 
    425     if(r==null) return null
     416    if(r==null) return (new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,12))
    426417    try { 
    427418      if(r.type.equals("Font")) { 
     
    432423    catch(Exception e) { 
    433424      e.printStackTrace(); 
    434       return null
    435     } 
    436     return null
     425      return (new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,12))
     426    } 
     427    return (new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,12))
    437428  } 
    438429  /** Returns the window represented by the given id **/