Commit c57c8361 authored by Daniel Dreibrodt's avatar Daniel Dreibrodt

translation & new editing dialog layout for image & panel

parent be2dec52
......@@ -109,5 +109,22 @@ WIN_CHECKBOX_STATE|Checkbox state
WIN_CHECKBOX_STATE1|State #1 (Condition is not fulfilled):
WIN_CHECKBOX_STATE2|State #2 (Condition is fulfilled):
#Image
WIN_IMAGE_TITLE|Image settings
WIN_IMAGE_IMAGE|Image*:
WIN_IMAGE_IMAGE_TIP|ID of a Bitmap
WIN_IMAGE_RESIZE|Resize mode:
WIN_IMAGE_RESIZE_TIP|Specify the behaviour of the image when it is resized.
WIN_IMAGE_ACTION|Action:
WIN_IMAGE_ACTION_TIP|Action triggered by a click on the image.
WIN_IMAGE_ACTION2|Double-click action:
WIN_IMAGE_ACTION2_TIP|Action triggered by a double-click on the image.
WIN_IMAGE_ATTR|Image attributes
#Group
WIN_GROUP_TITLE|Group settings
\ No newline at end of file
WIN_GROUP_TITLE|Group settings
#Panel
WIN_PANEL_TITLE|Panel settings
WIN_PANEL_WIDTH|Width*:
WIN_PANEL_HEIGHT|Height*:
\ No newline at end of file
......@@ -315,7 +315,10 @@ public class ActionEditor extends JFrame implements ActionListener{
*/
public String getCode() {
String code = "";
for(ActionPanel act:aPanels) code+=act.getActionCode()+";";
for(ActionPanel act:aPanels) {
if(code.length()>0) code+=";";
code+=act.getActionCode();
}
if(code.equals("")) code = "none";
return code;
}
......
......@@ -174,9 +174,8 @@ public class Image extends Item implements ActionListener{
@Override
public void showOptions() {
if(frame==null) {
frame = new JFrame("Image settings");
frame = new JFrame(Language.get("WIN_IMAGE_TITLE"));
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();
......@@ -189,10 +188,10 @@ public class Image 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(Language.get("WIN_ITEM_XKEEPRATIO"));
xkeepratio_cb = new JComboBox(bool_values);
......@@ -208,113 +207,216 @@ public class Image extends Item implements ActionListener{
help_tf = new JTextField();
help_tf.setToolTipText(Language.get("WIN_ITEM_HELP_TIP"));
JLabel image_l = new JLabel("Image*:");
JLabel image_l = new JLabel(Language.get("WIN_IMAGE_IMAGE"));
image_tf = new JTextField();
image_tf.setToolTipText("ID of a Bitmap.");
JLabel resize_l = new JLabel("Resizing:");
image_tf.setToolTipText(Language.get("WIN_IMAGE_IMAGE_TIP"));
JLabel resize_l = new JLabel(Language.get("WIN_IMAGE_RESIZE"));
String[] resize_values = { "mosaic" , "scale" };
resize_cb = new JComboBox(resize_values);
resize_cb.setToolTipText("Specify the behaviour of the image when it is resized. Possible values are 'mosaic' (the image is repeated as many times as necessary to reach the wanted dimensions) and 'scale' (the image is actually rescaled). Beware that the 'scale' behaviour is much slower than the 'mosaic' one, so make sure to use it only when it's really needed.");
JLabel action_l = new JLabel("Action:");
resize_cb.setToolTipText(Language.get("WIN_IMAGE_RESIZE_TIP"));
JLabel action_l = new JLabel(Language.get("WIN_IMAGE_ACTION"));
String[] action_values = { "none", "move","resizeE","resizeS","resizeSE" };
action_cb = new JComboBox(action_values);
action_cb.setToolTipText("Action triggered by a click on the control. Possible values are 'move', to move the window, 'resizeE', to resize horizontally, 'resizeS' to resize vertically, and 'resizeSE' to resize both horizontally and vertically.");
JLabel action2_l = new JLabel("Double-click Action:");
action_cb.setToolTipText(Language.get("WIN_IMAGE_ACTION_TIP"));
JLabel action2_l = new JLabel(Language.get("WIN_IMAGE_ACTION2"));
action2_tf = new JTextField();
action2_tf.setToolTipText("Action triggered by a double-click on the control.");
action2_tf.setToolTipText(Language.get("WIN_IMAGE_ACTION2_TIP"));
action2_btn = new JButton("",s.m.editor_icon);
action2_btn.addActionListener(this);
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 attr_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, image_l, resize_l, action_l, action2_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 image_settings = new JPanel(null);
image_settings.add(image_l);
image_settings.add(image_tf);
image_l.setBounds(5,15,75,24);
image_tf.setBounds(85,15,150,24);
image_settings.add(resize_l);
image_settings.add(resize_cb);
resize_l.setBounds(5,45,75,24);
resize_cb.setBounds(85,45,150,24);
image_settings.add(action_l);
image_settings.add(action_cb);
action_l.setBounds(5,75,75,24);
action_cb.setBounds(85,75,150,24);
image_settings.add(action2_l);
image_settings.add(action2_tf);
image_settings.add(action2_btn);
action2_l.setBounds(5,105,75,24);
action2_tf.setBounds(85,105,120,24);
action2_btn.setBounds(210,105,24,24);
image_settings.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Image Attributes"));
image_settings.setMinimumSize(new Dimension(240,135));
image_settings.setPreferredSize(new Dimension(240,135));
image_settings.setMaximumSize(new Dimension(240,135));
frame.add(image_settings);
JPanel image_panel = new JPanel(null);
image_panel.add(image_l);
image_panel.add(image_tf);
image_tf.setPreferredSize(new Dimension(tf_wd,image_tf.getPreferredSize().height));
image_panel.add(resize_l);
image_panel.add(resize_cb);
image_panel.add(action_l);
image_panel.add(action_cb);
image_panel.add(action2_l);
image_panel.add(action2_tf);
image_panel.add(action2_btn);
image_panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), Language.get("WIN_IMAGE_ATTR")));
SpringLayout image_layout = new SpringLayout();
image_layout.putConstraint(SpringLayout.NORTH, image_l, 5, SpringLayout.NORTH, image_panel);
image_layout.putConstraint(SpringLayout.WEST, image_l, 5, SpringLayout.WEST, image_panel);
image_layout.putConstraint(SpringLayout.VERTICAL_CENTER, image_tf, 0, SpringLayout.VERTICAL_CENTER, image_l);
image_layout.putConstraint(SpringLayout.WEST, image_tf, tf_dx, SpringLayout.WEST, image_panel);
image_layout.putConstraint(SpringLayout.NORTH, resize_l, 10, SpringLayout.SOUTH, image_tf);
image_layout.putConstraint(SpringLayout.WEST, resize_l, 5, SpringLayout.WEST, image_panel);
image_layout.putConstraint(SpringLayout.VERTICAL_CENTER, resize_cb, 0, SpringLayout.VERTICAL_CENTER, resize_l);
image_layout.putConstraint(SpringLayout.WEST, resize_cb, tf_dx, SpringLayout.WEST, image_panel);
image_layout.putConstraint(SpringLayout.EAST, resize_cb, 0, SpringLayout.EAST, image_tf);
image_layout.putConstraint(SpringLayout.NORTH, action_l, 10, SpringLayout.SOUTH, resize_cb);
image_layout.putConstraint(SpringLayout.WEST, action_l, 5, SpringLayout.WEST, image_panel);
image_layout.putConstraint(SpringLayout.VERTICAL_CENTER, action_cb, 0, SpringLayout.VERTICAL_CENTER, action_l);
image_layout.putConstraint(SpringLayout.WEST, action_cb, tf_dx, SpringLayout.WEST, image_panel);
image_layout.putConstraint(SpringLayout.EAST, action_cb, 0, SpringLayout.EAST, image_tf);
image_layout.putConstraint(SpringLayout.NORTH, action2_l, 10, SpringLayout.SOUTH, action_cb);
image_layout.putConstraint(SpringLayout.WEST, action2_l, 5, SpringLayout.WEST, image_panel);
image_layout.putConstraint(SpringLayout.VERTICAL_CENTER, action2_tf, 0, SpringLayout.VERTICAL_CENTER, action2_l);
image_layout.putConstraint(SpringLayout.WEST, action2_tf, tf_dx, SpringLayout.WEST, image_panel);
image_layout.putConstraint(SpringLayout.EAST, action2_tf, -5, SpringLayout.WEST, action2_btn);
image_layout.putConstraint(SpringLayout.VERTICAL_CENTER, action2_btn, 0, SpringLayout.VERTICAL_CENTER, action2_l);
image_layout.putConstraint(SpringLayout.EAST, action2_btn, 0, SpringLayout.EAST, image_tf);
image_layout.putConstraint(SpringLayout.EAST, image_panel, 5, SpringLayout.EAST, image_tf);
image_layout.putConstraint(SpringLayout.SOUTH, image_panel, 10, SpringLayout.SOUTH, action2_btn);
image_panel.setLayout(image_layout);
frame.add(image_panel);
frame.add(ok_btn);
frame.add(cancel_btn);
frame.add(help_btn);
frame.add(new JLabel(Language.get("NOTE_STARRED")));
frame.setMinimumSize(new Dimension(250,490));
frame.setPreferredSize(new Dimension(250,490));
frame.setMaximumSize(new Dimension(250,490));
frame.add(attr_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, image_panel, 10, SpringLayout.SOUTH, general);
layout.putConstraint(SpringLayout.WEST, image_panel, 5, SpringLayout.WEST, frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, attr_l, 10, SpringLayout.SOUTH, image_panel);
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();
frame.getRootPane().setDefaultButton(ok_btn);
......
......@@ -203,9 +203,8 @@ public class Panel extends Item implements ActionListener{
}
public void showOptions() {
if(frame==null) {
frame = new JFrame("Panel settings");
frame = new JFrame(Language.get("WIN_PANEL_TITLE"));
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();
......@@ -218,10 +217,10 @@ public class Panel 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(Language.get("WIN_ITEM_XKEEPRATIO"));
xkeepratio_cb = new JComboBox(bool_values);
......@@ -234,87 +233,157 @@ public class Panel extends Item implements ActionListener{
JLabel help_l = new JLabel(Language.get("WIN_ITEM_HELP"));
help_tf = new JTextField();
help_tf.setToolTipText(Language.get("WIN_ITEM_HELP_TIP"));
JLabel width_l = new JLabel("Width*:");
JLabel width_l = new JLabel(Language.get("WIN_PANEL_WIDTH"));
width_tf = new JTextField();
JLabel height_l = new JLabel("Height*:");
JLabel height_l = new JLabel(Language.get("WIN_PANEL_HEIGHT"));
height_tf = new JTextField();
JLabel attr_l = new JLabel(Language.get("NOTE_STARRED"));
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));
//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};
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(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);
visible_l.setBounds(5,225,75,24);
visible_tf.setBounds(85,225,150,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.EAST, general, 5, SpringLayout.EAST, id_tf);
general_layout.putConstraint(SpringLayout.SOUTH, general, 10, SpringLayout.SOUTH, ykeepratio_cb);
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);
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.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Dimensions"));
dim.setMinimumSize(new Dimension(240,75));
dim.setPreferredSize(new Dimension(240,75));
dim.setMaximumSize(new Dimension(240,75));
SpringLayout dim_layout = new SpringLayout();
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.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.EAST, dim, 5, SpringLayout.EAST, width_tf);
dim_layout.putConstraint(SpringLayout.SOUTH, dim, 10, SpringLayout.SOUTH, height_tf);
dim.setLayout(dim_layout);
frame.add(dim);
frame.add(ok_btn);
frame.add(cancel_btn);
frame.add(help_btn);
frame.add(new JLabel(Language.get("NOTE_STARRED")));
frame.setMinimumSize(new Dimension(250,440));
frame.setPreferredSize(new Dimension(250,440));
frame.setMaximumSize(new Dimension(250,440));
frame.add(attr_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, dim, 10, SpringLayout.SOUTH, general);
layout.putConstraint(SpringLayout.WEST, dim, 5, SpringLayout.WEST, frame.getContentPane());
layout.putConstraint(SpringLayout.NORTH, attr_l, 10, SpringLayout.SOUTH, dim);
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();
......
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