Commit 4195283a authored by Daniel Dreibrodt's avatar Daniel Dreibrodt

-New SpringLayout for Resources, Window & Layout editing dialogs finished and perfected

-README.TXT : updated changelog in
parent 87862b8a
VLC Skin Editor release 0.7.0b
VLC Skin Editor release 0.7.0
-----------------------------------------------------------
Changelog:
-----------------------------------------------------------
0.7.0b - Preview can be saved as image
0.7.0 - Preview can be saved as image
- Improved SubBitmap editing
- Resources/windows/layouts can be duplicated easily
- XML output is now indented
- Slider backgrounds can be generated in a wizard
- Improved preview of skin (can be zoomed now)
- Improved cross platform behaviour
- Improved online help
- Some (critical) bugs were fixed
0.6.1b - Critical bufix for the Preview Window
- Bugfix for slider points parsing and XML parsing
0.6.0b - Resources/windows/layouts/items can be edited by
doubleclicking on them in the hiearchy trees
- Sliders are rendered completely as in VLC
......@@ -20,39 +25,50 @@ Changelog:
- Many bugfixes
- Many actions can be undone/redone
- SubBitmaps can be edited visually
0.5.0a - Boolean variables are interpreted in the preview
- Global variables can be edited (boolean only atm)
- Preview window perfomance improvements
- Adding of an action editor
- Some bugfixes
- New icons
0.4.5a - Several bugfixes
- Text variables are interpreted in the preview
0.4.0a - Items can be positioned with the mouse
- Trees don't collapse anymore completely when an
element in it is updated, they automatically
expand the path to the updated item and select it
0.3.5b - NullPointerException fix for Playtree rendering
- VLT files can be imported
0.3.5a - Preview of Layouts
- XML parsing/generating fixes
0.3.0b - All items can be edited
- Theme attributes can be edited
- VLT packages can be exported
- The open/save dialog will point by default to the
VLC Skins directory on Windows and Linux
0.3.0a - Items can be added
- Items can be deleted
- All items except SliderBGs, Playlists, Playtrees
can be edited
0.2.8a - Improved trees
- Groups, Panels and Images can be edited
- Several PNG files can be added at once
- Confirmation of exiting if skin is unsafed
0.2.5a - Windows and Layouts can be edited
- Bitmaps, SubBitmaps and Fonts can be added
0.2.0a - Now files can be saved
- Font, Bitmap and SubBitmap resources can be edited
0.1.0b - Initial Release
- Complete XML parsing of a skins2 file
- Working display of the skins hierarchy
......
......@@ -235,64 +235,134 @@ public class Layout implements ActionListener{
maxheight_tf.setToolTipText("Maximum height of the layout. This value is only used when resizing the layout. If this value is set to \"-1\", the initial width (as specified by the width attribute) will be used as maximum width.");
ok_btn = new JButton("OK");
ok_btn.addActionListener(this);
ok_btn.setPreferredSize(new Dimension(70,25));
cancel_btn = new JButton("Cancel");
cancel_btn.addActionListener(this);
cancel_btn.setPreferredSize(new Dimension(70,25));
help_btn = new JButton("Help");
help_btn.addActionListener(this);
help_btn.setPreferredSize(new Dimension(70,25));
JLabel attr_l = new JLabel("* Attributes marked with a star must be specified.");
//Distance of textfields to WEST edge of container
Component[] labels = { id_l, width_l, height_l, minwidth_l, minheight_l, maxwidth_l, maxheight_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);
general.add(id_tf);
id_tf.setPreferredSize(new Dimension(tf_wd,id_tf.getPreferredSize().height));
general.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "General Attributes"));
general.setMinimumSize(new Dimension(240,45));
general.setPreferredSize(new Dimension(240,45));
general.setMaximumSize(new Dimension(240,45));
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.EAST, general, 5, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.SOUTH, general, 10, SpringLayout.SOUTH, id_l);
frame.add(general);
JPanel dim = new JPanel(null);
dim.add(width_l);
dim.add(width_tf);
width_l.setBounds(5,15,75,24);
width_tf.setBounds(85,15,150,24);
dim.add(width_tf);
width_tf.setPreferredSize(new Dimension(tf_wd,width_tf.getPreferredSize().height));
dim.add(height_l);
dim.add(height_tf);
height_l.setBounds(5,45,75,24);
height_tf.setBounds(85,45,150,24);
dim.add(minwidth_l);
height_tf.setPreferredSize(new Dimension(tf_wd,height_tf.getPreferredSize().height));
dim.add(minwidth_l);
dim.add(minwidth_tf);
minwidth_l.setBounds(5,75,75,24);
minwidth_tf.setBounds(85,75,150,24);
minwidth_tf.setPreferredSize(new Dimension(tf_wd,minwidth_tf.getPreferredSize().height));
dim.add(minheight_l);
dim.add(minheight_tf);
minheight_l.setBounds(5,105,75,24);
minheight_tf.setBounds(85,105,150,24);
minheight_tf.setPreferredSize(new Dimension(tf_wd,minheight_tf.getPreferredSize().height));
dim.add(maxwidth_l);
dim.add(maxwidth_tf);
maxwidth_l.setBounds(5,135,75,24);
maxwidth_tf.setBounds(85,135,150,24);
maxwidth_tf.setPreferredSize(new Dimension(tf_wd,maxwidth_tf.getPreferredSize().height));
dim.add(maxheight_l);
dim.add(maxheight_tf);
maxheight_l.setBounds(5,165,75,24);
maxheight_tf.setBounds(85,165,150,24);
maxheight_tf.setPreferredSize(new Dimension(tf_wd,maxheight_tf.getPreferredSize().height));
dim.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Dimensions"));
dim.setMinimumSize(new Dimension(240,195));
dim.setPreferredSize(new Dimension(240,195));
dim.setMaximumSize(new Dimension(240,195));
SpringLayout dim_layout = new SpringLayout();
dim.setLayout(dim_layout);
dim_layout.putConstraint(SpringLayout.NORTH, width_l, 5, SpringLayout.NORTH, dim);
dim_layout.putConstraint(SpringLayout.WEST, width_l, 5, SpringLayout.WEST, dim);
dim_layout.putConstraint(SpringLayout.VERTICAL_CENTER, width_tf, 0, SpringLayout.VERTICAL_CENTER, width_l);
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.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.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.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.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.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);
frame.add(dim);
frame.add(ok_btn);
frame.add(cancel_btn);
frame.add(help_btn);
frame.add(new JLabel("* required attribute"));
frame.add(attr_l);
SpringLayout layout = new SpringLayout();
frame.setLayout(layout);
layout.putConstraint(SpringLayout.NORTH, general, 5, SpringLayout.NORTH, frame.getContentPane());
layout.putConstraint(SpringLayout.WEST, general, 5, SpringLayout.WEST, frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, dim, 5, SpringLayout.SOUTH, general);
layout.putConstraint(SpringLayout.WEST, dim, 5, SpringLayout.WEST, frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, attr_l, 5, SpringLayout.SOUTH, dim);
layout.putConstraint(SpringLayout.WEST, attr_l, 5, SpringLayout.WEST, frame.getContentPane());
layout.putConstraint(SpringLayout.EAST, attr_l, 5, SpringLayout.EAST, frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, ok_btn, 5, SpringLayout.SOUTH, attr_l);
layout.putConstraint(SpringLayout.NORTH, cancel_btn, 5, SpringLayout.SOUTH, attr_l);
layout.putConstraint(SpringLayout.NORTH, help_btn, 5, SpringLayout.SOUTH, attr_l);
layout.putConstraint(SpringLayout.WEST, ok_btn, 5, SpringLayout.WEST, frame.getContentPane());
layout.putConstraint(SpringLayout.WEST, cancel_btn, 5, SpringLayout.EAST, ok_btn);
layout.putConstraint(SpringLayout.WEST, help_btn, 5, SpringLayout.EAST, cancel_btn);
layout.putConstraint(SpringLayout.SOUTH, frame.getContentPane(), 5, SpringLayout.SOUTH, ok_btn);
layout.putConstraint(SpringLayout.EAST, frame.getContentPane(), 5, SpringLayout.EAST, general);
frame.pack();
frame.setMinimumSize(new Dimension(250,350));
frame.setPreferredSize(new Dimension(250,350));
frame.setMaximumSize(new Dimension(250,350));
frame.getRootPane().setDefaultButton(ok_btn);
}
id_tf.setText(id);
width_tf.setText(String.valueOf(width));
......@@ -334,14 +404,14 @@ public class Layout implements ActionListener{
if (Desktop.isDesktopSupported()) {
desktop = Desktop.getDesktop();
try {
desktop.browse(new java.net.URI("http://www.videolan.org/vlc/skins2-create.html#Layout"));
desktop.browse(new java.net.URI("http://www.videolan.org/vlc/skinedhlp/layout.html"));
}
catch (Exception ex) {
JOptionPane.showMessageDialog(null,ex.toString(),ex.getMessage(),JOptionPane.ERROR_MESSAGE);
}
}
else {
JOptionPane.showMessageDialog(null,"Could not launch Browser","Go to the following URL manually:\nhttp://www.videolan.org/vlc/skins2-create.html",JOptionPane.WARNING_MESSAGE);
JOptionPane.showMessageDialog(null,"Could not launch Browser","Go to the following URL manually:\nhttp://www.videolan.org/vlc/skinedhlp/layout.html",JOptionPane.WARNING_MESSAGE);
}
}
else if(e.getSource().equals(cancel_btn)) {
......
......@@ -184,29 +184,29 @@ public class Window implements ActionListener{
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.WEST, id_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.NORTH, id_tf, 0, SpringLayout.NORTH, id_l);
general_layout.putConstraint(SpringLayout.EAST, general, 5, SpringLayout.EAST, id_tf);
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.NORTH, x_l, 10, SpringLayout.SOUTH, id_l);
general_layout.putConstraint(SpringLayout.WEST, x_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.WEST, x_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.NORTH, x_tf, 0, SpringLayout.NORTH, x_l);
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.WEST, y_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.WEST, y_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.NORTH, y_tf, 0, SpringLayout.NORTH, y_l);
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.WEST, visible_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.WEST, visible_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.NORTH, visible_tf, 0, SpringLayout.NORTH, visible_l);
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);
......@@ -225,15 +225,15 @@ public class Window implements ActionListener{
options_layout.putConstraint(SpringLayout.NORTH, dragdrop_l, 5, SpringLayout.NORTH, options);
options_layout.putConstraint(SpringLayout.WEST, dragdrop_l, 5, SpringLayout.WEST, options);
options_layout.putConstraint(SpringLayout.WEST, dragdrop_tf, tf_dx, SpringLayout.WEST, options);
options_layout.putConstraint(SpringLayout.NORTH, dragdrop_tf, 0, SpringLayout.NORTH, dragdrop_l);
options_layout.putConstraint(SpringLayout.VERTICAL_CENTER, dragdrop_tf, 0, SpringLayout.VERTICAL_CENTER, dragdrop_l);
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.WEST, playondrop_l, 5, SpringLayout.WEST, options);
options_layout.putConstraint(SpringLayout.WEST, playondrop_tf, tf_dx, SpringLayout.NORTH, options);
options_layout.putConstraint(SpringLayout.NORTH, playondrop_tf, 0, SpringLayout.NORTH, playondrop_l);
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);
......
......@@ -238,6 +238,15 @@ public class Bitmap extends Resource implements ActionListener{
help_btn.addActionListener(this);
JLabel attr_l = new JLabel("* Attributes marked with a star must be specified.");
//Distance of textfields to WEST edge of container
Component[] labels = { id_l, file_l, alphacolor_l, nbframes_l, fps_l};
int tf_dx = Helper.maxWidth(labels)+10;
//Max. textfield width
int tf_wd = 200;
//Width of buttons
Component[] btns = { file_btn, alphacolor_btn };
int btn_wd = Helper.maxWidth(btns);
JPanel general = new JPanel(null);
general.add(id_l);
general.add(id_tf);
......@@ -247,48 +256,43 @@ public class Bitmap extends Resource implements ActionListener{
general.add(alphacolor_l);
general.add(alphacolor_tf);
general.add(alphacolor_btn);
general.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "General Attributes"));
frame.add(general);
//Distance of textfields to WEST edge of container
Component[] labels = { id_l, file_l, alphacolor_l, nbframes_l, fps_l};
int tf_dx = Helper.maxWidth(labels)+10;
//Max. textfield width
int tf_wd = 200;
//Width of buttons
Component[] btns = { file_btn, alphacolor_btn };
int btn_wd = Helper.maxWidth(btns);
file_tf.setPreferredSize(new Dimension(tf_wd-btn_wd,file_tf.getPreferredSize().height));
file_btn.setPreferredSize(new Dimension(btn_wd,file_btn.getPreferredSize().height));
alphacolor_tf.setPreferredSize(new Dimension(tf_wd-btn_wd,alphacolor_tf.getPreferredSize().height));
alphacolor_btn.setPreferredSize(new Dimension(btn_wd,alphacolor_btn.getPreferredSize().height));
general.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "General Attributes"));
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.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, id_tf, 0, SpringLayout.NORTH, id_l);
general_layout.putConstraint(SpringLayout.EAST, id_tf, 0, SpringLayout.EAST, file_btn);
general_layout.putConstraint(SpringLayout.NORTH, file_l, 10, SpringLayout.SOUTH, id_l);
general_layout.putConstraint(SpringLayout.WEST, file_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.WEST, file_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, file_tf, 0, SpringLayout.VERTICAL_CENTER, file_l);
general_layout.putConstraint(SpringLayout.WEST, file_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.NORTH, file_tf, 0, SpringLayout.NORTH, file_l);
file_tf.setPreferredSize(new Dimension(tf_wd-btn_wd,file_tf.getPreferredSize().height));
file_btn.setPreferredSize(new Dimension(btn_wd,file_btn.getPreferredSize().height));
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, file_btn, 0, SpringLayout.VERTICAL_CENTER, file_l);
general_layout.putConstraint(SpringLayout.WEST, file_btn, 5, SpringLayout.EAST, file_tf);
general_layout.putConstraint(SpringLayout.NORTH, file_btn, 0, SpringLayout.NORTH, file_l);
general_layout.putConstraint(SpringLayout.EAST, general, 5, SpringLayout.EAST, file_btn);
general_layout.putConstraint(SpringLayout.NORTH, alphacolor_l, 10, SpringLayout.SOUTH, file_l);
general_layout.putConstraint(SpringLayout.WEST, alphacolor_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.WEST, alphacolor_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, alphacolor_tf, 0, SpringLayout.VERTICAL_CENTER, alphacolor_l);
general_layout.putConstraint(SpringLayout.WEST, alphacolor_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.NORTH, alphacolor_tf, 0, SpringLayout.NORTH, alphacolor_l);
alphacolor_tf.setPreferredSize(new Dimension(tf_wd-btn_wd,alphacolor_tf.getPreferredSize().height));
alphacolor_btn.setPreferredSize(new Dimension(btn_wd,alphacolor_btn.getPreferredSize().height));
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, alphacolor_btn, 0, SpringLayout.VERTICAL_CENTER, alphacolor_l);
general_layout.putConstraint(SpringLayout.WEST, alphacolor_btn, 5, SpringLayout.EAST, alphacolor_tf);
general_layout.putConstraint(SpringLayout.NORTH, alphacolor_btn, 0, SpringLayout.NORTH, alphacolor_l);
general_layout.putConstraint(SpringLayout.EAST, general, 5, SpringLayout.EAST, alphacolor_btn);
general_layout.putConstraint(SpringLayout.SOUTH, general, 10, SpringLayout.SOUTH, alphacolor_l);
frame.add(general);
JPanel animation = new JPanel(null);
animation.add(nbframes_l);
......@@ -303,15 +307,17 @@ public class Bitmap extends Resource implements ActionListener{
nbframes_tf.setPreferredSize(new Dimension(tf_wd,nbframes_tf.getPreferredSize().height));
ani_layout.putConstraint(SpringLayout.NORTH, nbframes_l, 5, SpringLayout.NORTH, animation);
ani_layout.putConstraint(SpringLayout.WEST, nbframes_l, 5, SpringLayout.WEST, animation);
ani_layout.putConstraint(SpringLayout.WEST, nbframes_l, 5, SpringLayout.WEST, animation);
ani_layout.putConstraint(SpringLayout.VERTICAL_CENTER, nbframes_tf, 0, SpringLayout.VERTICAL_CENTER, nbframes_l);
ani_layout.putConstraint(SpringLayout.WEST, nbframes_tf, tf_dx, SpringLayout.WEST, animation);
ani_layout.putConstraint(SpringLayout.NORTH, nbframes_tf, 0, SpringLayout.NORTH, nbframes_l);
ani_layout.putConstraint(SpringLayout.EAST, animation, 5, SpringLayout.EAST, nbframes_tf);
ani_layout.putConstraint(SpringLayout.NORTH, fps_l, 10, SpringLayout.SOUTH, nbframes_l);
ani_layout.putConstraint(SpringLayout.WEST, fps_l, 5, SpringLayout.WEST, animation);
ani_layout.putConstraint(SpringLayout.WEST, fps_l, 5, SpringLayout.WEST, animation);
ani_layout.putConstraint(SpringLayout.VERTICAL_CENTER, fps_tf, 0, SpringLayout.VERTICAL_CENTER, fps_l);
ani_layout.putConstraint(SpringLayout.WEST, fps_tf, tf_dx, SpringLayout.WEST, animation);
ani_layout.putConstraint(SpringLayout.NORTH, fps_tf, 0, SpringLayout.NORTH, fps_l);
ani_layout.putConstraint(SpringLayout.EAST, fps_tf, 0, SpringLayout.EAST, nbframes_tf);
ani_layout.putConstraint(SpringLayout.SOUTH, animation, 10, SpringLayout.SOUTH, fps_l);
......
......@@ -179,11 +179,20 @@ public class Font extends Resource implements ActionListener{
help_btn.addActionListener(this);
JLabel attr_l = new JLabel("* Attributes marked with a star must be specified.");
//Textfield distance to WEST border of container
Component[] labels = { id_l, file_l, size_l };
int tf_dx = Helper.maxWidth(labels)+10;
//Maximal textfield width
int tf_wd = 200;
//Button width
int btn_wd = file_btn.getPreferredSize().width;
JPanel general = new JPanel(null);
general.add(id_l);
general.add(id_tf);
general.add(file_l);
general.add(file_tf);
file_tf.setPreferredSize(new Dimension(tf_wd-btn_wd,file_tf.getPreferredSize().height));
general.add(file_btn);
general.add(size_l);
general.add(size_tf);
......@@ -193,33 +202,28 @@ public class Font extends Resource implements ActionListener{
SpringLayout general_layout = new SpringLayout();
general.setLayout(general_layout);
//Textfield distance to WEST border of container
Component[] labels = { id_l, file_l, size_l };
int tf_dx = Helper.maxWidth(labels)+10;
//Maximal textfield width
int tf_wd = 200;
//Button width
int btn_wd = file_btn.getPreferredSize().width;
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.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, id_tf, 0, SpringLayout.NORTH, id_l);
general_layout.putConstraint(SpringLayout.EAST, id_tf, 0, SpringLayout.EAST, file_btn);
general_layout.putConstraint(SpringLayout.NORTH, file_l, 10, SpringLayout.SOUTH, id_l);
general_layout.putConstraint(SpringLayout.WEST, file_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.WEST, file_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, file_tf, 0, SpringLayout.VERTICAL_CENTER, file_l);
general_layout.putConstraint(SpringLayout.WEST, file_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.NORTH, file_tf, 0, SpringLayout.NORTH, file_l);
file_tf.setPreferredSize(new Dimension(tf_wd-btn_wd,file_tf.getPreferredSize().height));
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, file_btn, 0, SpringLayout.VERTICAL_CENTER, file_l);
general_layout.putConstraint(SpringLayout.WEST, file_btn, 5, SpringLayout.EAST, file_tf);
general_layout.putConstraint(SpringLayout.NORTH, file_btn, 0, SpringLayout.NORTH, file_l);
general_layout.putConstraint(SpringLayout.EAST, general, 5, SpringLayout.EAST, file_btn);
general_layout.putConstraint(SpringLayout.NORTH, size_l, 10, SpringLayout.SOUTH, file_l);
general_layout.putConstraint(SpringLayout.WEST, size_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.WEST, size_l, 5, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.VERTICAL_CENTER, size_tf, 0, SpringLayout.VERTICAL_CENTER, size_l);
general_layout.putConstraint(SpringLayout.WEST, size_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.NORTH, size_tf, 0, SpringLayout.NORTH, size_l);
general_layout.putConstraint(SpringLayout.EAST, size_tf, 0, SpringLayout.EAST, file_btn);
general_layout.putConstraint(SpringLayout.SOUTH, general, 10, SpringLayout.SOUTH, size_l);
......
......@@ -154,10 +154,10 @@ public class SubBitmap extends Resource implements ActionListener{
JLabel id_l = new JLabel("ID*:");
id_tf = new JTextField();
id_tf.setToolTipText("Identifiant of the font that will be used with controls..");
JLabel x_l = new JLabel("x:");
JLabel x_l = new JLabel("X:");
x_tf = new JTextField();
x_tf.setDocument(new NumbersOnlyDocument(false));
JLabel y_l = new JLabel("y:");
JLabel y_l = new JLabel("Y:");
y_tf = new JTextField();
y_tf.setDocument(new NumbersOnlyDocument(false));
JLabel width_l = new JLabel("Width:");
......@@ -197,8 +197,8 @@ public class SubBitmap extends Resource implements ActionListener{
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.WEST, id_tf, tf_dx, SpringLayout.WEST, general);
general_layout.putConstraint(SpringLayout.NORTH, id_tf, 0, SpringLayout.NORTH, id_l);
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);
frame.add(general);
......@@ -222,29 +222,29 @@ public class SubBitmap extends Resource implements ActionListener{
bounds_layout.putConstraint(SpringLayout.NORTH, x_l, 5, SpringLayout.NORTH, bounds);
bounds_layout.putConstraint(SpringLayout.WEST, x_l, 5, SpringLayout.WEST, bounds);
bounds_layout.putConstraint(SpringLayout.VERTICAL_CENTER, x_tf, 0, SpringLayout.VERTICAL_CENTER, x_l);
bounds_layout.putConstraint(SpringLayout.WEST, x_tf, tf_dx, SpringLayout.WEST, bounds);
bounds_layout.putConstraint(SpringLayout.NORTH, x_tf, 0, SpringLayout.NORTH, x_l);
bounds_layout.putConstraint(SpringLayout.EAST, bounds, 5, SpringLayout.EAST, x_tf);
bounds_layout.putConstraint(SpringLayout.NORTH, y_l, 10, SpringLayout.SOUTH, x_l);
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.NORTH, y_tf, 0, SpringLayout.NORTH, y_l);
bounds_layout.putConstraint(SpringLayout.EAST, y_tf, 0, SpringLayout.EAST, x_tf);
bounds_layout.putConstraint(SpringLayout.NORTH, width_l, 10, SpringLayout.SOUTH, y_l);
bounds_layout.putConstraint(SpringLayout.WEST, width_l, 5, SpringLayout.WEST, bounds);
bounds_layout.putConstraint(SpringLayout.VERTICAL_CENTER, width_tf, 0, SpringLayout.VERTICAL_CENTER, width_l);
bounds_layout.putConstraint(SpringLayout.WEST, width_tf, tf_dx, SpringLayout.WEST, bounds);
bounds_layout.putConstraint(SpringLayout.NORTH, width_tf, 0, SpringLayout.NORTH, width_l);
bounds_layout.putConstraint(SpringLayout.EAST, width_tf, 0, SpringLayout.EAST, x_tf);
bounds_layout.putConstraint(SpringLayout.NORTH, height_l, 10, SpringLayout.SOUTH, width_l);
bounds_layout.putConstraint(SpringLayout.WEST, height_l, 5, SpringLayout.WEST, bounds);
bounds_layout.putConstraint(SpringLayout.VERTICAL_CENTER, height_tf, 0, SpringLayout.VERTICAL_CENTER, height_l);
bounds_layout.putConstraint(SpringLayout.WEST, height_tf, tf_dx, SpringLayout.WEST, bounds);
bounds_layout.putConstraint(SpringLayout.NORTH, height_tf, 0, SpringLayout.NORTH, height_l);
bounds_layout.putConstraint(SpringLayout.EAST, height_tf, 0, SpringLayout.EAST, x_tf);
bounds_layout.putConstraint(SpringLayout.SOUTH, bounds, 10, SpringLayout.SOUTH, height_l);
......@@ -260,15 +260,19 @@ public class SubBitmap extends Resource implements ActionListener{
animation.setLayout(ani_layout);
nbframes_tf.setPreferredSize(new Dimension(tf_wd,nbframes_tf.getPreferredSize().height));
ani_layout.putConstraint(SpringLayout.NORTH, nbframes_l, 5, SpringLayout.NORTH, animation);
ani_layout.putConstraint(SpringLayout.WEST, nbframes_l, 5, SpringLayout.WEST, animation);
ani_layout.putConstraint(SpringLayout.WEST, nbframes_l, 5, SpringLayout.WEST, animation);
ani_layout.putConstraint(SpringLayout.VERTICAL_CENTER, nbframes_tf, 0, SpringLayout.VERTICAL_CENTER, nbframes_l);
ani_layout.putConstraint(SpringLayout.WEST, nbframes_tf, tf_dx, SpringLayout.WEST, animation);
ani_layout.putConstraint(SpringLayout.NORTH, nbframes_tf, 0, SpringLayout.NORTH, nbframes_l);
ani_layout.putConstraint(SpringLayout.EAST, animation, 5, SpringLayout.EAST, nbframes_tf);
ani_layout.putConstraint(SpringLayout.NORTH, fps_l, 10, SpringLayout.SOUTH, nbframes_l);
ani_layout.putConstraint(SpringLayout.WEST, fps_l, 5, SpringLayout.WEST, animation);
ani_layout.putConstraint(SpringLayout.WEST, fps_l, 5, SpringLayout.WEST, animation);
ani_layout.putConstraint(SpringLayout.VERTICAL_CENTER, fps_tf, 0, SpringLayout.VERTICAL_CENTER, fps_l);
ani_layout.putConstraint(SpringLayout.WEST, fps_tf, tf_dx, SpringLayout.WEST, animation);
ani_layout.putConstraint(SpringLayout.NORTH, fps_tf, 0, SpringLayout.NORTH, fps_l);
ani_layout.putConstraint(SpringLayout.EAST, fps_tf, 0, SpringLayout.EAST, nbframes_tf);
ani_layout.putConstraint(SpringLayout.SOUTH, animation, 10, SpringLayout.SOUTH, fps_l);
frame.add(animation);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment