Commit 2ad36ad2 authored by Daniel Dreibrodt's avatar Daniel Dreibrodt

#fix: disallow " to appear in IDs, actions, and other values, so that skin...

#fix: disallow " to appear in IDs, actions, and other values, so that skin file cannot be broken by that
#fix: save the new art parameter of images to the skin file
#fix: always use / instead of \ in resource paths, so that skins also work on Linux
parent 92d7b801
...@@ -2,7 +2,16 @@ ...@@ -2,7 +2,16 @@
----------------------------------------------------------- -----------------------------------------------------------
Changelog: Changelog:
----------------------------------------------------------- -----------------------------------------------------------
0.8.6 - Bugfix: XML Output was not proper UTF-8 0.8.6 - Support for new skins2 features in VLC 1.1/1.2
+ cover art
+ video recording action
+ new image resize mode
- Bugfix: XML Output was not proper UTF-8
- Bugfix: " was tolerated as value for IDs, actions
etc. and could thus break your skin file
- Bugfix: Paths to resource files could contain \
and thus break your skin on Linux
- several other small bugfixes
0.8.5 - Various bugfixes and technical improvements 0.8.5 - Various bugfixes and technical improvements
- A toolbar was added - A toolbar was added
......
...@@ -341,7 +341,7 @@ public class Layout implements ActionListener{ ...@@ -341,7 +341,7 @@ public class Layout implements ActionListener{
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) { if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) { if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return; return;
} }
......
...@@ -118,7 +118,7 @@ public class Window implements ActionListener{ ...@@ -118,7 +118,7 @@ public class Window implements ActionListener{
id=id_tf.getText(); id=id_tf.getText();
x=Integer.parseInt(x_tf.getText()); x=Integer.parseInt(x_tf.getText());
y=Integer.parseInt(y_tf.getText()); y=Integer.parseInt(y_tf.getText());
visible=visible_tf.getText(); visible=visible_tf.getText().replaceAll("\"","'");
dragdrop=Boolean.parseBoolean(dragdrop_tf.getText()); dragdrop=Boolean.parseBoolean(dragdrop_tf.getText());
playondrop=Boolean.parseBoolean(playondrop_tf.getText()); playondrop=Boolean.parseBoolean(playondrop_tf.getText());
s.updateWindows(); s.updateWindows();
...@@ -131,7 +131,7 @@ public class Window implements ActionListener{ ...@@ -131,7 +131,7 @@ public class Window implements ActionListener{
id=id_tf.getText(); id=id_tf.getText();
x=Integer.parseInt(x_tf.getText()); x=Integer.parseInt(x_tf.getText());
y=Integer.parseInt(y_tf.getText()); y=Integer.parseInt(y_tf.getText());
visible=visible_tf.getText(); visible=visible_tf.getText().replaceAll("\"","'");
dragdrop=Boolean.parseBoolean(dragdrop_tf.getText()); dragdrop=Boolean.parseBoolean(dragdrop_tf.getText());
playondrop=Boolean.parseBoolean(playondrop_tf.getText()); playondrop=Boolean.parseBoolean(playondrop_tf.getText());
s.updateWindows(); s.updateWindows();
...@@ -299,7 +299,7 @@ public class Window implements ActionListener{ ...@@ -299,7 +299,7 @@ public class Window implements ActionListener{
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) { if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) { if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return; return;
} }
......
...@@ -321,7 +321,7 @@ public class Anchor extends Item implements ActionListener { ...@@ -321,7 +321,7 @@ public class Anchor extends Item implements ActionListener {
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) { if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) { if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return; return;
} }
...@@ -331,6 +331,10 @@ public class Anchor extends Item implements ActionListener { ...@@ -331,6 +331,10 @@ public class Anchor extends Item implements ActionListener {
return; return;
} }
} }
if(points_tf.getText().equals("")||points.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_POINTS_INVALID"),Language.get("ERROR_POINTS_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
update(); update();
frame.setVisible(false); frame.setVisible(false);
frame.dispose(); frame.dispose();
......
...@@ -139,14 +139,14 @@ public class Button extends Item implements ActionListener, ResourceChangeListen ...@@ -139,14 +139,14 @@ public class Button extends Item implements ActionListener, ResourceChangeListen
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
up = up_tf.getText(); up = up_tf.getText();
over = over_tf.getText(); over = over_tf.getText();
down = down_tf.getText(); down = down_tf.getText();
action = action_tf.getText(); action = action_tf.getText().replaceAll("\"","'");
tooltiptext = tooltiptext_tf.getText(); tooltiptext = tooltiptext_tf.getText().replaceAll("\"","'");
ItemAddEvent bae = new ItemAddEvent(s.getParentListOf(id),this); ItemAddEvent bae = new ItemAddEvent(s.getParentListOf(id),this);
s.m.hist.addEvent(bae); s.m.hist.addEvent(bae);
...@@ -165,8 +165,8 @@ public class Button extends Item implements ActionListener, ResourceChangeListen ...@@ -165,8 +165,8 @@ public class Button extends Item implements ActionListener, ResourceChangeListen
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
up = up_tf.getText(); up = up_tf.getText();
over = over_tf.getText(); over = over_tf.getText();
...@@ -468,7 +468,7 @@ public class Button extends Item implements ActionListener, ResourceChangeListen ...@@ -468,7 +468,7 @@ public class Button extends Item implements ActionListener, ResourceChangeListen
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) { if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) { if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return; return;
} }
......
...@@ -181,20 +181,20 @@ public class Checkbox extends Item implements ActionListener, ResourceChangeList ...@@ -181,20 +181,20 @@ public class Checkbox extends Item implements ActionListener, ResourceChangeList
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
up1 = up1_tf.getText(); up1 = up1_tf.getText();
over1 = over1_tf.getText(); over1 = over1_tf.getText();
down1 = down1_tf.getText(); down1 = down1_tf.getText();
action1 = action1_tf.getText(); action1 = action1_tf.getText().replaceAll("\"","'");
tooltiptext1 = tooltiptext1_tf.getText(); tooltiptext1 = tooltiptext1_tf.getText().replaceAll("\"","'");
up2 = up2_tf.getText(); up2 = up2_tf.getText();
over2 = over2_tf.getText(); over2 = over2_tf.getText();
down2 = down2_tf.getText(); down2 = down2_tf.getText();
action2 = action2_tf.getText(); action2 = action2_tf.getText().replaceAll("\"","'");
tooltiptext2 = tooltiptext2_tf.getText(); tooltiptext2 = tooltiptext2_tf.getText().replaceAll("\"","'");
state = state_tf.getText(); state = state_tf.getText().replaceAll("\"","'");
ItemAddEvent cae = new ItemAddEvent(s.getParentListOf(id),this); ItemAddEvent cae = new ItemAddEvent(s.getParentListOf(id),this);
s.m.hist.addEvent(cae); s.m.hist.addEvent(cae);
...@@ -214,20 +214,20 @@ public class Checkbox extends Item implements ActionListener, ResourceChangeList ...@@ -214,20 +214,20 @@ public class Checkbox extends Item implements ActionListener, ResourceChangeList
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
up1 = up1_tf.getText(); up1 = up1_tf.getText();
over1 = over1_tf.getText(); over1 = over1_tf.getText();
down1 = down1_tf.getText(); down1 = down1_tf.getText();
action1 = action1_tf.getText(); action1 = action1_tf.getText().replaceAll("\"","'");
tooltiptext1 = tooltiptext1_tf.getText(); tooltiptext1 = tooltiptext1_tf.getText().replaceAll("\"","'");
up2 = up2_tf.getText(); up2 = up2_tf.getText();
over2 = over2_tf.getText(); over2 = over2_tf.getText();
down2 = down2_tf.getText(); down2 = down2_tf.getText();
action2 = action2_tf.getText(); action2 = action2_tf.getText().replaceAll("\"","'");
tooltiptext2 = tooltiptext2_tf.getText(); tooltiptext2 = tooltiptext2_tf.getText().replaceAll("\"","'");
state = state_tf.getText(); state = state_tf.getText().replaceAll("\"","'");
cee.setNew(); cee.setNew();
s.m.hist.addEvent(cee); s.m.hist.addEvent(cee);
...@@ -648,7 +648,7 @@ public class Checkbox extends Item implements ActionListener, ResourceChangeList ...@@ -648,7 +648,7 @@ public class Checkbox extends Item implements ActionListener, ResourceChangeList
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) { if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) { if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return; return;
} }
......
...@@ -223,7 +223,7 @@ public class Group extends Item implements ActionListener{ ...@@ -223,7 +223,7 @@ public class Group extends Item implements ActionListener{
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) { if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) { if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return; return;
} }
......
...@@ -43,11 +43,12 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -43,11 +43,12 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
public final String RESIZE_DEFAULT = "mosaic"; public final String RESIZE_DEFAULT = "mosaic";
public final String ACTION_DEFAULT = "none"; public final String ACTION_DEFAULT = "none";
public final String ACTION2_DEFAULT = "none"; public final String ACTION2_DEFAULT = "none";
public final boolean ART_DEFAULT = false;
public String image; public String image;
public String resize = RESIZE_DEFAULT; public String resize = RESIZE_DEFAULT;
public String action = ACTION_DEFAULT; public String action = ACTION_DEFAULT;
public String action2 = ACTION2_DEFAULT; public String action2 = ACTION2_DEFAULT;
public boolean art = false; public boolean art = ART_DEFAULT;
JFrame frame = null; JFrame frame = null;
JTextField id_tf, x_tf, y_tf, help_tf, visible_tf, image_tf, action2_tf; JTextField id_tf, x_tf, y_tf, help_tf, visible_tf, image_tf, action2_tf;
JComboBox lefttop_cb, rightbottom_cb, xkeepratio_cb, ykeepratio_cb, resize_cb, action_cb; JComboBox lefttop_cb, rightbottom_cb, xkeepratio_cb, ykeepratio_cb, resize_cb, action_cb;
...@@ -130,13 +131,13 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -130,13 +131,13 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
image = image_tf.getText(); image = image_tf.getText();
resize = resize_cb.getSelectedItem().toString(); resize = resize_cb.getSelectedItem().toString();
action = action_cb.getSelectedItem().toString(); action = action_cb.getSelectedItem().toString();
action2 = action2_tf.getText(); action2 = action2_tf.getText().replaceAll("\"","'");
art = art_cb.isSelected(); art = art_cb.isSelected();
...@@ -157,13 +158,13 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -157,13 +158,13 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
image = image_tf.getText(); image = image_tf.getText();
resize = resize_cb.getSelectedItem().toString(); resize = resize_cb.getSelectedItem().toString();
action = action_cb.getSelectedItem().toString(); action = action_cb.getSelectedItem().toString();
action2 = action2_tf.getText(); action2 = action2_tf.getText().replaceAll("\"","'");
art = art_cb.isSelected(); art = art_cb.isSelected();
...@@ -459,7 +460,7 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -459,7 +460,7 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) { if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) { if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame, Language.get("ERROR_ID_INVALID_MSG"), Language.get("ERROR_ID_INVALID_TITLE"), JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame, Language.get("ERROR_ID_INVALID_MSG"), Language.get("ERROR_ID_INVALID_TITLE"), JOptionPane.INFORMATION_MESSAGE);
return; return;
} else if(!id_tf.getText().equals(id)) { } else if(!id_tf.getText().equals(id)) {
...@@ -522,6 +523,11 @@ public class Image extends Item implements ActionListener, ResourceChangeListene ...@@ -522,6 +523,11 @@ public class Image extends Item implements ActionListener, ResourceChangeListene
} }
code += " image=\"" + image + "\""; code += " image=\"" + image + "\"";
if(art!=ART_DEFAULT) {
code += "art=\""+String.valueOf(art)+"\"";
}
if(!action.equals(ACTION_DEFAULT)) { if(!action.equals(ACTION_DEFAULT)) {
code += " action=\"" + action + "\""; code += " action=\"" + action + "\"";
} }
......
...@@ -109,8 +109,8 @@ public class Panel extends Item implements ActionListener{ ...@@ -109,8 +109,8 @@ public class Panel extends Item implements ActionListener{
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText()); width = Integer.parseInt(width_tf.getText());
height = Integer.parseInt(height_tf.getText()); height = Integer.parseInt(height_tf.getText());
...@@ -136,8 +136,8 @@ public class Panel extends Item implements ActionListener{ ...@@ -136,8 +136,8 @@ public class Panel extends Item implements ActionListener{
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText()); width = Integer.parseInt(width_tf.getText());
height = Integer.parseInt(height_tf.getText()); height = Integer.parseInt(height_tf.getText());
...@@ -360,7 +360,7 @@ public class Panel extends Item implements ActionListener{ ...@@ -360,7 +360,7 @@ public class Panel extends Item implements ActionListener{
} }
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) { if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) { if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return; return;
} }
......
...@@ -215,8 +215,8 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList ...@@ -215,8 +215,8 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText()); width = Integer.parseInt(width_tf.getText());
height = Integer.parseInt(height_tf.getText()); height = Integer.parseInt(height_tf.getText());
...@@ -225,11 +225,11 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList ...@@ -225,11 +225,11 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList
itemimage = itemimage_tf.getText(); itemimage = itemimage_tf.getText();
openimage = openimage_tf.getText(); openimage = openimage_tf.getText();
closedimage = closedimage_tf.getText(); closedimage = closedimage_tf.getText();
fgcolor = fgcolor_tf.getText(); fgcolor = fgcolor_tf.getText().replaceAll("\"","'");
selcolor = selcolor_tf.getText(); selcolor = selcolor_tf.getText().replaceAll("\"","'");
playcolor = playcolor_tf.getText(); playcolor = playcolor_tf.getText().replaceAll("\"","'");
bgcolor1 = bgcolor1_tf.getText(); bgcolor1 = bgcolor1_tf.getText().replaceAll("\"","'");
bgcolor2 = bgcolor2_tf.getText(); bgcolor2 = bgcolor2_tf.getText().replaceAll("\"","'");
flat = (Boolean) flat_cb.getSelectedItem(); flat = (Boolean) flat_cb.getSelectedItem();
s.updateItems(); s.updateItems();
...@@ -249,8 +249,8 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList ...@@ -249,8 +249,8 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText()); width = Integer.parseInt(width_tf.getText());
height = Integer.parseInt(height_tf.getText()); height = Integer.parseInt(height_tf.getText());
...@@ -259,11 +259,11 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList ...@@ -259,11 +259,11 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList
itemimage = itemimage_tf.getText(); itemimage = itemimage_tf.getText();
openimage = openimage_tf.getText(); openimage = openimage_tf.getText();
closedimage = closedimage_tf.getText(); closedimage = closedimage_tf.getText();
fgcolor = fgcolor_tf.getText(); fgcolor = fgcolor_tf.getText().replaceAll("\"","'");
selcolor = selcolor_tf.getText(); selcolor = selcolor_tf.getText().replaceAll("\"","'");
playcolor = playcolor_tf.getText(); playcolor = playcolor_tf.getText().replaceAll("\"","'");
bgcolor1 = bgcolor1_tf.getText(); bgcolor1 = bgcolor1_tf.getText().replaceAll("\"","'");
bgcolor2 = bgcolor2_tf.getText(); bgcolor2 = bgcolor2_tf.getText().replaceAll("\"","'");
flat = (Boolean) flat_cb.getSelectedItem(); flat = (Boolean) flat_cb.getSelectedItem();
s.updateItems(); s.updateItems();
...@@ -707,7 +707,7 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList ...@@ -707,7 +707,7 @@ public class Playtree extends Item implements ActionListener, ResourceChangeList
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) { if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) { if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame, Language.get("ERROR_ID_INVALID_MSG"), Language.get("ERROR_ID_INVALID_TITLE"), JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame, Language.get("ERROR_ID_INVALID_MSG"), Language.get("ERROR_ID_INVALID_TITLE"), JOptionPane.INFORMATION_MESSAGE);
return; return;
} else if(!id_tf.getText().equals(id)) { } else if(!id_tf.getText().equals(id)) {
......
...@@ -226,8 +226,8 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen ...@@ -226,8 +226,8 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
up = up_tf.getText(); up = up_tf.getText();
over = over_tf.getText(); over = over_tf.getText();
...@@ -235,7 +235,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen ...@@ -235,7 +235,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
points = points_tf.getText(); points = points_tf.getText();
thickness = Integer.parseInt(thickness_tf.getText()); thickness = Integer.parseInt(thickness_tf.getText());
if(!inPlaytree) value = (String)value_cb.getSelectedItem(); if(!inPlaytree) value = (String)value_cb.getSelectedItem();
tooltiptext = tooltiptext_tf.getText(); tooltiptext = tooltiptext_tf.getText().replaceAll("\"","'");
updateBezier(); updateBezier();
...@@ -257,8 +257,8 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen ...@@ -257,8 +257,8 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
up = up_tf.getText(); up = up_tf.getText();
over = over_tf.getText(); over = over_tf.getText();
...@@ -266,7 +266,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen ...@@ -266,7 +266,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
points = points_tf.getText(); points = points_tf.getText();
thickness = Integer.parseInt(thickness_tf.getText()); thickness = Integer.parseInt(thickness_tf.getText());
if(!inPlaytree) value = (String)value_cb.getSelectedItem(); if(!inPlaytree) value = (String)value_cb.getSelectedItem();
tooltiptext = tooltiptext_tf.getText(); tooltiptext = tooltiptext_tf.getText().replaceAll("\"","'");
updateBezier(); updateBezier();
...@@ -599,7 +599,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen ...@@ -599,7 +599,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
thickness_tf.setText(String.valueOf(thickness)); thickness_tf.setText(String.valueOf(thickness));
points_tf.setText(points); points_tf.setText(points);
if(!inPlaytree) value_cb.setSelectedItem(value); if(!inPlaytree) value_cb.setSelectedItem(value);
tooltiptext_tf.setText(tooltiptext); tooltiptext_tf.setText(tooltiptext);
sbg_chb.setSelected(sbg!=null); sbg_chb.setSelected(sbg!=null);
sbg_btn.setEnabled(sbg!=null); sbg_btn.setEnabled(sbg!=null);
...@@ -610,7 +610,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen ...@@ -610,7 +610,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) { if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) { if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return; return;
} }
...@@ -638,7 +638,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen ...@@ -638,7 +638,7 @@ public class Slider extends Item implements ActionListener, ResourceChangeListen
down_res = s.getImageResource(down); down_res = s.getImageResource(down);
return; return;
} }
if(points_tf.getText().equals("")) { if(points_tf.getText().equals("")||points.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_POINTS_INVALID"),Language.get("ERROR_POINTS_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame,Language.get("ERROR_POINTS_INVALID"),Language.get("ERROR_POINTS_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return; return;
} }
......
...@@ -311,7 +311,7 @@ public class SliderBackground extends Item implements ActionListener, ResourceCh ...@@ -311,7 +311,7 @@ public class SliderBackground extends Item implements ActionListener, ResourceCh
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) { if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) { if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame, Language.get("ERROR_ID_INVALID_MSG"), Language.get("ERROR_ID_INVALID_TITLE"), JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame, Language.get("ERROR_ID_INVALID_MSG"), Language.get("ERROR_ID_INVALID_TITLE"), JOptionPane.INFORMATION_MESSAGE);
return; return;
} else if(!id_tf.getText().equals(id)) { } else if(!id_tf.getText().equals(id)) {
......
...@@ -148,12 +148,12 @@ public class Text extends Item implements ActionListener, ResourceChangeListener ...@@ -148,12 +148,12 @@ public class Text extends Item implements ActionListener, ResourceChangeListener
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
text = text_tf.getText(); text = text_tf.getText().replaceAll("\"","'");
font = font_tf.getText(); font = font_tf.getText();
color = color_tf.getText(); color = color_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText()); width = Integer.parseInt(width_tf.getText());
alignment = alignment_cb.getSelectedItem().toString(); alignment = alignment_cb.getSelectedItem().toString();
scrolling = scrolling_cb.getSelectedItem().toString(); scrolling = scrolling_cb.getSelectedItem().toString();
...@@ -176,12 +176,12 @@ public class Text extends Item implements ActionListener, ResourceChangeListener ...@@ -176,12 +176,12 @@ public class Text extends Item implements ActionListener, ResourceChangeListener
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();
xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString()); xkeepratio = Boolean.parseBoolean(xkeepratio_cb.getSelectedItem().toString());
ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString()); ykeepratio = Boolean.parseBoolean(ykeepratio_cb.getSelectedItem().toString());
visible = visible_tf.getText(); visible = visible_tf.getText().replaceAll("\"","'");
help = help_tf.getText(); help = help_tf.getText().replaceAll("\"","'");
text = text_tf.getText(); text = text_tf.getText().replaceAll("\"","'");
font = font_tf.getText(); font = font_tf.getText();
color = color_tf.getText(); color = color_tf.getText().replaceAll("\"","'");
width = Integer.parseInt(width_tf.getText()); width = Integer.parseInt(width_tf.getText());
alignment = alignment_cb.getSelectedItem().toString(); alignment = alignment_cb.getSelectedItem().toString();
scrolling = scrolling_cb.getSelectedItem().toString(); scrolling = scrolling_cb.getSelectedItem().toString();
...@@ -491,7 +491,7 @@ public class Text extends Item implements ActionListener, ResourceChangeListener ...@@ -491,7 +491,7 @@ public class Text extends Item implements ActionListener, ResourceChangeListener
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) { if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) { if(id_tf.getText().equals("")||id.contains("\"")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE); JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return; return;
} }
......
...@@ -112,8 +112,8 @@ public class Video extends Item implements ActionListener{ ...@@ -112,8 +112,8 @@ public class Video extends Item implements ActionListener{
rightbottom = rightbottom_cb.getSelectedItem().toString(); rightbottom = rightbottom_cb.getSelectedItem().toString();