Commit f0ab41ff authored by Daniel Dreibrodt's avatar Daniel Dreibrodt

Output XML code is now indented

parent 2a15b2d1
VLC Skin Editor release 0.6.1b
VLC Skin Editor release 0.7.0b
-----------------------------------------------------------
Changelog:
-----------------------------------------------------------
0.7.0a - Preview can be saved as image
0.7.0b - Preview can be saved as image
- Improved SubBitmap editing
- Resources/windows/layouts can be duplicated easily
- XML output is now indented
- Slider backgrounds can be generated in a wizard
0.6.1b - Critical bufix for the Preview Window
- Bugfix for slider points parsing and XML parsing
0.6.0b - Resources/windows/layouts/items can be edited by
......
......@@ -76,7 +76,7 @@ public abstract class Item {
/** Update the Item's attributes according to the user input */
public abstract void update();
/** Creates the XML code representing the item */
public abstract String returnCode();
public abstract String returnCode(String indent);
/** Draws the item to a graphics context */
public abstract void draw(Graphics2D g);
/** Draws the item to a graphics context with the offset x,y */
......
......@@ -363,11 +363,12 @@ public class Layout implements ActionListener{
}
/**
* Generates the XML code represented by this Layout.
* @param ident Indentation
* @return The XML code.
*/
public String returnCode() {
String code ="<Layout";
if (id!=ID_DEFAULT) code+=" id=\""+id+"\"";
public String returnCode(String indent) {
String code =indent+"<Layout";
if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\"";
code+=" width=\""+String.valueOf(width)+"\" height=\""+String.valueOf(height)+"\"";
if (minwidth!=MINWIDTH_DEFAULT) code+=" minwidth=\""+String.valueOf(minwidth)+"\"";
if (maxwidth!=MAXWIDTH_DEFAULT) code+=" maxwidth=\""+String.valueOf(maxwidth)+"\"";
......@@ -375,9 +376,9 @@ public class Layout implements ActionListener{
if (maxheight!=MAXHEIGHT_DEFAULT) code+=" maxheight=\""+String.valueOf(maxheight)+"\"";
code+=">";
for (int i=0;i<items.size();i++) {
code+="\n"+items.get(i).returnCode();
code+="\n"+items.get(i).returnCode(indent+Skin.indentation);
}
code+="\n</Layout>";
code+="\n"+indent+"</Layout>";
return code;
}
/**
......
......@@ -46,7 +46,7 @@ import vlcskineditor.resources.SubBitmap;
public class Main extends javax.swing.JFrame implements ActionListener, TreeSelectionListener, WindowListener, MouseListener{
//The version identification of the current build.
public final String VERSION = "0.7.0.a";
public final String VERSION = "0.7.0.b";
//The directory in which the VLC executable is found
String vlc_dir = "";
//The directory from which VLC loads its skins
......@@ -1035,7 +1035,7 @@ public class Main extends javax.swing.JFrame implements ActionListener, TreeSele
"%oldid% will be replaced by the old ID of the object.", "%oldid%_copy");
if(r.getClass()==Bitmap.class) {
Bitmap b = (Bitmap)r;
Bitmap b2 = new Bitmap(b.returnCode(),s);
Bitmap b2 = new Bitmap(b.returnCode(""),s);
b2.renameForCopy(p);
s.resources.add(b2);
s.updateResources();
......@@ -1043,7 +1043,7 @@ public class Main extends javax.swing.JFrame implements ActionListener, TreeSele
}
else if(r.getClass()==SubBitmap.class) {
SubBitmap sb = (SubBitmap)r;
SubBitmap sb2 = new SubBitmap(sb.returnCode(),s,sb.getParentBitmap());
SubBitmap sb2 = new SubBitmap(sb.returnCode(""),s,sb.getParentBitmap());
sb2.renameForCopy(p);
sb.getParentBitmap().SubBitmaps.add(sb2);
s.updateResources();
......@@ -1051,7 +1051,7 @@ public class Main extends javax.swing.JFrame implements ActionListener, TreeSele
}
else {
vlcskineditor.resources.Font f = (vlcskineditor.resources.Font)r;
vlcskineditor.resources.Font f2 = new vlcskineditor.resources.Font(f.returnCode(),s);
vlcskineditor.resources.Font f2 = new vlcskineditor.resources.Font(f.returnCode(""),s);
f2.renameForCopy(p);
s.resources.add(f2);
s.updateResources();
......@@ -1067,7 +1067,7 @@ public class Main extends javax.swing.JFrame implements ActionListener, TreeSele
if(selected_layout==null) {
Window w = s.getWindow(selected_window);
if(w==null) return;
Window w_ = new Window(w.returnCode(), s);
Window w_ = new Window(w.returnCode(""), s);
w_.renameForCopy(p);
s.windows.add(w_);
s.updateWindows();
......@@ -1075,7 +1075,7 @@ public class Main extends javax.swing.JFrame implements ActionListener, TreeSele
else {
Window w = s.getWindow(selected_window);
Layout l = w.getLayout(selected_layout);
Layout l_ = new Layout(l.returnCode(), w, s);
Layout l_ = new Layout(l.returnCode(""), w, s);
l_.renameForCopy(p);
w.layouts.add(l_);
s.updateWindows();
......@@ -1091,7 +1091,7 @@ public class Main extends javax.swing.JFrame implements ActionListener, TreeSele
Item i = s.getItem(selected_item);
if(i==null) return;
if(i.getClass()==Anchor.class) {
Anchor a = new Anchor(i.returnCode(), s);
Anchor a = new Anchor(i.returnCode(""), s);
//Because IDs of Anchors are not stored in the XML and can thus not be copied via returnCode()
a.id = i.id;
a.renameForCopy(p);
......@@ -1100,56 +1100,56 @@ public class Main extends javax.swing.JFrame implements ActionListener, TreeSele
s.expandItem(a.id);
}
else if(i.getClass()==vlcskineditor.items.Button.class) {
vlcskineditor.items.Button b = new vlcskineditor.items.Button(i.returnCode(), s);
vlcskineditor.items.Button b = new vlcskineditor.items.Button(i.returnCode(""), s);
b.renameForCopy(p);
s.getParentListOf(i.id).add(b);
s.updateItems();
s.expandItem(b.id);
}
else if(i.getClass()==vlcskineditor.items.Checkbox.class) {
vlcskineditor.items.Checkbox c = new vlcskineditor.items.Checkbox(i.returnCode(), s);
vlcskineditor.items.Checkbox c = new vlcskineditor.items.Checkbox(i.returnCode(""), s);
c.renameForCopy(p);
s.getParentListOf(i.id).add(c);
s.updateItems();
s.expandItem(c.id);
}
else if(i.getClass()==Group.class) {
Group g = new Group(i.returnCode(), s);
Group g = new Group(i.returnCode(""), s);
g.renameForCopy(p);
s.getParentListOf(i.id).add(g);
s.updateItems();
s.expandItem(g.id);
}
else if(i.getClass()==vlcskineditor.items.Image.class) {
vlcskineditor.items.Image im = new vlcskineditor.items.Image(i.returnCode(), s);
vlcskineditor.items.Image im = new vlcskineditor.items.Image(i.returnCode(""), s);
im.renameForCopy(p);
s.getParentListOf(i.id).add(im);
s.updateItems();
s.expandItem(im.id);
}
else if(i.getClass()==vlcskineditor.items.Panel.class) {
vlcskineditor.items.Panel pa = new vlcskineditor.items.Panel(i.returnCode(), s);
vlcskineditor.items.Panel pa = new vlcskineditor.items.Panel(i.returnCode(""), s);
pa.renameForCopy(p);
s.getParentListOf(i.id).add(pa);
s.updateItems();
s.expandItem(pa.id);
}
else if(i.getClass()==Playtree.class) {
Playtree pl = new Playtree(i.returnCode(), s);
Playtree pl = new Playtree(i.returnCode(""), s);
pl.renameForCopy(p);
s.getParentListOf(i.id).add(pl);
s.updateItems();
s.expandItem(pl.id);
}
else if(i.getClass()==RadialSlider.class) {
RadialSlider r = new RadialSlider(i.returnCode(), s);
RadialSlider r = new RadialSlider(i.returnCode(""), s);
r.renameForCopy(p);
s.getParentListOf(i.id).add(r);
s.updateItems();
s.expandItem(r.id);
}
else if(i.getClass()==Slider.class) {
Slider sl = new Slider(i.returnCode(), s);
Slider sl = new Slider(i.returnCode(""), s);
sl.renameForCopy(p);
java.util.List<Item> l = s.getParentListOf(i.id);
if(l!=null) {
......@@ -1167,14 +1167,14 @@ public class Main extends javax.swing.JFrame implements ActionListener, TreeSele
JOptionPane.showMessageDialog(this,"A slider cannot contain more than one background!","SliderBackgrounds cannot be duplicated",JOptionPane.INFORMATION_MESSAGE);
}
else if(i.getClass()==Text.class) {
Text t = new Text(i.returnCode(), s);
Text t = new Text(i.returnCode(""), s);
t.renameForCopy(p);
s.getParentListOf(i.id).add(t);
s.updateItems();
s.expandItem(t.id);
}
else if(i.getClass()==Video.class) {
Video v = new Video(i.returnCode(), s);
Video v = new Video(i.returnCode(""), s);
v.renameForCopy(p);
s.getParentListOf(i.id).add(v);
s.updateItems();
......
......@@ -42,7 +42,7 @@ public abstract class Resource {
/** Update the Resource's attributes according to user input */
public abstract void update();
/** Creates the XML code representing the resource */
public abstract String returnCode();
public abstract String returnCode(String indent);
/** Creates a DefaultMutableTreeNode to be displayed in the resources tree */
public abstract DefaultMutableTreeNode getTreeNode();
/** If a Resource does contain another Resource of the given id (e.g. a SubBitmap) the containing Resource is returned **/
......
......@@ -79,6 +79,9 @@ public class Skin implements ActionListener{
//Central window handle for all editing dialogs of res/win/layout/items
public JFrame edit_frame;
//Default indentation of generated XML code
public static String indentation = " ";
public Skin(Main m_) {
m=m_;
}
......@@ -551,19 +554,19 @@ public class Skin implements ActionListener{
if(theme_alpha!=THEME_ALPHA_DEFAULT) code+=" alpha=\""+String.valueOf(theme_alpha)+"\"";
if(theme_movealpha!=THEME_MOVEALPHA_DEFAULT) code+=" movealpha=\""+String.valueOf(theme_movealpha)+"\"";
code+=">\n";
code+="<ThemeInfo";
code+=Skin.indentation+"<ThemeInfo";
code+=" name=\""+themeinfo_name+"\"";
code+=" author=\""+themeinfo_author+"\"";
code+=" email=\""+themeinfo_email+"\"";
code+=" webpage=\""+themeinfo_webpage+"\"";
code+="/>\n";
code+="<!-- Created using the VLC Skin Editor "+m.VERSION+" (http://www.videolan.org/vlc/skineditor.php)-->\n";
code+="/>\n\n";
code+=Skin.indentation+"<!-- Created using the VLC Skin Editor "+m.VERSION+" (http://www.videolan.org/vlc/skineditor.php)-->\n\n";
for (int i=0;i<resources.size();i++) {
code+=resources.get(i).returnCode();
code+=resources.get(i).returnCode(Skin.indentation);
}
code+="\n";
for (int i=0;i<windows.size();i++) {
code+=windows.get(i).returnCode();
code+=windows.get(i).returnCode(Skin.indentation);
}
code += "\n</Theme>";
return code;
......
......@@ -256,19 +256,19 @@ public class Window implements ActionListener{
public void addLayout() {
layouts.add(new Layout(this,s));
}
public String returnCode() {
String code = "<Window";
if(id!=ID_DEFAULT) code+=" id=\""+id+"\"";
if(visible!=VISIBLE_DEFAULT) code+=" visible=\""+String.valueOf(visible)+"\"";
public String returnCode(String indent) {
String code = indent+"<Window";
if(!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\"";
if(!visible.equals(VISIBLE_DEFAULT)) code+=" visible=\""+String.valueOf(visible)+"\"";
if(x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\"";
if(y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\"";
if(dragdrop!=DRAGDROP_DEFAULT) code+=" dragdrop=\""+String.valueOf(dragdrop)+"\"";
if(playondrop!=PLAYONDROP_DEFAULT) code+=" playondrop=\""+String.valueOf(playondrop)+"\"";
code+=">";
for (int i=0;i<layouts.size();i++) {
code+="\n"+layouts.get(i).returnCode();
code+="\n"+layouts.get(i).returnCode(indent+Skin.indentation);
}
code+="\n</Window>\n";
code+="\n"+indent+"</Window>\n";
return code;
}
public Layout getLayout(String id_) {
......
......@@ -269,8 +269,8 @@ public class Anchor extends Item implements ActionListener{
frame = null;
}
}
public String returnCode() {
String code = "<Anchor";
public String returnCode(String indent) {
String code = indent+"<Anchor";
if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\"";
if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\"";
code+=" priority=\""+String.valueOf(priority)+"\"";
......
......@@ -371,8 +371,8 @@ public class Button extends Item implements ActionListener{
public void actionWasEdited(ActionEditor ae) {
if(ae==action_ae) action_tf.setText(ae.getCode());
}
public String returnCode() {
String code = "<Button";
public String returnCode(String indent) {
String code = indent+"<Button";
code+=" up=\""+up+"\"";
if (!down.equals(DOWN_DEFAULT)) code+=" down=\""+down+"\"";
if (!over.equals(OVER_DEFAULT)) code+=" over=\""+over+"\"";
......
......@@ -507,8 +507,8 @@ public class Checkbox extends Item implements ActionListener{
if(ae==action1_ae) action1_tf.setText(action1_ae.getCode());
else if(ae==action2_ae) action2_tf.setText(action2_ae.getCode());
}
public String returnCode() {
String code = "<Checkbox";
public String returnCode(String indent) {
String code = indent+"<Checkbox";
code+=" state=\""+state+"\" up1=\""+up1+"\" up2=\""+up2+"\"";
if (!down1.equals(ID_DEFAULT)) code+=" down1=\""+down1+"\"";
if (!down2.equals(ID_DEFAULT)) code+=" down2=\""+down2+"\"";
......
......@@ -245,16 +245,16 @@ public class Group extends Item implements ActionListener{
frame = null;
}
}
public String returnCode() {
String code = "<Group";
public String returnCode(String indent) {
String code = indent+"<Group";
if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\"";
if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\"";
code+=">";
//if (id!=ID_DEFAULT) code+="<!-- id=\""+id+"\" -->";
for (int i=0;i<items.size();i++) {
code+="\n"+items.get(i).returnCode();
code+="\n"+items.get(i).returnCode(indent+Skin.indentation);
}
code+="\n</Group>";
code+="\n"+indent+"</Group>";
return code;
}
public void draw(Graphics2D g) {
......
......@@ -354,8 +354,8 @@ public class Image extends Item implements ActionListener{
public void actionWasEdited(ActionEditor ae) {
if(ae==action2_ae) action2_tf.setText(action2_ae.getCode());
}
public String returnCode() {
String code = "<Image";
public String returnCode(String indent) {
String code = indent+"<Image";
if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\"";
if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\"";
if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\"";
......
......@@ -352,8 +352,8 @@ public class Panel extends Item implements ActionListener{
frame = null;
}
}
public String returnCode() {
String code = "<Panel";
public String returnCode(String indent) {
String code = indent+"<Panel";
if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\"";
if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\"";
code+=" width=\""+String.valueOf(width)+"\" height=\""+String.valueOf(height)+"\"";
......@@ -364,9 +364,9 @@ public class Panel extends Item implements ActionListener{
code+=">";
if (!id.equals(ID_DEFAULT)) code+="<!-- id=\""+id+"\" -->";
for (int i=0;i<items.size();i++) {
code+="\n"+items.get(i).returnCode();
code+="\n"+items.get(i).returnCode(indent+Skin.indentation);
}
code+="\n</Panel>";
code+="\n"+indent+"</Panel>";
return code;
}
public void draw(Graphics2D g) {
......
......@@ -601,8 +601,8 @@ public class Playtree extends Item implements ActionListener{
frame = null;
}
}
public String returnCode() {
String code = "<Playtree";
public String returnCode(String indent) {
String code = indent+"<Playtree";
if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\"";
code+=" font=\""+font+"\"";
if(!bgcolor1.equals(BGCOLOR1_DEFAULT)) code+=" bgcolor1=\""+bgcolor1+"\"";
......@@ -625,8 +625,8 @@ public class Playtree extends Item implements ActionListener{
if (!help.equals(HELP_DEFAULT)) code+=" help=\""+help+"\"";
if (!visible.equals(VISIBLE_DEFAULT)) code+=" visible=\""+visible+"\"";
code+=">\n";
code+=slider.returnCode();
code+="\n</Playtree>";
code+=slider.returnCode(indent+Skin.indentation);
code+="\n"+indent+"</Playtree>";
return code;
}
public void draw(Graphics2D g) {
......
......@@ -24,7 +24,6 @@ package vlcskineditor.items;
import vlcskineditor.*;
import java.awt.*;
import javax.swing.*;
import javax.swing.tree.*;
/**
......@@ -76,22 +75,22 @@ public class RadialSlider extends Item{
public void showOptions() {
}
public String returnCode() {
String code = "<RadialSlider";
if (id!=ID_DEFAULT) code+=" id=\""+id+"\"";
public String returnCode(String indent) {
String code = indent+"<RadialSlider";
if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\"";
if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\"";
if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\"";
code+=" sequence=\""+sequence+"\" nbimages=\""+String.valueOf(nbimages)+"\"";
if (minangle!=MINANGLE_DEFAULT) code+=" minangle=\""+String.valueOf(minangle)+"\"";
if (maxangle!=MAXANGLE_DEFAULT) code+=" maxangle=\""+String.valueOf(maxangle)+"\"";
if (value!=VALUE_DEFAULT) code+=" value=\""+value+"\"";
if (tooltiptext!=TOOLTIPTEXT_DEFAULT) code+=" tooltiptext=\""+tooltiptext+"\"";
if (lefttop!=LEFTTOP_DEFAULT) code+=" lefttop=\""+lefttop+"\"";
if (rightbottom!=RIGHTBOTTOM_DEFAULT) code+=" rightbottom=\""+rightbottom+"\"";
if (!value.equals(VALUE_DEFAULT)) code+=" value=\""+value+"\"";
if (!tooltiptext.equals(TOOLTIPTEXT_DEFAULT)) code+=" tooltiptext=\""+tooltiptext+"\"";
if (!lefttop.equals(LEFTTOP_DEFAULT)) code+=" lefttop=\""+lefttop+"\"";
if (!rightbottom.equals(RIGHTBOTTOM_DEFAULT)) code+=" rightbottom=\""+rightbottom+"\"";
if (xkeepratio!=XKEEPRATIO_DEFAULT) code+=" xkeepratio=\""+String.valueOf(xkeepratio)+"\"";
if (ykeepratio!=YKEEPRATIO_DEFAULT) code+=" ykeepratio=\""+String.valueOf(ykeepratio)+"\"";
if (help!=HELP_DEFAULT) code+=" help=\""+help+"\"";
if (visible!=VISIBLE_DEFAULT) code+=" visible=\""+visible+"\"";
if (!help.equals(HELP_DEFAULT)) code+=" help=\""+help+"\"";
if (!visible.equals(VISIBLE_DEFAULT)) code+=" visible=\""+visible+"\"";
code+="/>";
return code;
}
......
......@@ -515,8 +515,8 @@ public class Slider extends Item implements ActionListener{
sbg_chb.setSelected(false);
sbg_btn.setEnabled(false);
}
public String returnCode() {
String code = "<Slider";
public String returnCode(String indent) {
String code = indent+"<Slider";
if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\"";
if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\"";
if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\"";
......@@ -537,8 +537,8 @@ public class Slider extends Item implements ActionListener{
code+="/>";
}
else {
code+=">\n"+sbg.returnCode();
code+="\n</Slider>";
code+=">\n"+sbg.returnCode(indent+Skin.indentation);
code+="\n"+indent+"</Slider>";
}
return code;
}
......
......@@ -251,8 +251,8 @@ public class SliderBackground extends Item implements ActionListener{
if(!created) sl.removeBG();
}
}
public String returnCode() {
String code = "<SliderBackground";
public String returnCode(String indent) {
String code = indent+"<SliderBackground";
if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\"";
code+=" image=\""+image+"\"";
if (nbhoriz!=NBHORIZ_DEFAULT) code+=" nbhoriz=\""+String.valueOf(nbhoriz)+"\"";
......
......@@ -383,8 +383,8 @@ public class Text extends Item implements ActionListener{
frame = null;
}
}
public String returnCode() {
String code = "<Text";
public String returnCode(String indent) {
String code = indent+"<Text";
code+=" text=\""+text+"\"";
code+=" font=\""+font+"\"";
if (!alignment.equals(ALIGNMENT_DEFAULT)) code+=" alignment=\""+alignment+"\"";
......
......@@ -326,8 +326,8 @@ public class Video extends Item implements ActionListener{
frame = null;
}
}
public String returnCode() {
String code = "<Video";
public String returnCode(String indent) {
String code = indent+"<Video";
if (!id.equals(ID_DEFAULT)) code+=" id=\""+id+"\"";
if (x!=X_DEFAULT) code+=" x=\""+String.valueOf(x)+"\"";
if (y!=Y_DEFAULT) code+=" y=\""+String.valueOf(y)+"\"";
......
......@@ -150,8 +150,7 @@ public class Bitmap extends Resource implements ActionListener{
}
else if(image.getRGB(x,y)!=alphargb && alpha>0) {
float amount = alpha;
amount = amount/255;
System.out.println(alpha +" --> "+amount);
amount = amount/255;
g2d.setColor(new Color((int)(red*amount), (int)(green*amount), (int)(blue*amount)));
g2d.drawRect(x,y,0,0);
}
......@@ -352,17 +351,17 @@ public class Bitmap extends Resource implements ActionListener{
frame = null;
}
}
public String returnCode() {
String code = "<Bitmap id=\""+id+"\" file=\""+file+"\"";
public String returnCode(String indent) {
String code = indent+"<Bitmap id=\""+id+"\" file=\""+file+"\"";
code+=" alphacolor=\""+alphacolor+"\"";
if (nbframes!=NBFRAMES_DEFAULT) code+=" nbframes=\""+String.valueOf(nbframes)+"\"";
if (fps!=FPS_DEFAULT) code+=" fps=\""+String.valueOf(fps)+"\"";
if(SubBitmaps.size()>0) {
code+=">\n";
for (int i=0;i<SubBitmaps.size();i++) {
code+=SubBitmaps.get(i).returnCode();
code+=SubBitmaps.get(i).returnCode(indent+Skin.indentation);
}
code+="</Bitmap>\n";
code+=indent+"</Bitmap>\n";
}
else {
code+="/>\n";
......
......@@ -52,8 +52,8 @@ public class BitmapFont extends Resource{
public void showOptions() {
}
public String returnCode() {
String code="<BitmapFont id=\""+id+"\" file=\""+file+"\"";
public String returnCode(String indent) {
String code=indent+"<BitmapFont id=\""+id+"\" file=\""+file+"\"";
if (type!=TYPE_DEFAULT) code+=" type=\""+type+"\"";
code+="/>\n";
return code;
......
......@@ -24,11 +24,9 @@ package vlcskineditor.resources;
import vlcskineditor.*;
import vlcskineditor.history.*;
import java.util.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.border.*;
import javax.imageio.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
......@@ -250,14 +248,14 @@ public class Font extends Resource implements ActionListener{
if (Desktop.isDesktopSupported()) {
desktop = Desktop.getDesktop();
try {
desktop.browse(new java.net.URI("http://www.videolan.org/vlc/skins2-create.html#Font"));
desktop.browse(new java.net.URI("http://www.videolan.org/vlc/skinedhlp/res-font.html"));
}
catch (Exception ex) {
JOptionPane.showMessageDialog(null,ex.toString(),ex.getMessage(),JOptionPane.ERROR_MESSAGE);
}
}
else {
JOptionPane.showMessageDialog(null,"Could not launch Browser","Go to the following URL manually:\nhttp://www.videolan.org/vlc/skins2-create.html",JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog(null,"Could not launch Browser","Go to the following URL manually:\nhttp://www.videolan.org/vlc/skinedhlp/res-font.html",JOptionPane.WARNING_MESSAGE);
}
}
else if(e.getSource().equals(cancel_btn)) {
......@@ -266,8 +264,8 @@ public class Font extends Resource implements ActionListener{
frame = null;
}
}
public String returnCode() {
String code="<Font id=\""+id+"\" file=\""+file+"\"";
public String returnCode(String indent) {
String code=indent+"<Font id=\""+id+"\" file=\""+file+"\"";
if (size!=SIZE_DEFAULT) code+=" size=\""+String.valueOf(size)+"\"";
code+="/>\n";
return code;
......
......@@ -23,15 +23,12 @@
package vlcskineditor.resources;
import vlcskineditor.*;
import java.util.*;
import javax.swing.*;
import javax.swing.tree.*;
import javax.swing.border.*;
import javax.imageio.*;
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
import java.io.*;
import vlcskineditor.history.SubBitmapAddEvent;
/**
* Handles SubBitmap resources
......@@ -283,14 +280,14 @@ public class SubBitmap extends Resource implements ActionListener{
if (Desktop.isDesktopSupported()) {
desktop = Desktop.getDesktop();
try {
desktop.browse(new java.net.URI("http://www.videolan.org/vlc/skins2-create.html#Bitmap"));
desktop.browse(new java.net.URI("http://www.videolan.org/vlc/skinedhlp/res-subbitmap.html"));
}
catch (Exception ex) {
JOptionPane.showMessageDialog(null,ex.toString(),ex.getMessage(),JOptionPane.ERROR_MESSAGE);
}
}
else {
JOptionPane.showMessageDialog(null,"Could not launch Browser","Go to the following URL manually:\nhttp://www.videolan.org/vlc/skins2-create.html",JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog(null,"Could not launch Browser","Go to the following URL manually:\nhttp://www.videolan.org/vlc/skinedhlp/res-subbitmap.html",JOptionPane.WARNING_MESSAGE);
}
}
else if(e.getSource().equals(cancel_btn)) {
......@@ -312,8 +309,8 @@ public class SubBitmap extends Resource implements ActionListener{
sbew.frame = null;
sbew = null;
}
public String returnCode() {
String code="<SubBitmap id=\""+id+"\" x=\""+String.valueOf(x)+"\" y=\""+String.valueOf(y)+"\"";
public String returnCode(String indent) {
String code=indent+"<SubBitmap id=\""+id+"\" x=\""+String.valueOf(x)+"\" y=\""+String.valueOf(y)+"\"";
code+=" width=\""+String.valueOf(width)+"\" height=\""+String.valueOf(height)+"\"";
if (nbframes!=NBFRAMES_DEFAULT) code+=" nbframes=\""+String.valueOf(nbframes)+"\"";
if (fps!=FPS_DEFAULT) code+=" fps=\""+String.valueOf(fps)+"\"";
......
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