Commit f7003340 authored by Daniel Dreibrodt's avatar Daniel Dreibrodt

V.0.7 FINAL

parent 96b841bc
#XenoageJavaExeStarter_2
C:\Dokumente und Einstellungen\Daniel\Eigene Dateien\java\skin-designer\VLCSkinEditor.jar
C:\Dokumente und Einstellungen\Daniel\Eigene Dateien\java\skin-designer\icon_win32.ico
C:\Dokumente und Einstellungen\Daniel\Eigene Dateien\java\skin-designer\icon_win32.ico
0
-classpath %path%
%args%
1
1.6
1
0
0
VLCSkinEditor.tmp
1
No Java Runtime Environment was detected on your system!\nDownload and install the latest JRE at http://java.sun.com/javase/downloads
Sorry, no suitable Java Runtime Environment was found on your system! You need at least JRE version %jre%.\nDownload and install the latest JRE at http://java.sun.com/javase/downloads
Something is wrong with your JRE configuration!\nDownload and install the latest JRE at http://java.sun.com/javase/downloads
Temporary Jar could not be extracted! Exe file is corrupt!
tar cfvz VLCSkinEditor_release.tar.gz VLCSkinEditor VLCSkinEditor.jar LICENSE.TXT README.TXT icon_png.png
\ No newline at end of file
......@@ -77,9 +77,17 @@ public abstract class Item {
public abstract void update();
/** Creates the XML code representing the item */
public abstract String returnCode(String indent);
/** Draws the item to a graphics context */
/** Draws the item to a graphics context
* @param g graphics context
* @param z zoom factor
*/
public abstract void draw(Graphics2D g, int z);
/** Draws the item to a graphics context with the offset x,y */
/** Draws the item to a graphics context with the offset x,y
* @param g Graphics context
* @param x X offset
* @param y Y offset
* @param z Zoom factor
*/
public abstract void draw(Graphics2D g, int x, int y, int z);
/** Creates a DefaultMutableTreeNode to be displayed in the items tree */
public abstract DefaultMutableTreeNode getTreeNode();
......
......@@ -762,7 +762,7 @@ public class Main extends javax.swing.JFrame implements ActionListener, TreeSele
return;
}
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
}
}
pwin.setText("Parsing XML...");
pwin.setVisible(true);
setTitle(f.toString()+" - VLC Skin Editor "+VERSION);
......
......@@ -396,8 +396,7 @@ public class Button extends Item implements ActionListener{
draw(g,offsetx,offsety,z);
}
public void draw(Graphics2D g, int x_, int y_, int z) {
if(!created) return;
if(s.gvars.parseBoolean(visible)==false) return;
if(!created) return;
java.awt.image.BufferedImage bi;
if(!hovered || ( (over.equals("none") && !clicked)||(clicked && down.equals("none")) ) ) {
bi = s.getBitmapImage(up);
......@@ -408,7 +407,7 @@ public class Button extends Item implements ActionListener{
else {
bi = s.getBitmapImage(down);
}
g.drawImage(bi,(x+x_)*z,(y+y_)*z,bi.getWidth()*z,bi.getHeight()*z,null);
if(s.gvars.parseBoolean(visible)==true) g.drawImage(bi,(x+x_)*z,(y+y_)*z,bi.getWidth()*z,bi.getHeight()*z,null);
if(selected) {
g.setColor(Color.RED);
g.drawRect((x+x_)*z,(y+y_)*z,bi.getWidth()*z-1,bi.getHeight()*z-1);
......
......@@ -536,8 +536,7 @@ public class Checkbox extends Item implements ActionListener{
draw(g,offsetx,offsety,z);
}
public void draw(Graphics2D g, int x_, int y_, int z) {
if(!created) return;
if(s.gvars.parseBoolean(visible)==false) return;
if(!created) return;
java.awt.image.BufferedImage bi = null;
if(s.gvars.parseBoolean(state)) {
if(!hovered || ( (over2.equals("none") && !clicked)||(clicked && down2.equals("none")) )) bi = s.getBitmapImage(up2);
......@@ -549,7 +548,7 @@ public class Checkbox extends Item implements ActionListener{
else if(!clicked || down1.equals("none")) bi = s.getBitmapImage(over2);
else bi = s.getBitmapImage(down2);
}
g.drawImage(bi,(x+x_)*z,(y+y_)*z,bi.getWidth()*z,bi.getHeight()*z,null);
if(s.gvars.parseBoolean(visible)==true )g.drawImage(bi,(x+x_)*z,(y+y_)*z,bi.getWidth()*z,bi.getHeight()*z,null);
if(selected) {
g.setColor(Color.RED);
g.drawRect((x+x_)*z,(y+y_)*z,bi.getWidth()*z-1,bi.getHeight()*z-1);
......
......@@ -379,10 +379,9 @@ public class Image extends Item implements ActionListener{
draw(g,offsetx,offsety, z);
}
public void draw(Graphics2D g,int x_, int y_, int z) {
if(!created) return;
if(s.gvars.parseBoolean(visible)==false) return;
if(!created) return;
java.awt.image.BufferedImage bi = s.getBitmapImage(image);
g.drawImage(bi,(x+x_)*z,(y+y_)*z,bi.getWidth()*z,bi.getHeight()*z,null);
if(s.gvars.parseBoolean(visible)==true) g.drawImage(bi,(x+x_)*z,(y+y_)*z,bi.getWidth()*z,bi.getHeight()*z,null);
if(selected) {
g.setColor(Color.RED);
g.drawRect((x+x_)*z,(y+y_)*z,bi.getWidth()*z-1,bi.getHeight()*z-1);
......
......@@ -642,102 +642,102 @@ public class Playtree extends Item implements ActionListener{
Graphics2D g = (Graphics2D)(buffi.getGraphics());
g.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
if(!created) return;
if(s.gvars.parseBoolean(visible)==false) return;
Font f = s.getFont(font);
g.setFont(f);
FontMetrics fm = g.getFontMetrics();
if(!bgimage.equals("none")) {
g.drawImage(s.getBitmapImage(bgimage).getSubimage(0, 0, width, height),0,0,null);
}
else {
g.setColor(Color.decode(bgcolor1));
g.fillRect(0,0,width,height);
for(int i=fm.getHeight();i<height;i=i+fm.getHeight()*2) {
g.setColor(Color.decode(bgcolor2));
g.fillRect(x,0+i,width,fm.getHeight());
if(s.gvars.parseBoolean(visible)==true) {
Font f = s.getFont(font);
g.setFont(f);
FontMetrics fm = g.getFontMetrics();
if(!bgimage.equals("none")) {
g.drawImage(s.getBitmapImage(bgimage).getSubimage(0, 0, width, height),0,0,null);
}
else {
g.setColor(Color.decode(bgcolor1));
g.fillRect(0,0,width,height);
for(int i=fm.getHeight();i<height;i=i+fm.getHeight()*2) {
g.setColor(Color.decode(bgcolor2));
g.fillRect(x,0+i,width,fm.getHeight());
}
}
int liney = 0;
BufferedImage cfi = s.getBitmapImage(closedimage);
BufferedImage ofi = s.getBitmapImage(openimage);
BufferedImage iti = s.getBitmapImage(itemimage);
int lineheight = fm.getHeight();
int cfi_offset=0,ofi_offset=0,iti_offset=0;
if(cfi!=null) {
if(cfi.getHeight()>lineheight) lineheight=cfi.getHeight();
cfi_offset = (lineheight-cfi.getHeight())/2;
}
if(ofi!=null) {
if(ofi.getHeight()>lineheight) lineheight=ofi.getHeight();
ofi_offset = (lineheight-ofi.getHeight())/2;
}
if(iti!=null) {
if(iti.getHeight()>lineheight) lineheight=iti.getHeight();
iti_offset = (lineheight-iti.getHeight())/2;
}
int text_offset = (lineheight-fm.getAscent())/2;
g.setColor(Color.decode(fgcolor));
if(cfi!=null && !flat) {
g.drawImage(cfi,0,liney+cfi_offset,null);
liney+=lineheight;
g.drawString("Closed folder",0+cfi.getWidth()+2,liney-text_offset);
}
if(ofi!=null && !flat) {
g.drawImage(ofi,0,liney+ofi_offset,null);
liney+=lineheight;
g.drawString("Open folder",0+ofi.getWidth()+2,liney-text_offset);
}
if(ofi!=null && iti!=null && !flat) {
g.drawImage(iti,0+ofi.getWidth()+2,liney+iti_offset,null);
liney+=lineheight;
g.drawString("Normal item",0+ofi.getWidth()+iti.getWidth()+4,liney-text_offset);
}
else if(iti!=null) {
g.drawImage(iti,0,liney+iti_offset,null);
liney+=fm.getHeight();
g.drawString("Normal item",0+iti.getWidth()+4,liney-text_offset);
}
else {
liney+=fm.getHeight();
g.drawString("Normal item",0,liney-text_offset);
}
g.setColor(Color.decode(playcolor));
if(ofi!=null && iti!=null && !flat) {
g.drawImage(iti,0+ofi.getWidth()+2,liney+iti_offset,null);
liney+=lineheight;
g.drawString("Playing item",0+ofi.getWidth()+iti.getWidth()+4,liney-text_offset);
}
else if(iti!=null) {
g.drawImage(iti,0,liney+iti_offset,null);
liney+=lineheight;
g.drawString("Playing item",0+iti.getWidth()+2,liney-text_offset);
}
else {
liney+=lineheight;
g.drawString("Playing item",0,liney-text_offset);
}
g.setColor(Color.decode(selcolor));
g.fillRect(0,liney,width,lineheight);
g.setColor(Color.decode(fgcolor));
if(ofi!=null && iti!=null && !flat) {
g.drawImage(iti,0+ofi.getWidth()+2,liney+iti_offset,null);
liney+=lineheight;
g.drawString("Selected item",0+ofi.getWidth()+iti.getWidth()+4,liney-text_offset);
}
else if(iti!=null) {
g.drawImage(iti,0,liney+iti_offset,null);
liney+=lineheight;
g.drawString("Selected item",0+iti.getWidth()+2,liney-text_offset);
}
else {
liney+=lineheight;
g.drawString("Selected item",0,liney-text_offset);
}
g_.drawImage(buffi, (x+x_)*z, (y+y_)*z, width*z, height*z, null);
slider.draw(g_,1);
}
int liney = 0;
BufferedImage cfi = s.getBitmapImage(closedimage);
BufferedImage ofi = s.getBitmapImage(openimage);
BufferedImage iti = s.getBitmapImage(itemimage);
int lineheight = fm.getHeight();
int cfi_offset=0,ofi_offset=0,iti_offset=0;
if(cfi!=null) {
if(cfi.getHeight()>lineheight) lineheight=cfi.getHeight();
cfi_offset = (lineheight-cfi.getHeight())/2;
}
if(ofi!=null) {
if(ofi.getHeight()>lineheight) lineheight=ofi.getHeight();
ofi_offset = (lineheight-ofi.getHeight())/2;
}
if(iti!=null) {
if(iti.getHeight()>lineheight) lineheight=iti.getHeight();
iti_offset = (lineheight-iti.getHeight())/2;
}
int text_offset = (lineheight-fm.getAscent())/2;
g.setColor(Color.decode(fgcolor));
if(cfi!=null && !flat) {
g.drawImage(cfi,0,liney+cfi_offset,null);
liney+=lineheight;
g.drawString("Closed folder",0+cfi.getWidth()+2,liney-text_offset);
}
if(ofi!=null && !flat) {
g.drawImage(ofi,0,liney+ofi_offset,null);
liney+=lineheight;
g.drawString("Open folder",0+ofi.getWidth()+2,liney-text_offset);
}
if(ofi!=null && iti!=null && !flat) {
g.drawImage(iti,0+ofi.getWidth()+2,liney+iti_offset,null);
liney+=lineheight;
g.drawString("Normal item",0+ofi.getWidth()+iti.getWidth()+4,liney-text_offset);
}
else if(iti!=null) {
g.drawImage(iti,0,liney+iti_offset,null);
liney+=fm.getHeight();
g.drawString("Normal item",0+iti.getWidth()+4,liney-text_offset);
}
else {
liney+=fm.getHeight();
g.drawString("Normal item",0,liney-text_offset);
}
g.setColor(Color.decode(playcolor));
if(ofi!=null && iti!=null && !flat) {
g.drawImage(iti,0+ofi.getWidth()+2,liney+iti_offset,null);
liney+=lineheight;
g.drawString("Playing item",0+ofi.getWidth()+iti.getWidth()+4,liney-text_offset);
}
else if(iti!=null) {
g.drawImage(iti,0,liney+iti_offset,null);
liney+=lineheight;
g.drawString("Playing item",0+iti.getWidth()+2,liney-text_offset);
}
else {
liney+=lineheight;
g.drawString("Playing item",0,liney-text_offset);
}
g.setColor(Color.decode(selcolor));
g.fillRect(0,liney,width,lineheight);
g.setColor(Color.decode(fgcolor));
if(ofi!=null && iti!=null && !flat) {
g.drawImage(iti,0+ofi.getWidth()+2,liney+iti_offset,null);
liney+=lineheight;
g.drawString("Selected item",0+ofi.getWidth()+iti.getWidth()+4,liney-text_offset);
}
else if(iti!=null) {
g.drawImage(iti,0,liney+iti_offset,null);
liney+=lineheight;
g.drawString("Selected item",0+iti.getWidth()+2,liney-text_offset);
}
else {
liney+=lineheight;
g.drawString("Selected item",0,liney-text_offset);
}
g_.drawImage(buffi, (x+x_)*z, (y+y_)*z, width*z, height*z, null);
slider.draw(g_,1);
if(selected) {
g_.setColor(Color.RED);
g_.drawRect((x+x_)*z,(y+y_)*z,width*z-1,height*z-1);
......
......@@ -552,15 +552,14 @@ public class Slider extends Item implements ActionListener{
if(!created) return;
offsetx=x_;
offsety=y_;
if(s.gvars.parseBoolean(visible)==false) return;
if(sbg!=null) {
boolean vis = s.gvars.parseBoolean(visible);
if(sbg!=null && vis) {
sbg.draw(g,x+x_,y+y_,z);
sbg.setOffset(x+offsetx,y+offsety);
}
java.awt.image.BufferedImage si = s.getBitmapImage(up);
if(si==null) return;
java.awt.image.BufferedImage si = s.getBitmapImage(up);
Point2D.Float p = b.getPoint(s.gvars.getSliderValue());
g.drawImage(si,(int)(p.getX()+x+x_-si.getWidth()/2)*z,(int)(p.getY()+y+y_-si.getHeight()/2)*z,si.getWidth()*z,si.getHeight()*z,null);
if(vis && si!=null) g.drawImage(si,(int)(p.getX()+x+x_-si.getWidth()/2)*z,(int)(p.getY()+y+y_-si.getHeight()/2)*z,si.getWidth()*z,si.getHeight()*z,null);
if(selected) {
g.setColor(Color.RED);
for(float f=0f;f<=1f;f=f+0.1f) {
......
......@@ -409,7 +409,7 @@ public class Text extends Item implements ActionListener{
}
public void draw(Graphics2D g, int x_, int y_, int z) {
if(!created || font==null) return;
if(s.gvars.parseBoolean(visible)==false) return;
Font f = s.getFont(font);
if(f==null) {
Resource fr = s.getResource(font);
......@@ -421,28 +421,28 @@ public class Text extends Item implements ActionListener{
f = new Font(Font.SANS_SERIF,Font.PLAIN,12);
}
}
g.setFont(f);
g.setColor(Color.decode(color));
BufferedImage bi;
String ptext = s.gvars.parseString(text);
if(width==0) {
bi = new BufferedImage((int)g.getFontMetrics().getStringBounds(ptext,g).getWidth(),g.getFontMetrics().getHeight(),BufferedImage.TYPE_INT_ARGB);
}
else bi = new BufferedImage(width,g.getFontMetrics().getHeight(),BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = bi.createGraphics();
g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
g2d.setFont(f);
g2d.setColor(Color.decode(color));
if(width!=0 && alignment.equals("right")) {
g2d.drawString(ptext,(int)(width-g2d.getFontMetrics().getStringBounds(ptext,g).getWidth()),0+g2d.getFontMetrics().getAscent());
}
else if(width!=0 && alignment.equals("center")) {
g2d.drawString(ptext,(int)((width-g2d.getFontMetrics().getStringBounds(ptext,g).getWidth())/2),0+g2d.getFontMetrics().getAscent());
if(s.gvars.parseBoolean(visible)==true) {
BufferedImage bi;
String ptext = s.gvars.parseString(text);
if(width==0) {
bi = new BufferedImage((int)g.getFontMetrics().getStringBounds(ptext,g).getWidth(),g.getFontMetrics().getHeight(),BufferedImage.TYPE_INT_ARGB);
}
else bi = new BufferedImage(width,g.getFontMetrics().getHeight(),BufferedImage.TYPE_INT_ARGB);
Graphics2D g2d = bi.createGraphics();
g2d.setRenderingHint( RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON );
g2d.setFont(f);
g2d.setColor(Color.decode(color));
if(width!=0 && alignment.equals("right")) {
g2d.drawString(ptext,(int)(width-g2d.getFontMetrics().getStringBounds(ptext,g).getWidth()),0+g2d.getFontMetrics().getAscent());
}
else if(width!=0 && alignment.equals("center")) {
g2d.drawString(ptext,(int)((width-g2d.getFontMetrics().getStringBounds(ptext,g).getWidth())/2),0+g2d.getFontMetrics().getAscent());
}
else {
g2d.drawString(ptext,0,0+g2d.getFontMetrics().getAscent());
}
g.drawImage(bi,(x+x_)*z,(y+y_)*z,bi.getWidth()*z, bi.getHeight()*z,null);
}
else {
g2d.drawString(ptext,0,0+g2d.getFontMetrics().getAscent());
}
g.drawImage(bi,(x+x_)*z,(y+y_)*z,bi.getWidth()*z, bi.getHeight()*z,null);
if(selected) {
g.setColor(Color.RED);
g.drawRect((x+x_)*z,(y+y_)*z,width*z,f.getSize()*z);
......
......@@ -350,9 +350,9 @@ public class Video extends Item implements ActionListener{
}
public void draw(Graphics2D g, int x_, int y_, int z) {
if(!created) return;
if(s.gvars.parseBoolean(visible)==false) return;
g.setColor(Color.BLACK);
g.fillRect((x+x_)*z,(y+y_)*z,width*z,height*z);
if(s.gvars.parseBoolean(visible)==true) g.fillRect((x+x_)*z,(y+y_)*z,width*z,height*z);
if(selected) {
g.setColor(Color.RED);
g.drawRect((x+x_)*z,(y+y_)*z,width*z-1,height*z-1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment