001: package net.sourceforge.squirrel_sql.plugins.graph;
002:
003: import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
004: import net.sourceforge.squirrel_sql.fw.util.StringManager;
005:
006: import javax.swing.*;
007: import java.awt.*;
008:
009: public class FormatDlg extends JDialog {
010: private static final StringManager s_stringMgr = StringManagerFactory
011: .getStringManager(FormatDlg.class);
012:
013: JList lstFormats;
014: JTextField txtName;
015: JTextField txtWidth;
016: JTextField txtHeight;
017: JCheckBox chkIsLandscape;
018: JButton btnSave;
019: JButton btnNew;
020: JComboBox cboUnit;
021:
022: public FormatDlg(JFrame parent) {
023: // i18n[graph.formats=Formats]
024: super (parent, s_stringMgr.getString("graph.formats"), false);
025:
026: getContentPane().setLayout(new GridLayout(1, 2, 10, 0));
027:
028: lstFormats = new JList();
029: getContentPane().add(new JScrollPane(lstFormats));
030:
031: JPanel pnlEdit = new JPanel();
032:
033: pnlEdit.setLayout(new GridLayout(5, 1));
034:
035: JPanel pnlName = new JPanel(new BorderLayout());
036:
037: // i18n[graph.name=Name]
038: JLabel lblName = new JLabel(s_stringMgr.getString("graph.name"));
039: pnlName.add(lblName, BorderLayout.WEST);
040: txtName = new JTextField();
041: pnlName.add(txtName, BorderLayout.CENTER);
042:
043: pnlEdit.add(pnlName);
044:
045: JPanel pnlWidth = new JPanel(new BorderLayout());
046: // i18n[graph.width=Width]
047: JLabel lblWidth = new JLabel(s_stringMgr
048: .getString("graph.width"));
049: pnlWidth.add(lblWidth, BorderLayout.WEST);
050: txtWidth = new JTextField();
051: pnlWidth.add(txtWidth, BorderLayout.CENTER);
052:
053: pnlEdit.add(pnlWidth);
054:
055: JPanel pnlHeight = new JPanel(new BorderLayout());
056:
057: // i18n[graph.height=Height]
058: JLabel lblHeight = new JLabel(s_stringMgr
059: .getString("graph.height"));
060: pnlHeight.add(lblHeight, BorderLayout.WEST);
061: txtHeight = new JTextField();
062: pnlHeight.add(txtHeight, BorderLayout.CENTER);
063:
064: pnlEdit.add(pnlHeight);
065:
066: JPanel pnlUnit = new JPanel(new BorderLayout());
067: // i18n[graph.unit=Unit]
068: JLabel lblUnit = new JLabel(s_stringMgr.getString("graph.unit"));
069: pnlUnit.add(lblUnit, BorderLayout.WEST);
070: cboUnit = new JComboBox();
071: pnlUnit.add(cboUnit, BorderLayout.CENTER);
072:
073: pnlEdit.add(pnlUnit);
074:
075: // i18n[graph.chkIsLandscape=Landscape]
076: chkIsLandscape = new JCheckBox(s_stringMgr
077: .getString("graph.chkIsLandscape"));
078: pnlEdit.add(chkIsLandscape);
079:
080: lblName.setPreferredSize(lblHeight.getPreferredSize());
081: lblWidth.setPreferredSize(lblHeight.getPreferredSize());
082: lblUnit.setPreferredSize(lblHeight.getPreferredSize());
083:
084: JPanel pnlLeft = new JPanel();
085: pnlLeft.setLayout(new BorderLayout());
086: pnlLeft.add(pnlEdit, BorderLayout.NORTH);
087:
088: pnlLeft.add(new JPanel(), BorderLayout.CENTER);
089:
090: JPanel pnlButtons = new JPanel(new GridLayout(1, 2));
091:
092: // i18n[graph.save=Save]
093: btnSave = new JButton(s_stringMgr.getString("graph.save"));
094: // i18n[graph.new=New]
095: btnNew = new JButton(s_stringMgr.getString("graph.new"));
096: pnlButtons.add(btnNew);
097: pnlButtons.add(btnSave);
098:
099: pnlLeft.add(pnlButtons, BorderLayout.SOUTH);
100:
101: getContentPane().add(pnlLeft);
102:
103: setSize(440, 200);
104:
105: setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
106:
107: }
108:
109: }
|