Commit 671575bf authored by Daniel Dreibrodt's avatar Daniel Dreibrodt

New Layouts for Theme/Text/Video editing dialogues

parent c6ebd618
......@@ -588,4 +588,5 @@ WIN_TEXT_ATTR|Text Attribute
#Video
WIN_VIDEO_TITLE|Video Einstellungen
WIN_VIDEO_AUTORESIZE|Größe anpassen:
WIN_VIDEO_AUTORESIZE_TIP|Gibt an ob das Fenster der Videogröße entsprechend angepasst wird.
\ No newline at end of file
WIN_VIDEO_AUTORESIZE_TIP|Gibt an ob das Fenster der Videogröße entsprechend angepasst wird.
WIN_VIDEO_ATTR|Video Attribute
\ No newline at end of file
......@@ -588,4 +588,5 @@ WIN_TEXT_ATTR|Text attributes
#Video
WIN_VIDEO_TITLE|Video settings
WIN_VIDEO_AUTORESIZE|Autoresize:
WIN_VIDEO_AUTORESIZE_TIP|Indicate whether the layout should be automatically resized to fit the dimensions of the played video.
\ No newline at end of file
WIN_VIDEO_AUTORESIZE_TIP|Indicate whether the layout should be automatically resized to fit the dimensions of the played video.
WIN_VIDEO_ATTR|Video attributes
\ No newline at end of file
......@@ -22,6 +22,7 @@
package vlcskineditor;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
......@@ -40,6 +41,7 @@ import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JTree;
import javax.swing.SpringLayout;
import javax.swing.border.EtchedBorder;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.TreePath;
......@@ -398,57 +400,121 @@ public class Skin implements ActionListener{
theme_help_btn = new JButton(Language.get("BUTTON_HELP"));
theme_help_btn.addActionListener(this);
//TODO new layout!!!
//Distance of textfields to WEST edge of container
Component[] labels = { themeinfo_name_l, themeinfo_author_l, themeinfo_email_l, themeinfo_webpage_l, theme_magnet_l, theme_alpha_l, theme_movealpha_l};
int tf_dx = Helper.maxWidth(labels)+10;
//Max. textfield width
int tf_wd = Main.TEXTFIELD_WIDTH;
JPanel themeinfo_p = new JPanel(null);
themeinfo_p.add(themeinfo_name_l);
themeinfo_p.add(themeinfo_name_tf);
themeinfo_name_l.setBounds(5,15,150,24);
themeinfo_name_tf.setBounds(160,15,150,24);
themeinfo_p.add(themeinfo_author_l);
themeinfo_p.add(themeinfo_author_tf);
themeinfo_author_l.setBounds(5,45,150,24);
themeinfo_author_tf.setBounds(160,45,150,24);
themeinfo_p.add(themeinfo_email_l);
themeinfo_p.add(themeinfo_email_tf);
themeinfo_email_l.setBounds(5,75,150,24);
themeinfo_email_tf.setBounds(160,75,150,24);
themeinfo_p.add(themeinfo_webpage_l);
themeinfo_p.add(themeinfo_webpage_tf);
themeinfo_webpage_l.setBounds(5,105,150,24);
themeinfo_webpage_tf.setBounds(160,105,150,24);
themeinfo_p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), Language.get("WIN_THEME_INFO_TITLE")));
themeinfo_p.setMinimumSize(new Dimension(315,135));
themeinfo_p.setMaximumSize(new Dimension(315,135));
themeinfo_p.setPreferredSize(new Dimension(315,135));
theme_frame.add(themeinfo_p);
JPanel themeinfo_panel = new JPanel(null);
themeinfo_panel.add(themeinfo_name_l);
themeinfo_panel.add(themeinfo_name_tf);
themeinfo_name_tf.setPreferredSize(new Dimension(tf_wd, themeinfo_name_tf.getPreferredSize().height));
themeinfo_panel.add(themeinfo_author_l);
themeinfo_panel.add(themeinfo_author_tf);
themeinfo_panel.add(themeinfo_email_l);
themeinfo_panel.add(themeinfo_email_tf);
themeinfo_panel.add(themeinfo_webpage_l);
themeinfo_panel.add(themeinfo_webpage_tf);
themeinfo_panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), Language.get("WIN_THEME_INFO_TITLE")));
SpringLayout themeinfo_layout = new SpringLayout();
themeinfo_panel.setLayout(themeinfo_layout);
themeinfo_layout.putConstraint(SpringLayout.NORTH, themeinfo_name_l, 5, SpringLayout.NORTH, themeinfo_panel);
themeinfo_layout.putConstraint(SpringLayout.WEST, themeinfo_name_l, 5, SpringLayout.WEST, themeinfo_panel);
themeinfo_layout.putConstraint(SpringLayout.VERTICAL_CENTER, themeinfo_name_tf, 0, SpringLayout.VERTICAL_CENTER, themeinfo_name_l);
themeinfo_layout.putConstraint(SpringLayout.WEST, themeinfo_name_tf, tf_dx, SpringLayout.WEST, themeinfo_panel);
themeinfo_layout.putConstraint(SpringLayout.NORTH, themeinfo_author_l, 10, SpringLayout.SOUTH, themeinfo_name_tf);
themeinfo_layout.putConstraint(SpringLayout.WEST, themeinfo_author_l, 5, SpringLayout.WEST, themeinfo_panel);
themeinfo_layout.putConstraint(SpringLayout.VERTICAL_CENTER, themeinfo_author_tf, 0, SpringLayout.VERTICAL_CENTER, themeinfo_author_l);
themeinfo_layout.putConstraint(SpringLayout.WEST, themeinfo_author_tf, tf_dx, SpringLayout.WEST, themeinfo_panel);
themeinfo_layout.putConstraint(SpringLayout.EAST, themeinfo_author_tf, 0, SpringLayout.EAST, themeinfo_name_tf);
themeinfo_layout.putConstraint(SpringLayout.NORTH, themeinfo_email_l, 10, SpringLayout.SOUTH, themeinfo_author_tf);
themeinfo_layout.putConstraint(SpringLayout.WEST, themeinfo_email_l, 5, SpringLayout.WEST, themeinfo_panel);
themeinfo_layout.putConstraint(SpringLayout.VERTICAL_CENTER, themeinfo_email_tf, 0, SpringLayout.VERTICAL_CENTER, themeinfo_email_l);
themeinfo_layout.putConstraint(SpringLayout.WEST, themeinfo_email_tf, tf_dx, SpringLayout.WEST, themeinfo_panel);
themeinfo_layout.putConstraint(SpringLayout.EAST, themeinfo_email_tf, 0, SpringLayout.EAST, themeinfo_name_tf);
themeinfo_layout.putConstraint(SpringLayout.NORTH, themeinfo_webpage_l, 10, SpringLayout.SOUTH, themeinfo_email_tf);
themeinfo_layout.putConstraint(SpringLayout.WEST, themeinfo_webpage_l, 5, SpringLayout.WEST, themeinfo_panel);
themeinfo_layout.putConstraint(SpringLayout.VERTICAL_CENTER, themeinfo_webpage_tf, 0, SpringLayout.VERTICAL_CENTER, themeinfo_webpage_l);
themeinfo_layout.putConstraint(SpringLayout.WEST, themeinfo_webpage_tf, tf_dx, SpringLayout.WEST, themeinfo_panel);
themeinfo_layout.putConstraint(SpringLayout.EAST, themeinfo_webpage_tf, 0, SpringLayout.EAST, themeinfo_name_tf);
themeinfo_layout.putConstraint(SpringLayout.EAST, themeinfo_panel, 5, SpringLayout.EAST, themeinfo_name_tf);
themeinfo_layout.putConstraint(SpringLayout.SOUTH, themeinfo_panel, 10, SpringLayout.SOUTH, themeinfo_webpage_tf);
theme_frame.add(themeinfo_panel);
JPanel theme_p = new JPanel(null);
theme_p.add(theme_magnet_l);
theme_p.add(theme_magnet_tf);
theme_magnet_l.setBounds(5,15,150,24);
theme_magnet_tf.setBounds(160,15,150,24);
theme_p.add(theme_alpha_l);
theme_p.add(theme_alpha_tf);
theme_alpha_l.setBounds(5,45,150,24);
theme_alpha_tf.setBounds(160,45,150,24);
theme_p.add(theme_movealpha_l);
theme_p.add(theme_movealpha_tf);
theme_movealpha_l.setBounds(5,75,150,24);
theme_movealpha_tf.setBounds(160,75,150,24);
theme_p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), Language.get("WIN_THEME_ATTR_TITLE")));
theme_p.setMinimumSize(new Dimension(315,105));
theme_p.setMaximumSize(new Dimension(315,105));
theme_p.setPreferredSize(new Dimension(315,105));
JPanel theme_panel = new JPanel(null);
theme_panel.add(theme_magnet_l);
theme_panel.add(theme_magnet_tf);
theme_magnet_tf.setPreferredSize(new Dimension(tf_wd, theme_magnet_tf.getPreferredSize().height));
theme_panel.add(theme_alpha_l);
theme_panel.add(theme_alpha_tf);
theme_panel.add(theme_movealpha_l);
theme_panel.add(theme_movealpha_tf);
theme_panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), Language.get("WIN_THEME_ATTR_TITLE")));
SpringLayout theme_layout = new SpringLayout();
theme_panel.setLayout(theme_layout);
theme_layout.putConstraint(SpringLayout.NORTH, theme_magnet_l, 5, SpringLayout.NORTH, theme_panel);
theme_layout.putConstraint(SpringLayout.WEST, theme_magnet_l, 5, SpringLayout.WEST, theme_panel);
theme_layout.putConstraint(SpringLayout.VERTICAL_CENTER, theme_magnet_tf, 0, SpringLayout.VERTICAL_CENTER, theme_magnet_l);
theme_layout.putConstraint(SpringLayout.WEST, theme_magnet_tf, tf_dx, SpringLayout.WEST, theme_panel);
theme_layout.putConstraint(SpringLayout.NORTH, theme_alpha_l, 10, SpringLayout.SOUTH, theme_magnet_tf);
theme_layout.putConstraint(SpringLayout.WEST, theme_alpha_l, 5, SpringLayout.WEST, theme_panel);
theme_layout.putConstraint(SpringLayout.VERTICAL_CENTER, theme_alpha_tf, 0, SpringLayout.VERTICAL_CENTER, theme_alpha_l);
theme_layout.putConstraint(SpringLayout.WEST, theme_alpha_tf, tf_dx, SpringLayout.WEST, theme_panel);
theme_layout.putConstraint(SpringLayout.EAST, theme_alpha_tf, 0, SpringLayout.EAST, theme_magnet_tf);
theme_layout.putConstraint(SpringLayout.NORTH, theme_movealpha_l, 10, SpringLayout.SOUTH, theme_alpha_tf);
theme_layout.putConstraint(SpringLayout.WEST, theme_movealpha_l, 5, SpringLayout.WEST, theme_panel);
theme_layout.putConstraint(SpringLayout.VERTICAL_CENTER, theme_movealpha_tf, 0, SpringLayout.VERTICAL_CENTER, theme_movealpha_l);
theme_layout.putConstraint(SpringLayout.WEST, theme_movealpha_tf, tf_dx, SpringLayout.WEST, theme_panel);
theme_layout.putConstraint(SpringLayout.EAST, theme_movealpha_tf, 0, SpringLayout.EAST, theme_magnet_tf);
theme_layout.putConstraint(SpringLayout.EAST, theme_panel, 5, SpringLayout.EAST, theme_magnet_tf);
theme_layout.putConstraint(SpringLayout.SOUTH, theme_panel, 10, SpringLayout.SOUTH, theme_movealpha_tf);
theme_frame.add(theme_p);
theme_frame.add(theme_panel);
theme_frame.add(theme_ok_btn);
theme_frame.add(theme_cancel_btn);
theme_frame.add(theme_help_btn);
theme_frame.setMinimumSize(new Dimension(325,330));
theme_frame.setPreferredSize(new Dimension(325,330));
theme_frame.setMaximumSize(new Dimension(325,330));
SpringLayout layout = new SpringLayout();
layout.putConstraint(SpringLayout.NORTH, themeinfo_panel, 5, SpringLayout.NORTH, theme_frame.getContentPane());
layout.putConstraint(SpringLayout.WEST, themeinfo_panel, 5, SpringLayout.WEST, theme_frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, theme_panel, 10, SpringLayout.SOUTH, themeinfo_panel);
layout.putConstraint(SpringLayout.WEST, theme_panel, 5, SpringLayout.WEST, theme_frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, theme_ok_btn, 10, SpringLayout.SOUTH, theme_panel);
layout.putConstraint(SpringLayout.WEST, theme_ok_btn, 5, SpringLayout.WEST, theme_frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, theme_cancel_btn, 0, SpringLayout.NORTH, theme_ok_btn);
layout.putConstraint(SpringLayout.WEST, theme_cancel_btn, 5, SpringLayout.EAST, theme_ok_btn);
layout.putConstraint(SpringLayout.NORTH, theme_help_btn, 0, SpringLayout.NORTH, theme_cancel_btn);
layout.putConstraint(SpringLayout.WEST, theme_help_btn, 5, SpringLayout.EAST, theme_cancel_btn);
layout.putConstraint(SpringLayout.SOUTH, theme_frame.getContentPane(), 10, SpringLayout.SOUTH, theme_ok_btn);
layout.putConstraint(SpringLayout.EAST, theme_frame.getContentPane(), 5, SpringLayout.EAST, themeinfo_panel);
theme_frame.setLayout(layout);
theme_frame.pack();
}
......
......@@ -177,7 +177,6 @@ public class Text extends Item implements ActionListener{
frame = new JFrame(Language.get("WIN_TEXT_TITLE"));
frame.setIconImage(Main.edit_icon.getImage());
frame.setResizable(false);
frame.setLayout(new FlowLayout());
if(!created) frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
JLabel id_l = new JLabel(Language.get("WIN_ITEM_ID"));
id_tf = new JTextField();
......@@ -234,83 +233,177 @@ public class Text extends Item implements ActionListener{
cancel_btn.addActionListener(this);
help_btn = new JButton(Language.get("BUTTON_HELP"));
help_btn.addActionListener(this);
//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, text_l, font_l, color_l, width_l, alignment_l, scrolling_l};
int tf_dx = Helper.maxWidth(labels)+10;
//Max. textfield width
int tf_wd = Main.TEXTFIELD_WIDTH;
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.setLayout(general_layout);
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);
frame.add(general);
JPanel txt = new JPanel(null);
txt.add(text_l);
txt.add(text_tf);
text_l.setBounds(5,15,75,24);
text_tf.setBounds(85,15,150,24);
text_tf.setPreferredSize(new Dimension(tf_wd, text_tf.getPreferredSize().height));
txt.add(font_l);
txt.add(font_tf);
font_l.setBounds(5,45,75,24);
font_tf.setBounds(85,45,150,24);
txt.add(color_l);
txt.add(color_tf);
color_tf.setPreferredSize(new Dimension(tf_wd/2,color_tf.getPreferredSize().height));
txt.add(color_btn);
color_l.setBounds(5,75,75,24);
color_tf.setBounds(85,75,50,24);
color_btn.setBounds(140,75,95,24);
txt.add(width_l);
txt.add(width_tf);
width_l.setBounds(5,105,75,24);
width_tf.setBounds(85,105,150,24);
txt.add(alignment_l);
txt.add(alignment_cb);
alignment_l.setBounds(5,135,75,24);
alignment_cb.setBounds(85,135,150,24);
txt.add(scrolling_l);
txt.add(scrolling_cb);
scrolling_l.setBounds(5,165,75,24);
scrolling_cb.setBounds(85,165,150,24);
txt.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), Language.get("WIN_TEXT_ATTR")));
txt.setMinimumSize(new Dimension(240,195));
txt.setPreferredSize(new Dimension(240,195));
txt.setMaximumSize(new Dimension(240,195));
SpringLayout txt_layout = new SpringLayout();
txt.setLayout(txt_layout);
txt_layout.putConstraint(SpringLayout.NORTH, text_l, 5, SpringLayout.NORTH, txt);
txt_layout.putConstraint(SpringLayout.WEST, text_l, 5, SpringLayout.WEST, txt);
txt_layout.putConstraint(SpringLayout.VERTICAL_CENTER, text_tf, 0, SpringLayout.VERTICAL_CENTER, text_l);
txt_layout.putConstraint(SpringLayout.WEST, text_tf, tf_dx, SpringLayout.WEST, txt);
txt_layout.putConstraint(SpringLayout.NORTH, font_l, 10, SpringLayout.SOUTH, text_tf);
txt_layout.putConstraint(SpringLayout.WEST, font_l, 5, SpringLayout.WEST, txt);
txt_layout.putConstraint(SpringLayout.VERTICAL_CENTER, font_tf, 0, SpringLayout.VERTICAL_CENTER, font_l);
txt_layout.putConstraint(SpringLayout.WEST, font_tf, tf_dx, SpringLayout.WEST, txt);
txt_layout.putConstraint(SpringLayout.EAST, font_tf, 0, SpringLayout.EAST, text_tf);
txt_layout.putConstraint(SpringLayout.NORTH, color_l, 10, SpringLayout.SOUTH, font_tf);
txt_layout.putConstraint(SpringLayout.WEST, color_l, 5, SpringLayout.WEST, txt);
txt_layout.putConstraint(SpringLayout.VERTICAL_CENTER, color_tf, 0, SpringLayout.VERTICAL_CENTER, color_l);
txt_layout.putConstraint(SpringLayout.WEST, color_tf, tf_dx, SpringLayout.WEST, txt);
txt_layout.putConstraint(SpringLayout.VERTICAL_CENTER, color_btn, 0, SpringLayout.VERTICAL_CENTER, color_l);
txt_layout.putConstraint(SpringLayout.WEST, color_btn, 5, SpringLayout.EAST, color_tf);
txt_layout.putConstraint(SpringLayout.EAST, color_btn, 0, SpringLayout.EAST,text_tf);
txt_layout.putConstraint(SpringLayout.NORTH, width_l, 10, SpringLayout.SOUTH, color_btn);
txt_layout.putConstraint(SpringLayout.WEST, width_l, 5, SpringLayout.WEST, txt);
txt_layout.putConstraint(SpringLayout.VERTICAL_CENTER, width_tf, 0, SpringLayout.VERTICAL_CENTER, width_l);
txt_layout.putConstraint(SpringLayout.WEST, width_tf, tf_dx, SpringLayout.WEST, txt);
txt_layout.putConstraint(SpringLayout.EAST, width_tf, 0, SpringLayout.EAST, text_tf);
txt_layout.putConstraint(SpringLayout.NORTH, alignment_l, 10, SpringLayout.SOUTH, width_tf);
txt_layout.putConstraint(SpringLayout.WEST, alignment_l, 5, SpringLayout.WEST, txt);
txt_layout.putConstraint(SpringLayout.VERTICAL_CENTER, alignment_cb, 0, SpringLayout.VERTICAL_CENTER, alignment_l);
txt_layout.putConstraint(SpringLayout.WEST, alignment_cb, tf_dx, SpringLayout.WEST, txt);
txt_layout.putConstraint(SpringLayout.EAST, alignment_cb, 0, SpringLayout.EAST, text_tf);
txt_layout.putConstraint(SpringLayout.NORTH, scrolling_l, 10, SpringLayout.SOUTH, alignment_cb);
txt_layout.putConstraint(SpringLayout.WEST, scrolling_l, 5, SpringLayout.WEST, txt);
txt_layout.putConstraint(SpringLayout.VERTICAL_CENTER, scrolling_cb, 0, SpringLayout.VERTICAL_CENTER, scrolling_l);
txt_layout.putConstraint(SpringLayout.WEST, scrolling_cb, tf_dx, SpringLayout.WEST, txt);
txt_layout.putConstraint(SpringLayout.EAST, scrolling_cb, 0, SpringLayout.EAST, text_tf);
txt_layout.putConstraint(SpringLayout.EAST, txt, 5, SpringLayout.EAST, text_tf);
txt_layout.putConstraint(SpringLayout.SOUTH, txt, 10, SpringLayout.SOUTH, scrolling_cb);
frame.add(txt);
frame.add(ok_btn);
......@@ -318,9 +411,30 @@ public class Text extends Item implements ActionListener{
frame.add(help_btn);
frame.add(attr_l);
frame.setMinimumSize(new Dimension(250,550));
frame.setPreferredSize(new Dimension(250,550));
frame.setMaximumSize(new Dimension(250,550));
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, txt, 10, SpringLayout.SOUTH, general);
layout.putConstraint(SpringLayout.WEST, txt, 5, SpringLayout.WEST, frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, attr_l, 10, SpringLayout.SOUTH, txt);
layout.putConstraint(SpringLayout.WEST, attr_l, 5, SpringLayout.WEST, frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, ok_btn, 10, SpringLayout.SOUTH, attr_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.setLayout(layout);
frame.pack();
......
......@@ -159,7 +159,6 @@ public class Video extends Item implements ActionListener{
frame = new JFrame(Language.get("WIN_VIDEO_TITLE"));
frame.setIconImage(Main.edit_icon.getImage());
frame.setResizable(false);
frame.setLayout(new FlowLayout());
if(!created) frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
JLabel id_l = new JLabel(Language.get("WIN_ITEM_ID"));
id_tf = new JTextField();
......@@ -208,79 +207,176 @@ public class Video extends Item implements ActionListener{
cancel_btn.addActionListener(this);
help_btn = new JButton(Language.get("BUTTON_HELP"));
help_btn.addActionListener(this);
//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, width_l, height_l, autoresize_l};
int tf_dx = Helper.maxWidth(labels)+10;
//Max. textfield width
int tf_wd = Main.TEXTFIELD_WIDTH;
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.setLayout(general_layout);
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);
frame.add(general);
JPanel video = new JPanel(null);
video.add(width_l);
video.add(width_tf);
width_l.setBounds(5,15,75,24);
width_tf.setBounds(85,15,150,24);
video.add(height_l);
video.add(height_tf);
height_l.setBounds(5,45,75,24);
height_tf.setBounds(85,45,150,24);
video.add(autoresize_l);
video.add(autoresize_cb);
autoresize_l.setBounds(5,75,75,24);
autoresize_cb.setBounds(85,75,150,24);
video.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Video Attributes"));
video.setMinimumSize(new Dimension(240,105));
video.setPreferredSize(new Dimension(240,105));
video.setMaximumSize(new Dimension(240,105));
frame.add(video);
JPanel video_panel = new JPanel(null);
video_panel.add(width_l);
video_panel.add(width_tf);
width_tf.setPreferredSize(new Dimension(tf_wd, width_tf.getPreferredSize().height));
video_panel.add(height_l);
video_panel.add(height_tf);
video_panel.add(autoresize_l);
video_panel.add(autoresize_cb);
video_panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), Language.get("WIN_VIDEO_ATTR")));
SpringLayout video_layout = new SpringLayout();
video_panel.setLayout(video_layout);
video_layout.putConstraint(SpringLayout.NORTH, width_l, 5, SpringLayout.NORTH, video_panel);
video_layout.putConstraint(SpringLayout.WEST, width_l, 5, SpringLayout.WEST, video_panel);
video_layout.putConstraint(SpringLayout.VERTICAL_CENTER, width_tf, 0, SpringLayout.VERTICAL_CENTER, width_l);
video_layout.putConstraint(SpringLayout.WEST, width_tf, tf_dx, SpringLayout.WEST, video_panel);
video_layout.putConstraint(SpringLayout.NORTH, height_l, 10, SpringLayout.SOUTH, width_tf);
video_layout.putConstraint(SpringLayout.WEST, height_l, 5, SpringLayout.WEST, video_panel);
video_layout.putConstraint(SpringLayout.VERTICAL_CENTER, height_tf, 0, SpringLayout.VERTICAL_CENTER, height_l);
video_layout.putConstraint(SpringLayout.WEST, height_tf, tf_dx, SpringLayout.WEST, video_panel);
video_layout.putConstraint(SpringLayout.EAST, height_tf, 0, SpringLayout.EAST, width_tf);
video_layout.putConstraint(SpringLayout.NORTH, autoresize_l, 10, SpringLayout.SOUTH, height_tf);
video_layout.putConstraint(SpringLayout.WEST, autoresize_l, 5, SpringLayout.WEST, video_panel);
video_layout.putConstraint(SpringLayout.VERTICAL_CENTER, autoresize_cb, 0, SpringLayout.VERTICAL_CENTER, autoresize_l);
video_layout.putConstraint(SpringLayout.WEST, autoresize_cb, tf_dx, SpringLayout.WEST, video_panel);
video_layout.putConstraint(SpringLayout.EAST, autoresize_cb, 0, SpringLayout.EAST, width_tf);
video_layout.putConstraint(SpringLayout.EAST, video_panel, 5, SpringLayout.EAST, width_tf);
video_layout.putConstraint(SpringLayout.SOUTH, video_panel, 10, SpringLayout.SOUTH, autoresize_cb);
frame.add(video_panel);
frame.add(ok_btn);
frame.add(cancel_btn);
frame.add(help_btn);
frame.add(attr_l);