Changeset 37
- Timestamp:
- 11/09/07 19:35:18 (1 year ago)
- Files:
-
- trunk/build.bat (modified) (1 diff)
- trunk/build.sh (modified) (1 diff)
- trunk/src/vlcskineditor/FreeSans.ttf (deleted)
- trunk/src/vlcskineditor/Items/Anchor.java (modified) (1 diff)
- trunk/src/vlcskineditor/Items/Button.java (modified) (1 diff)
- trunk/src/vlcskineditor/Items/Checkbox.java (modified) (1 diff)
- trunk/src/vlcskineditor/Items/Image.java (modified) (2 diffs)
- trunk/src/vlcskineditor/Items/Playlist.java (deleted)
- trunk/src/vlcskineditor/Items/Playtree.java (modified) (1 diff)
- trunk/src/vlcskineditor/Items/RadialSlider.java (modified) (1 diff)
- trunk/src/vlcskineditor/Items/Slider.java (modified) (1 diff)
- trunk/src/vlcskineditor/Items/Text.java (modified) (2 diffs)
- trunk/src/vlcskineditor/Items/Video.java (modified) (1 diff)
- trunk/src/vlcskineditor/Main.java (modified) (1 diff)
- trunk/src/vlcskineditor/Resources/Bitmap.java (modified) (2 diffs)
- trunk/src/vlcskineditor/Resources/Font.java (modified) (7 diffs)
- trunk/src/vlcskineditor/Skin.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/build.bat
r26 r37 3 3 javac -d ../build vlcskineditor/Main.java 4 4 cd .. 5 copy src\vlcskineditor\FreeSans.ttf build\vlcskineditor\FreeSans.ttf6 5 md build\vlcskineditor\icons 7 6 copy src\vlcskineditor\icons build\vlcskineditor\icons\ trunk/build.sh
r31 r37 5 5 `javac -d ../build vlcskineditor/Main.java` 6 6 cd .. 7 cp src/vlcskineditor/FreeSans.ttf build/vlcskineditor/8 7 cp src/vlcskineditor/icons/* build/vlcskineditor/icons 9 8 echo "Main-Class: vlcskineditor.Main" > manifest_no_nb trunk/src/vlcskineditor/Items/Anchor.java
r32 r37 208 208 if (lefttop!=LEFTTOP_DEFAULT) code+=" lefttop=\""+lefttop+"\""; 209 209 code+="/>"; 210 if (id!=ID_DEFAULT) code+="<!-- id=\""+id+"\" -->";210 //if (id!=ID_DEFAULT) code+="<!-- id=\""+id+"\" -->"; 211 211 return code; 212 212 } trunk/src/vlcskineditor/Items/Button.java
r36 r37 300 300 if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 301 301 if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 302 if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 302 303 if (tooltiptext!=TOOLTIPTEXT_DEFAULT) code+=" tooltiptext=\""+tooltiptext+"\""; 303 304 code+="/>"; trunk/src/vlcskineditor/Items/Checkbox.java
r35 r37 405 405 if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 406 406 if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 407 if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 407 408 code+="/>"; 408 409 return code; trunk/src/vlcskineditor/Items/Image.java
r35 r37 278 278 if (id!=ID_DEFAULT) code+=" id=\""+id+"\""; 279 279 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+"\""; 282 282 if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\""; 283 283 if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\""; … … 287 287 if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 288 288 if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 289 if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 289 290 code+="/>"; 290 291 return code; trunk/src/vlcskineditor/Items/Playtree.java
r34 r37 539 539 if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 540 540 if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 541 if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 541 542 code+=">\n"; 542 543 code+=slider.returnCode(); trunk/src/vlcskineditor/Items/RadialSlider.java
r19 r37 88 88 if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 89 89 if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 90 if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 90 91 code+="/>"; 91 92 return code; trunk/src/vlcskineditor/Items/Slider.java
r34 r37 426 426 if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 427 427 if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 428 if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 428 429 if (sbg==null) { 429 430 code+="/>"; trunk/src/vlcskineditor/Items/Text.java
r36 r37 322 322 if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 323 323 if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 324 if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 324 325 code+="/>"; 325 326 return code; … … 331 332 if(s.gvars.parseBoolean(visible)==false) return; 332 333 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 } 333 344 g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON ); 334 345 g.setFont(f); trunk/src/vlcskineditor/Items/Video.java
r34 r37 266 266 if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\""; 267 267 if (help!=HELP_DEFAULT) code+=" help=\""+help+"\""; 268 if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\""; 268 269 code+="/>"; 269 270 return code; trunk/src/vlcskineditor/Main.java
r35 r37 828 828 s.resources.add(new vlcskineditor.Resources.Bitmap(s,files[i])); 829 829 } 830 s.updateResources(); 830 831 } 831 832 } trunk/src/vlcskineditor/Resources/Bitmap.java
r36 r37 111 111 try { 112 112 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()); 115 115 if(image.getType()!=13) { //If PNG is not indexed 116 116 BufferedImage bi = new BufferedImage(image.getWidth(),image.getHeight(),BufferedImage.TYPE_INT_ARGB); … … 119 119 for(int x=0;x<image.getWidth();x++) { 120 120 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) { 122 127 g2d.setColor(new Color(image.getRGB(x,y))); 123 128 g2d.drawRect(x,y,0,0); 124 } 129 } 125 130 } 126 131 } trunk/src/vlcskineditor/Resources/Font.java
r32 r37 64 64 if(file.indexOf(".otf")==-1) { 65 65 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); 66 67 showOptions(); 67 68 } 68 69 else { 69 JOptionPane.showMessageDialog(frame,"You have chosen an OpenType font, VLC will display it correctly but the Skin Editor can not display it.\n In 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); 70 71 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); 72 73 f = f.deriveFont(12); 73 74 } 74 75 catch(Exception ex) { 75 76 ex.printStackTrace(); 76 f =null;77 f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size); 77 78 } 78 79 } … … 93 94 if(file.indexOf(".otf")==-1) { 94 95 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); 95 97 showOptions(); 96 98 } … … 103 105 catch(Exception ex) { 104 106 ex.printStackTrace(); 105 f =null;107 f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size); 106 108 } 107 109 } … … 121 123 if(file.indexOf(".otf")==-1) { 122 124 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); 123 126 showOptions(); 124 127 } … … 131 134 catch(Exception ex) { 132 135 ex.printStackTrace(); 133 f =null;136 f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size); 134 137 } 135 138 } … … 162 165 if(file.indexOf(".otf")==-1) { 163 166 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); 164 168 showOptions(); 165 169 } … … 172 176 catch(Exception ex) { 173 177 ex.printStackTrace(); 174 f =null;178 f = new java.awt.Font(java.awt.Font.SANS_SERIF,java.awt.Font.PLAIN,size); 175 179 } 176 180 } trunk/src/vlcskineditor/Skin.java
r34 r37 411 411 public java.awt.Font getFont(String id) { 412 412 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)); 423 414 } 424 415 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)); 426 417 try { 427 418 if(r.type.equals("Font")) { … … 432 423 catch(Exception e) { 433 424 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)); 437 428 } 438 429 /** Returns the window represented by the given id **/
