Commit ea188daa authored by Daniel Dreibrodt's avatar Daniel Dreibrodt

new layout & multi-language support for Button.java

auto search&replace of common strings with multi-language version
parent 50578dde
......@@ -54,11 +54,13 @@ EXIT_CONFIRM_TITLE|Your modifications were not saved
EXIT_CONFIRM_MSG|Would you like to save your skin before exiting?
UPDATE_TITLE|Update found
UPDATE_MSG|There is an update available for the Skin Editor.\nYour version: %v\nLatest version: %c\nDo you want to update the Skin Editor now?
VLT_PROGRESS|Creating VLT archive...
VLT_PROGRESS|Creating VLT file...
VLT_SUCCESS_MSG|VideoLAN Theme created
VLT_SUCCESS_TITLE|VLT file has been successfully created.
DOWNLOAD_PROGRESS|Downloading...
CONNECT_PROGRESS|Connecting...
UPDATE_SUCCESS_TITLE|Finished updating
UPDATE_SUCCESS_MSG|Update was sucessfully downloaded and installed.\nVLC Skin Editor will restart now
UPDATE_SUCCESS_MSG|Update was successfully downloaded and installed.\nVLC Skin Editor will restart now
#Error messages
ERROR_FILENEXIST_TITLE|Error while opening file
......@@ -117,6 +119,8 @@ ERROR_HEIGHT_INVALID_TITLE|Invalid heiht
ERROR_HEIGHT_INVALID_MSG|Please enter a valid height.
ERROR_OUTSIDE_TITLE|Dimensions not valid
ERROR_OUTSIDE_MSG|Specified dimensions are outside the parent bitmap!
ERROR_BITMAP_NEXIST|The bitmap %i does not exist.
ERROR_BITMAP_NEXIST_TITLE|Image not valid!
#Other strings
THEMEINFO_NAME_DEFAULT|Unnamed Theme
......
......@@ -16,6 +16,13 @@ WIN_ITEM_LEFTTOP|Lefttop:
WIN_ITEM_LEFTTOP_TIP|Indicate to which corner of the Layout the top-left-hand corner of this iten is attached to, in case of resizing.
WIN_ITEM_RIGHTBOTTOM|Rightbottom:
WIN_ITEM_RIGHTBOTTOM_TIP|Indicate to which corner of the Layout the bottom-right-hand corner of this item is attached to, in case of resizing.
WIN_ITEM_XKEEPRATIO|Keep X Ratio:
WIN_ITEM_XKEEPRATIO_TIP|When set to true, the behaviour of the horizontal resizing is changed. For example, if initially the space to the left of the control is twice as big as the one to its right, this will stay the same during any horizontal resizing. The width of the control stays constant.
WIN_ITEM_YKEEPRATIO|Keep Y Ratio:
WIN_ITEM_YKEEPRATIO_TIP|When set to true, the behaviour of the vertical resizing is changed. For example, if initially the space to the top of the control is twice as big as the one to its bottom, this will stay the same during any vertical resizing. The height of the control stays constant.
WIN_ITEM_HELP|Help text:
WIN_ITEM_HELP_TIP|The variable '$H' will be expanded to this value when the mouse hovers the current control.
WIN_ITEM_TOOLTIPTEXT|Tooltiptext:
FILE_INDIR|in the same folder as the XML file
#Bitmap
......@@ -81,3 +88,11 @@ WIN_ANCHOR_RANGE_TIP|Range of the anchor's area of effect, in pixels.
WIN_ANCHOR_PRIORITY|Priority*:
WIN_ANCHOR_PRIORITY_TIP|Each anchor has a priority (priority attribute), and the anchor with the highest priority is the winner, which means that when moving its window all the other anchored windows will move too. To break the effect of 2 anchored windows, you need to move the window whose anchor has the lower priority.
WIN_ANCHOR_BOUNDARIES|Boundaries
#Button
WIN_BUTTON_TITLE|Button settings
WIN_BUTTON_UP|Normal image*:
WIN_BUTTON_OVER|Mouse-over image:
WIN_BUTTON_DOWN|Mouse-click image:
WIN_BUTTON_ACTION|Action:
WIN_BUTTON_ATTR|Button Attributes
\ No newline at end of file
......@@ -259,7 +259,7 @@ public class Layout implements ActionListener{
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, id_tf, 0, SpringLayout.VERTICAL_CENTER, id_l);
general_layout.putConstraint(SpringLayout.WEST, id_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, general, 5, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.SOUTH, general, 10, SpringLayout.SOUTH, id_l);
general_layout.putConstraint(SpringLayout.SOUTH, general, 10, SpringLayout.SOUTH, id_tf);
frame.add(general);
JPanel dim = new JPanel(null);
......@@ -291,42 +291,42 @@ public class Layout implements ActionListener{
dim_layout.putConstraint(SpringLayout.WEST, width_tf, tf_dx, SpringLayout.WEST, dim);
dim_layout.putConstraint(SpringLayout.EAST, dim, 5, SpringLayout.EAST, width_tf);
dim_layout.putConstraint(SpringLayout.NORTH, height_l, 10, SpringLayout.SOUTH, width_l);
dim_layout.putConstraint(SpringLayout.NORTH, height_l, 10, SpringLayout.SOUTH, width_tf);
dim_layout.putConstraint(SpringLayout.WEST, height_l, 5, SpringLayout.WEST, dim);
dim_layout.putConstraint(SpringLayout.VERTICAL_CENTER, height_tf, 0, SpringLayout.VERTICAL_CENTER, height_l);
dim_layout.putConstraint(SpringLayout.WEST, height_tf, tf_dx, SpringLayout.WEST, dim);
dim_layout.putConstraint(SpringLayout.EAST, height_tf, 0, SpringLayout.EAST, width_tf);
dim_layout.putConstraint(SpringLayout.NORTH, minwidth_l, 10, SpringLayout.SOUTH, height_l);
dim_layout.putConstraint(SpringLayout.NORTH, minwidth_l, 10, SpringLayout.SOUTH, height_tf);
dim_layout.putConstraint(SpringLayout.WEST, minwidth_l, 5, SpringLayout.WEST, dim);
dim_layout.putConstraint(SpringLayout.VERTICAL_CENTER, minwidth_tf, 0, SpringLayout.VERTICAL_CENTER, minwidth_l);
dim_layout.putConstraint(SpringLayout.WEST, minwidth_tf, tf_dx, SpringLayout.WEST, dim);
dim_layout.putConstraint(SpringLayout.EAST, minwidth_tf, 0, SpringLayout.EAST, width_tf);
dim_layout.putConstraint(SpringLayout.NORTH, minheight_l, 10, SpringLayout.SOUTH, minwidth_l);
dim_layout.putConstraint(SpringLayout.NORTH, minheight_l, 10, SpringLayout.SOUTH, minwidth_tf);
dim_layout.putConstraint(SpringLayout.WEST, minheight_l, 5, SpringLayout.WEST, dim);
dim_layout.putConstraint(SpringLayout.VERTICAL_CENTER, minheight_tf, 0, SpringLayout.VERTICAL_CENTER, minheight_l);
dim_layout.putConstraint(SpringLayout.WEST, minheight_tf, tf_dx, SpringLayout.WEST, dim);
dim_layout.putConstraint(SpringLayout.EAST, minheight_tf, 0, SpringLayout.EAST, width_tf);
dim_layout.putConstraint(SpringLayout.NORTH, maxwidth_l, 10, SpringLayout.SOUTH, minheight_l);
dim_layout.putConstraint(SpringLayout.NORTH, maxwidth_l, 10, SpringLayout.SOUTH, minheight_tf);
dim_layout.putConstraint(SpringLayout.WEST, maxwidth_l, 5, SpringLayout.WEST, dim);
dim_layout.putConstraint(SpringLayout.VERTICAL_CENTER, maxwidth_tf, 0, SpringLayout.VERTICAL_CENTER, maxwidth_l);
dim_layout.putConstraint(SpringLayout.WEST, maxwidth_tf, tf_dx, SpringLayout.WEST, dim);
dim_layout.putConstraint(SpringLayout.EAST, maxwidth_tf, 0, SpringLayout.EAST, width_tf);
dim_layout.putConstraint(SpringLayout.NORTH, maxheight_l, 10, SpringLayout.SOUTH, maxwidth_l);
dim_layout.putConstraint(SpringLayout.NORTH, maxheight_l, 10, SpringLayout.SOUTH, maxwidth_tf);
dim_layout.putConstraint(SpringLayout.WEST, maxheight_l, 5, SpringLayout.WEST, dim);
dim_layout.putConstraint(SpringLayout.VERTICAL_CENTER, maxheight_tf, 0, SpringLayout.VERTICAL_CENTER, maxheight_l);
dim_layout.putConstraint(SpringLayout.WEST, maxheight_tf, tf_dx, SpringLayout.WEST, dim);
dim_layout.putConstraint(SpringLayout.EAST, maxheight_tf, 0, SpringLayout.EAST, width_tf);
dim_layout.putConstraint(SpringLayout.SOUTH, dim, 10, SpringLayout.SOUTH, maxheight_l);
dim_layout.putConstraint(SpringLayout.SOUTH, dim, 10, SpringLayout.SOUTH, maxheight_tf);
frame.add(dim);
......
......@@ -942,7 +942,7 @@ public class Main extends javax.swing.JFrame implements ActionListener, TreeSele
tgz.close();
pwin.setVisible(false);
JOptionPane.showMessageDialog(this,Language.get("ERROR_VLT_MSG"),Language.get("ERROR_VLT_TILE"),JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(this,Language.get("VLT_SUCCESS_MSG"),Language.get("VLT_SUCCESS_TITLE"),JOptionPane.INFORMATION_MESSAGE);
}
catch (Exception ex) {
ex.printStackTrace();
......
......@@ -113,9 +113,9 @@ public class PreviewWindow extends JPanel implements MouseListener, MouseMotionL
return;
}
l=l_;
setPreferredSize(new Dimension(l.width,l.height));
int spane_w = l.width+scroll_pane.getBorder().getBorderInsets(scroll_pane).left+scroll_pane.getBorder().getBorderInsets(scroll_pane).right;
int spane_h = l.height;//+scroll_pane.getBorder().getBorderInsets(scroll_pane).top+scroll_pane.getBorder().getBorderInsets(scroll_pane).bottom;
setPreferredSize(new Dimension(l.width*z,l.height*z));
int spane_w = l.width*z+scroll_pane.getBorder().getBorderInsets(scroll_pane).left+scroll_pane.getBorder().getBorderInsets(scroll_pane).right;
int spane_h = l.height*z;//+scroll_pane.getBorder().getBorderInsets(scroll_pane).top+scroll_pane.getBorder().getBorderInsets(scroll_pane).bottom;
scroll_pane.setPreferredSize(new Dimension(spane_w, spane_h));
frame.setTitle("Window: "+w_.id + " - Layout: " + l.id);
frame.pack();
......
......@@ -190,28 +190,28 @@ public class Window implements ActionListener{
general_layout.putConstraint(SpringLayout.WEST, id_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, general, 5, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.NORTH, x_l, 10, SpringLayout.SOUTH, id_l);
general_layout.putConstraint(SpringLayout.NORTH, x_l, 10, SpringLayout.SOUTH, id_tf);
general_layout.putConstraint(SpringLayout.WEST, x_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, x_tf, 0, SpringLayout.VERTICAL_CENTER, x_l);
general_layout.putConstraint(SpringLayout.WEST, x_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, x_tf, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.NORTH, y_l, 10, SpringLayout.SOUTH, x_l);
general_layout.putConstraint(SpringLayout.NORTH, y_l, 10, SpringLayout.SOUTH, x_tf);
general_layout.putConstraint(SpringLayout.WEST, y_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, y_tf, 0, SpringLayout.VERTICAL_CENTER, y_l);
general_layout.putConstraint(SpringLayout.WEST, y_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, y_tf, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.NORTH, visible_l, 10, SpringLayout.SOUTH, y_l);
general_layout.putConstraint(SpringLayout.NORTH, visible_l, 10, SpringLayout.SOUTH, y_tf);
general_layout.putConstraint(SpringLayout.WEST, visible_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, visible_tf, 0, SpringLayout.VERTICAL_CENTER, visible_l);
general_layout.putConstraint(SpringLayout.WEST, visible_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, visible_tf, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.SOUTH, general, 10, SpringLayout.SOUTH, visible_l);
general_layout.putConstraint(SpringLayout.SOUTH, general, 10, SpringLayout.SOUTH, visible_tf);
frame.add(general);
JPanel options = new JPanel(null);
......@@ -231,14 +231,14 @@ public class Window implements ActionListener{
options_layout.putConstraint(SpringLayout.WEST, dragdrop_tf, tf_dx, SpringLayout.WEST, options);
options_layout.putConstraint(SpringLayout.EAST, options, 5, SpringLayout.EAST, dragdrop_tf);
options_layout.putConstraint(SpringLayout.NORTH, playondrop_l, 10, SpringLayout.SOUTH, dragdrop_l);
options_layout.putConstraint(SpringLayout.NORTH, playondrop_l, 10, SpringLayout.SOUTH, dragdrop_tf);
options_layout.putConstraint(SpringLayout.WEST, playondrop_l, 5, SpringLayout.WEST, options);
options_layout.putConstraint(SpringLayout.VERTICAL_CENTER, playondrop_tf, 0, SpringLayout.VERTICAL_CENTER, playondrop_l);
options_layout.putConstraint(SpringLayout.WEST, playondrop_tf, tf_dx, SpringLayout.NORTH, options);
options_layout.putConstraint(SpringLayout.EAST, playondrop_tf, 0, SpringLayout.EAST, dragdrop_tf);
options_layout.putConstraint(SpringLayout.SOUTH, options, 10, SpringLayout.SOUTH, playondrop_l);
options_layout.putConstraint(SpringLayout.SOUTH, options, 10, SpringLayout.SOUTH, playondrop_tf);
frame.add(options);
frame.add(ok_btn);
......
......@@ -192,14 +192,14 @@ public class Anchor extends Item implements ActionListener{
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, id_tf, 0, SpringLayout.VERTICAL_CENTER, id_l);
general_layout.putConstraint(SpringLayout.WEST, id_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.NORTH, priority_l, 10, SpringLayout.SOUTH, id_l);
general_layout.putConstraint(SpringLayout.NORTH, priority_l, 10, SpringLayout.SOUTH, id_tf);
general_layout.putConstraint(SpringLayout.WEST, priority_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, priority_tf, 0, SpringLayout.VERTICAL_CENTER, priority_l);
general_layout.putConstraint(SpringLayout.WEST, priority_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, priority_tf, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.NORTH, lefttop_l, 10, SpringLayout.SOUTH, priority_l);
general_layout.putConstraint(SpringLayout.NORTH, lefttop_l, 10, SpringLayout.SOUTH, priority_tf);
general_layout.putConstraint(SpringLayout.WEST, lefttop_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, lefttop_cb, 0, SpringLayout.VERTICAL_CENTER, lefttop_l);
......@@ -207,7 +207,7 @@ public class Anchor extends Item implements ActionListener{
general_layout.putConstraint(SpringLayout.EAST, lefttop_cb, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.EAST, general, 5, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.SOUTH, general, 10, SpringLayout.SOUTH, lefttop_l);
general_layout.putConstraint(SpringLayout.SOUTH, general, 10, SpringLayout.SOUTH, lefttop_cb);
general.setLayout(general_layout);
......@@ -233,21 +233,21 @@ public class Anchor extends Item implements ActionListener{
bounds_layout.putConstraint(SpringLayout.VERTICAL_CENTER, id_tf, 0, SpringLayout.VERTICAL_CENTER, x_l);
bounds_layout.putConstraint(SpringLayout.WEST, x_tf, tf_dx, SpringLayout.WEST, bounds);
bounds_layout.putConstraint(SpringLayout.NORTH, y_l, 10, SpringLayout.SOUTH, x_l);
bounds_layout.putConstraint(SpringLayout.NORTH, y_l, 10, SpringLayout.SOUTH, x_tf);
bounds_layout.putConstraint(SpringLayout.WEST, y_l, 5, SpringLayout.WEST, bounds);
bounds_layout.putConstraint(SpringLayout.VERTICAL_CENTER, y_tf, 0, SpringLayout.VERTICAL_CENTER, y_l);
bounds_layout.putConstraint(SpringLayout.WEST, y_tf, tf_dx, SpringLayout.WEST, bounds);
bounds_layout.putConstraint(SpringLayout.EAST, y_tf, 0, SpringLayout.EAST, x_tf);
bounds_layout.putConstraint(SpringLayout.NORTH, points_l, 10, SpringLayout.SOUTH, y_l);
bounds_layout.putConstraint(SpringLayout.NORTH, points_l, 10, SpringLayout.SOUTH, y_tf);
bounds_layout.putConstraint(SpringLayout.WEST, points_l, 5, SpringLayout.WEST, bounds);
bounds_layout.putConstraint(SpringLayout.VERTICAL_CENTER, points_tf, 0, SpringLayout.VERTICAL_CENTER, points_l);
bounds_layout.putConstraint(SpringLayout.WEST, points_tf, tf_dx, SpringLayout.WEST, bounds);
bounds_layout.putConstraint(SpringLayout.EAST, points_tf, 0, SpringLayout.EAST, x_tf);
bounds_layout.putConstraint(SpringLayout.NORTH, range_l, 10, SpringLayout.SOUTH, points_l);
bounds_layout.putConstraint(SpringLayout.NORTH, range_l, 10, SpringLayout.SOUTH, points_tf);
bounds_layout.putConstraint(SpringLayout.WEST, range_l, 5, SpringLayout.WEST, bounds);
bounds_layout.putConstraint(SpringLayout.VERTICAL_CENTER, range_tf, 0, SpringLayout.VERTICAL_CENTER, range_l);
......@@ -255,7 +255,7 @@ public class Anchor extends Item implements ActionListener{
bounds_layout.putConstraint(SpringLayout.EAST, range_tf, 0, SpringLayout.EAST, x_tf);
bounds_layout.putConstraint(SpringLayout.EAST, bounds, 5, SpringLayout.EAST, x_tf);
bounds_layout.putConstraint(SpringLayout.SOUTH, bounds, 10, SpringLayout.SOUTH, range_l);
bounds_layout.putConstraint(SpringLayout.SOUTH, bounds, 10, SpringLayout.SOUTH, range_tf);
bounds.setLayout(bounds_layout);
......
......@@ -148,7 +148,7 @@ public class Button extends Item implements ActionListener{
@Override
public void showOptions() {
if(frame==null) {
frame = new JFrame("Button settings");
frame = new JFrame(Language.get("WIN_BUTTON_TITLE"));
frame.setResizable(false);
frame.setLayout(new FlowLayout());
if(!created) frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
......@@ -163,137 +163,247 @@ public class Button extends Item implements ActionListener{
String[] align_values = {"lefttop", "leftbottom", "righttop", "rightbottom"};
JLabel lefttop_l = new JLabel(Language.get("WIN_ITEM_LEFTTOP"));
lefttop_cb = new JComboBox(align_values);
lefttop_cb.setToolTipText("Indicate to which corner of the Layout the top-left-hand corner of this item is attached, in case of resizing.");
lefttop_cb.setToolTipText(Language.get("WIN_ITEM_LEFTTOP_TIP"));
JLabel rightbottom_l = new JLabel(Language.get("WIN_ITEM_RIGHTBOTTOM"));
rightbottom_cb = new JComboBox(align_values);
rightbottom_cb.setToolTipText("Indicate to which corner of the Layout the bottom-right-hand corner of this item is attached, in case of resizing.");
rightbottom_cb.setToolTipText(Language.get("WIN_ITEM_RIGHTBOTTOM_TIP"));
Object[] bool_values = { true, false };
JLabel xkeepratio_l = new JLabel("Keep X Ratio:");
JLabel xkeepratio_l = new JLabel(Language.get("WIN_ITEM_XKEEPRATIO"));
xkeepratio_cb = new JComboBox(bool_values);
xkeepratio_cb.setToolTipText("When set to true, the behaviour of the horizontal resizing is changed. For example, if initially the space to the left of the control is twice as big as the one to its right, this will stay the same during any horizontal resizing. The width of the control stays constant.");
JLabel ykeepratio_l = new JLabel("Keep Y Ratio:");
xkeepratio_cb.setToolTipText(Language.get("WIN_ITEM_XKEEPRATIO_TIP"));
JLabel ykeepratio_l = new JLabel(Language.get("WIN_ITEM_YKEEPRATIO"));
ykeepratio_cb = new JComboBox(bool_values);
ykeepratio_cb.setToolTipText("When set to true, the behaviour of the vertical resizing is changed. For example, if initially the space to the top of the control is twice as big as the one to its bottom, this will stay the same during any vertical resizing. The height of the control stays constant.");
ykeepratio_cb.setToolTipText(Language.get("WIN_ITEM_YKEEPRATIO_TIP"));
JLabel visible_l = new JLabel(Language.get("WIN_ITEM_VISIBLE"));
visible_tf = new JTextField();
visible_btn = new JButton("",s.m.help_icon);
visible_btn.addActionListener(this);
JLabel help_l = new JLabel("Help Text:");
JLabel help_l = new JLabel(Language.get("WIN_ITEM_HELP"));
help_tf = new JTextField();
help_tf.setToolTipText("Help text for the current control. The variable '$H' will be expanded to this value when the mouse hovers the current control.");
help_tf.setToolTipText(Language.get("WIN_ITEM_HELP_TIP"));
JLabel up_l = new JLabel("Normal image*:");
JLabel up_l = new JLabel(Language.get("WIN_BUTTON_UP"));
up_tf = new JTextField();
JLabel over_l = new JLabel("Mouse-over image:");
JLabel over_l = new JLabel(Language.get("WIN_BUTTON_OVER"));
over_tf = new JTextField();
JLabel down_l = new JLabel("Mouse-click image:");
JLabel down_l = new JLabel(Language.get("WIN_BUTTON_DOWN"));
down_tf = new JTextField();
JLabel action_l = new JLabel("Action:");
JLabel action_l = new JLabel(Language.get("WIN_BUTTON_ACTION"));
action_tf = new JTextField();
action_btn = new JButton("",s.m.editor_icon);
action_btn.addActionListener(this);
JLabel tooltiptext_l = new JLabel("Tooltiptext:");
JLabel tooltiptext_l = new JLabel(Language.get("WIN_ITEM_TOOLTIPTEXT"));
tooltiptext_tf = new JTextField();
ok_btn = new JButton(Language.get("BUTTON_OK"));
ok_btn.addActionListener(this);
ok_btn.setPreferredSize(new Dimension(70,25));
cancel_btn = new JButton(Language.get("BUTTON_CANCEL"));
cancel_btn.addActionListener(this);
cancel_btn.setPreferredSize(new Dimension(70,25));
help_btn = new JButton(Language.get("BUTTON_HELP"));
help_btn.addActionListener(this);
help_btn.setPreferredSize(new Dimension(70,25));
JLabel star_l = new JLabel(Language.get("NOTE_STARRED"));
//Distance of textfields to WEST edge of container
Component[] labels = { id_l, x_l, y_l, lefttop_l, rightbottom_l, xkeepratio_l, ykeepratio_l, visible_l, help_l, up_l, over_l, down_l, action_l, tooltiptext_l};
int tf_dx = Helper.maxWidth(labels)+10;
//Max. textfield width
int tf_wd = 200;
JPanel general = new JPanel(null);
general.add(id_l);
general.add(id_tf);
id_l.setBounds(5,15,75,24);
id_tf.setBounds(85,15,150,24);
id_tf.setPreferredSize(new Dimension(tf_wd,id_tf.getPreferredSize().height));
general.add(x_l);
general.add(x_tf);
x_l.setBounds(5,45,75,24);
x_tf.setBounds(85,45,150,24);
general.add(y_l);
general.add(y_tf);
y_l.setBounds(5,75,75,24);
y_tf.setBounds(85,75,150,24);
general.add(y_tf);
general.add(lefttop_l);
general.add(lefttop_cb);
lefttop_l.setBounds(5,105,75,24);
lefttop_cb.setBounds(85,105,150,24);
general.add(rightbottom_l);
general.add(rightbottom_cb);
rightbottom_l.setBounds(5,135,75,24);
rightbottom_cb.setBounds(85,135,150,24);
general.add(xkeepratio_l);
general.add(xkeepratio_cb);
xkeepratio_l.setBounds(5,165,75,24);
xkeepratio_cb.setBounds(85,165,150,24);
general.add(ykeepratio_l);
general.add(ykeepratio_cb);
ykeepratio_l.setBounds(5,195,75,24);
ykeepratio_cb.setBounds(85,195,150,24);
general.add(visible_l);
general.add(visible_tf);
general.add(visible_btn);
visible_l.setBounds(5,225,75,24);
visible_tf.setBounds(85,225,120,24);
visible_btn.setBounds(210,225,24,24);
general.add(help_l);
general.add(help_tf);
help_l.setBounds(5,255,75,24);
help_tf.setBounds(85,255,150,24);
general.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), Language.get("WIN_ITEM_GENERAL")));
general.setMinimumSize(new Dimension(240,285));
general.setPreferredSize(new Dimension(240,285));
general.setMaximumSize(new Dimension(240,285));
SpringLayout general_layout = new SpringLayout();
general_layout.putConstraint(SpringLayout.NORTH, id_l, 5, SpringLayout.NORTH, general);
general_layout.putConstraint(SpringLayout.WEST, id_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, id_tf, 0, SpringLayout.VERTICAL_CENTER, id_l);
general_layout.putConstraint(SpringLayout.WEST, id_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.NORTH, x_l, 10, SpringLayout.SOUTH, id_tf);
general_layout.putConstraint(SpringLayout.WEST, x_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, x_tf, 0, SpringLayout.VERTICAL_CENTER, x_l);
general_layout.putConstraint(SpringLayout.WEST, x_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, x_tf, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.NORTH, y_l, 10, SpringLayout.SOUTH, x_tf);
general_layout.putConstraint(SpringLayout.WEST, y_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, y_tf, 0, SpringLayout.VERTICAL_CENTER, y_l);
general_layout.putConstraint(SpringLayout.WEST, y_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, y_tf, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.NORTH, lefttop_l, 10, SpringLayout.SOUTH, y_tf);
general_layout.putConstraint(SpringLayout.WEST, lefttop_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, lefttop_cb, 0, SpringLayout.VERTICAL_CENTER, lefttop_l);
general_layout.putConstraint(SpringLayout.WEST, lefttop_cb, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, lefttop_cb, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.NORTH, rightbottom_l, 10, SpringLayout.SOUTH, lefttop_cb);
general_layout.putConstraint(SpringLayout.WEST, rightbottom_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, rightbottom_cb, 0, SpringLayout.VERTICAL_CENTER, rightbottom_l);
general_layout.putConstraint(SpringLayout.WEST, rightbottom_cb, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, rightbottom_cb, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.NORTH, xkeepratio_l, 10, SpringLayout.SOUTH, rightbottom_cb);
general_layout.putConstraint(SpringLayout.WEST, xkeepratio_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, xkeepratio_cb, 0, SpringLayout.VERTICAL_CENTER, xkeepratio_l);
general_layout.putConstraint(SpringLayout.WEST, xkeepratio_cb, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, xkeepratio_cb, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.NORTH, ykeepratio_l, 10, SpringLayout.SOUTH, xkeepratio_cb);
general_layout.putConstraint(SpringLayout.WEST, ykeepratio_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, ykeepratio_cb, 0, SpringLayout.VERTICAL_CENTER, ykeepratio_l);
general_layout.putConstraint(SpringLayout.WEST, ykeepratio_cb, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, ykeepratio_cb, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.NORTH, visible_l, 10, SpringLayout.SOUTH, ykeepratio_cb);
general_layout.putConstraint(SpringLayout.WEST, visible_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, visible_tf, 0, SpringLayout.VERTICAL_CENTER, visible_l);
general_layout.putConstraint(SpringLayout.WEST, visible_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, visible_tf, -5, SpringLayout.WEST, visible_btn);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, visible_btn, 0, SpringLayout.VERTICAL_CENTER, visible_l);
general_layout.putConstraint(SpringLayout.EAST, visible_btn, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.NORTH, help_l, 10, SpringLayout.SOUTH, visible_btn);
general_layout.putConstraint(SpringLayout.WEST, help_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, help_tf, 0, SpringLayout.VERTICAL_CENTER, help_l);
general_layout.putConstraint(SpringLayout.WEST, help_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.EAST, help_tf, 0, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.EAST, general, 5, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.SOUTH, general, 10, SpringLayout.SOUTH, help_tf);
general.setLayout(general_layout);
frame.add(general);
JPanel button = new JPanel(null);
button.add(up_l);
button.add(up_tf);
up_l.setBounds(5,15,75,24);
up_tf.setBounds(85,15,150,24);
button.add(over_l);
button.add(over_tf);
over_l.setBounds(5,45,75,24);
over_tf.setBounds(85,45,150,24);
button.add(down_l);
button.add(down_tf);
down_l.setBounds(5,75,75,24);
down_tf.setBounds(85,75,150,24);
button.add(action_l);
button.add(action_tf);
button.add(action_btn);
action_l.setBounds(5,105,75,24);
action_tf.setBounds(85,105,120,24);
action_btn.setBounds(210,105,24,24);
button.add(tooltiptext_l);
button.add(tooltiptext_tf);
tooltiptext_l.setBounds(5,135,75,24);
tooltiptext_tf.setBounds(85,135,150,24);
button.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Button Attributes"));
button.setMinimumSize(new Dimension(240,165));
button.setPreferredSize(new Dimension(240,165));
button.setMaximumSize(new Dimension(240,165));
frame.add(button);
JPanel button_p = new JPanel(null);
button_p.add(up_l);
button_p.add(up_tf);
up_tf.setPreferredSize(new Dimension(tf_wd,up_tf.getPreferredSize().height));
button_p.add(over_l);
button_p.add(over_tf);
button_p.add(down_l);
button_p.add(down_tf);
button_p.add(action_l);
button_p.add(action_tf);
button_p.add(action_btn);
button_p.add(tooltiptext_l);
button_p.add(tooltiptext_tf);
button_p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), Language.get("WIN_BUTTON_ATTR")));
SpringLayout button_layout = new SpringLayout();
button_layout.putConstraint(SpringLayout.NORTH, up_l, 5, SpringLayout.NORTH, button_p);
button_layout.putConstraint(SpringLayout.WEST, up_l, 5, SpringLayout.WEST, button_p);
button_layout.putConstraint(SpringLayout.VERTICAL_CENTER, up_tf, 0, SpringLayout.VERTICAL_CENTER, up_l);
button_layout.putConstraint(SpringLayout.WEST, up_tf, tf_dx, SpringLayout.WEST, button_p);
button_layout.putConstraint(SpringLayout.NORTH, over_l, 10, SpringLayout.SOUTH, up_tf);
button_layout.putConstraint(SpringLayout.WEST, over_l, 5, SpringLayout.WEST, button_p);
button_layout.putConstraint(SpringLayout.VERTICAL_CENTER, over_tf, 0, SpringLayout.VERTICAL_CENTER, over_l);
button_layout.putConstraint(SpringLayout.WEST, over_tf, tf_dx, SpringLayout.WEST, button_p);
button_layout.putConstraint(SpringLayout.EAST, over_tf, 0, SpringLayout.EAST, up_tf);
button_layout.putConstraint(SpringLayout.NORTH, down_l, 10, SpringLayout.SOUTH, over_tf);
button_layout.putConstraint(SpringLayout.WEST, down_l, 5, SpringLayout.WEST, button_p);
button_layout.putConstraint(SpringLayout.VERTICAL_CENTER, down_tf, 0, SpringLayout.VERTICAL_CENTER, down_l);
button_layout.putConstraint(SpringLayout.WEST, down_tf, tf_dx, SpringLayout.WEST, button_p);
button_layout.putConstraint(SpringLayout.EAST, down_tf, 0, SpringLayout.EAST, up_tf);
button_layout.putConstraint(SpringLayout.NORTH, action_l, 10, SpringLayout.SOUTH, down_tf);
button_layout.putConstraint(SpringLayout.WEST, action_l, 5, SpringLayout.WEST, button_p);
button_layout.putConstraint(SpringLayout.VERTICAL_CENTER, action_tf, 0, SpringLayout.VERTICAL_CENTER, action_l);
button_layout.putConstraint(SpringLayout.WEST, action_tf, tf_dx, SpringLayout.WEST, button_p);
button_layout.putConstraint(SpringLayout.EAST, action_tf, -5, SpringLayout.WEST, action_btn);
button_layout.putConstraint(SpringLayout.VERTICAL_CENTER, action_btn, 0, SpringLayout.VERTICAL_CENTER, action_l);
button_layout.putConstraint(SpringLayout.EAST, action_btn, 0, SpringLayout.EAST, up_tf);
button_layout.putConstraint(SpringLayout.NORTH, tooltiptext_l, 10, SpringLayout.SOUTH, action_btn);
button_layout.putConstraint(SpringLayout.WEST, tooltiptext_l, 5, SpringLayout.WEST, button_p);
button_layout.putConstraint(SpringLayout.VERTICAL_CENTER, tooltiptext_tf, 0, SpringLayout.VERTICAL_CENTER, tooltiptext_l);
button_layout.putConstraint(SpringLayout.WEST, tooltiptext_tf, tf_dx, SpringLayout.WEST, button_p);
button_layout.putConstraint(SpringLayout.EAST, tooltiptext_tf, 0, SpringLayout.EAST, up_tf);
button_layout.putConstraint(SpringLayout.EAST, button_p, 5, SpringLayout.EAST, up_tf);
button_layout.putConstraint(SpringLayout.SOUTH, button_p, 10, SpringLayout.SOUTH, tooltiptext_tf);
button_p.setLayout(button_layout);
frame.add(button_p);
frame.add(ok_btn);
frame.add(cancel_btn);
frame.add(help_btn);
frame.add(new JLabel(Language.get("NOTE_STARRED")));
frame.add(star_l);
SpringLayout layout = new SpringLayout();
layout.putConstraint(SpringLayout.NORTH, general, 5, SpringLayout.NORTH, frame.getContentPane());
layout.putConstraint(SpringLayout.WEST, general, 5, SpringLayout.WEST, frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, button_p, 10, SpringLayout.SOUTH, general);
layout.putConstraint(SpringLayout.WEST, button_p, 5, SpringLayout.WEST, frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, star_l, 10, SpringLayout.SOUTH, button_p);
layout.putConstraint(SpringLayout.WEST, star_l, 5, SpringLayout.WEST, frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, ok_btn, 10, SpringLayout.SOUTH, star_l);
layout.putConstraint(SpringLayout.WEST, ok_btn, 5, SpringLayout.WEST, frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, cancel_btn, 0, SpringLayout.NORTH, ok_btn);
layout.putConstraint(SpringLayout.WEST, cancel_btn, 5, SpringLayout.EAST, ok_btn);
layout.putConstraint(SpringLayout.NORTH, help_btn, 0, SpringLayout.NORTH, cancel_btn);
layout.putConstraint(SpringLayout.WEST, help_btn, 5, SpringLayout.EAST, cancel_btn);
layout.putConstraint(SpringLayout.SOUTH, frame.getContentPane(), 10, SpringLayout.SOUTH, ok_btn);
layout.putConstraint(SpringLayout.EAST, frame.getContentPane(), 5, SpringLayout.EAST, general);
frame.setMinimumSize(new Dimension(250,520));
frame.setPreferredSize(new Dimension(250,520));
frame.setMaximumSize(new Dimension(250,520));
frame.setLayout(layout);
frame.pack();
frame.getRootPane().setDefaultButton(ok_btn);
}
id_tf.setText(id);
up_tf.setText(id);
x_tf.setText(String.valueOf(x));
y_tf.setText(String.valueOf(y));
lefttop_cb.setSelectedItem(lefttop);
......@@ -314,31 +424,31 @@ public class Button extends Item implements ActionListener{
@Override
public void actionPerformed(ActionEvent e) {
if(e.getSource().equals(ok_btn)) {
if(id_tf.getText().equals("")) {
if(up_tf.getText().equals("")) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_INVALID_MSG"),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
else if(!id_tf.getText().equals(id)) {
if(s.idExists(id_tf.getText())) {
JOptionPane.showMessageDialog(frame,"The ID \""+id_tf.getText()+"\" already exists, please choose another one.",Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
else if(!up_tf.getText().equals(id)) {
if(s.idExists(up_tf.getText())) {
JOptionPane.showMessageDialog(frame,Language.get("ERROR_ID_EXISTS_MSG").replaceAll("%i", up_tf.getText()),Language.get("ERROR_ID_INVALID_TITLE"),JOptionPane.INFORMATION_MESSAGE);
return;
}
}
up_res = s.getImageResource(up_tf.getText());
if(up_res==null) {
JOptionPane.showMessageDialog(frame,"The bitmap \""+up_tf.getText()+"\" does not exist!","Image not valid",JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(frame,Language.get("ERROR_BITMAP_NEXIST").replaceAll("%i", up_tf.getText()),Language.get("ERROR_BITMAP_NEXIST_TITLE"),JOptionPane.INFORMATION_MESSAGE);
up_res = s.getImageResource(up);
return;
}
over_res = s.getImageResource(over_tf.getText());
if(!over_tf.getText().equals("none") && over_res==null) {
JOptionPane.showMessageDialog(frame,"The bitmap \""+over_tf.getText()+"\" does not exist!","Image not valid",JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(frame,Language.get("ERROR_BITMAP_NEXIST").replaceAll("%i", over_tf.getText()),Language.get("ERROR_BITMAP_NEXIST_TITLE"),JOptionPane.INFORMATION_MESSAGE);
over_res = s.getImageResource(over);
return;
}
down_res = s.getImageResource(down_tf.getText());
if(!down_tf.getText().equals("none") && down_res==null) {
JOptionPane.showMessageDialog(frame,"The bitmap \""+down_tf.getText()+"\" does not exist!","Image not valid",JOptionPane.INFORMATION_MESSAGE);
JOptionPane.showMessageDialog(frame,Language.get("ERROR_BITMAP_NEXIST").replaceAll("%i", down_tf.getText()),Language.get("ERROR_BITMAP_NEXIST_TITLE"),JOptionPane.INFORMATION_MESSAGE);
down_res = s.getImageResource(down);
return;
}
......
......@@ -212,19 +212,19 @@ public class Checkbox extends Item implements ActionListener{
rightbottom_cb = new JComboBox(align_values);
rightbottom_cb.setToolTipText("Indicate to which corner of the Layout the bottom-right-hand corner of this item is attached, in case of resizing.");
Object[] bool_values = { true, false };
JLabel xkeepratio_l = new JLabel("Keep X Ratio:");
JLabel xkeepratio_l = new JLabel(Language.get("WIN_ITEM_XKEEPRATIO"));
xkeepratio_cb = new JComboBox(bool_values);
xkeepratio_cb.setToolTipText("When set to true, the behaviour of the horizontal resizing is changed. For example, if initially the space to the left of the control is twice as big as the one to its right, this will stay the same during any horizontal resizing. The width of the control stays constant.");
JLabel ykeepratio_l = new JLabel("Keep Y Ratio:");
xkeepratio_cb.setToolTipText(Language.get("WIN_ITEM_XKEEPRATIO_TIP"));
JLabel ykeepratio_l = new JLabel(Language.get("WIN_ITEM_YKEEPRATIO"));
ykeepratio_cb = new JComboBox(bool_values);
ykeepratio_cb.setToolTipText("When set to true, the behaviour of the vertical resizing is changed. For example, if initially the space to the top of the control is twice as big as the one to its bottom, this will stay the same during any vertical resizing. The height of the control stays constant.");
ykeepratio_cb.setToolTipText(Language.get("WIN_ITEM_YKEEPRATIO_TIP"));
JLabel visible_l = new JLabel(Language.get("WIN_ITEM_VISIBLE"));
visible_tf = new JTextField();
visible_btn = new JButton("",s.m.help_icon);
visible_btn.addActionListener(this);
JLabel help_l = new JLabel("Help Text:");
JLabel help_l = new JLabel(Language.get("WIN_ITEM_HELP"));
help_tf = new JTextField();
help_tf.setToolTipText("Help text for the current control. The variable '$H' will be expanded to this value when the mouse hovers the current control.");
help_tf.setToolTipText(Language.get("WIN_ITEM_HELP_TIP"));
JLabel up1_l = new JLabel("Normal image*:");
up1_tf = new JTextField();
......@@ -236,7 +236,7 @@ public class Checkbox extends Item implements ActionListener{
action1_tf = new JTextField();
action1_btn = new JButton("",s.m.editor_icon);
action1_btn.addActionListener(this);
JLabel tooltiptext1_l = new JLabel("Tooltiptext:");
JLabel tooltiptext1_l = new JLabel(Language.get("WIN_ITEM_TOOLTIPTEXT"));
tooltiptext1_tf = new JTextField();
JLabel up2_l = new JLabel("Normal image*:");
up2_tf = new JTextFi