Search in sources :

Example 6 with BnButton

use of org.beanfabrics.swing.BnButton in project grafikon by jub77.

the class NewModelDialog method initComponents.

private void initComponents() {
    ActionListener closeAction = e -> setVisible(false);
    java.awt.GridBagConstraints gridBagConstraints;
    javax.swing.JLabel jLabel1 = new javax.swing.JLabel();
    BnComboBox scaleComboBox = new BnComboBox();
    javax.swing.JLabel jLabel2 = new javax.swing.JLabel();
    BnComboBox ratioComboBox = new BnComboBox();
    javax.swing.JPanel panel1 = new javax.swing.JPanel();
    BnButton okButton = new BnButton();
    okButton.addActionListener(closeAction);
    JButton cancelButton = new JButton();
    cancelButton.addActionListener(closeAction);
    javax.swing.JLabel jLabel3 = new javax.swing.JLabel();
    BnComboBox templatesComboBox = new BnComboBox();
    // NOI18N
    setTitle(ResourceLoader.getString("newmodel"));
    setResizable(false);
    getContentPane().setLayout(new java.awt.GridBagLayout());
    // NOI18N
    jLabel1.setText(ResourceLoader.getString("modelinfo.scales"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 10, 0, 0);
    getContentPane().add(jLabel1, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(10, 2, 10, 10);
    getContentPane().add(scaleComboBox, gridBagConstraints);
    // NOI18N
    jLabel2.setText(ResourceLoader.getString("modelinfo.ratio"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 10, 10, 0);
    getContentPane().add(jLabel2, gridBagConstraints);
    ratioComboBox.setEditable(true);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 2, 10, 10);
    getContentPane().add(ratioComboBox, gridBagConstraints);
    // NOI18N
    okButton.setText(ResourceLoader.getString("button.ok"));
    panel1.add(okButton);
    // NOI18N
    cancelButton.setText(ResourceLoader.getString("button.cancel"));
    panel1.add(cancelButton);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
    gridBagConstraints.insets = new java.awt.Insets(0, 0, 10, 5);
    getContentPane().add(panel1, gridBagConstraints);
    // NOI18N
    jLabel3.setText(ResourceLoader.getString("newmodel.template"));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 10, 10, 0);
    getContentPane().add(jLabel3, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 2, 10, 10);
    getContentPane().add(templatesComboBox, gridBagConstraints);
    // binding
    scaleComboBox.setModelProvider(provider);
    scaleComboBox.setPath(new Path("scale"));
    ratioComboBox.setModelProvider(provider);
    ratioComboBox.setPath(new Path("timeScale"));
    templatesComboBox.setModelProvider(provider);
    templatesComboBox.setPath(new Path("template"));
    okButton.setModelProvider(provider);
    okButton.setPath(new Path("ok"));
    pack();
}
Also used : ModelProvider(org.beanfabrics.ModelProvider) ActionListener(java.awt.event.ActionListener) JButton(javax.swing.JButton) TemplateLoader(net.parostroj.timetable.model.templates.TemplateLoader) LSException(net.parostroj.timetable.model.ls.LSException) Path(org.beanfabrics.Path) NewModelPM(net.parostroj.timetable.gui.pm.NewModelPM) Callable(java.util.concurrent.Callable) TrainDiagram(net.parostroj.timetable.model.TrainDiagram) BnButton(org.beanfabrics.swing.BnButton) ResourceLoader(net.parostroj.timetable.utils.ResourceLoader) BnComboBox(org.beanfabrics.swing.BnComboBox) Path(org.beanfabrics.Path) JButton(javax.swing.JButton) ActionListener(java.awt.event.ActionListener) BnComboBox(org.beanfabrics.swing.BnComboBox) BnButton(org.beanfabrics.swing.BnButton)

Aggregations

ActionListener (java.awt.event.ActionListener)6 ModelProvider (org.beanfabrics.ModelProvider)6 Path (org.beanfabrics.Path)6 BnButton (org.beanfabrics.swing.BnButton)6 BnTextField (org.beanfabrics.swing.BnTextField)5 BnComboBox (org.beanfabrics.swing.BnComboBox)4 java.awt (java.awt)3 javax.swing (javax.swing)3 EmptyBorder (javax.swing.border.EmptyBorder)3 ResourceLoader (net.parostroj.timetable.gui.utils.ResourceLoader)3 ResourceLoader (net.parostroj.timetable.utils.ResourceLoader)3 FlowLayout (java.awt.FlowLayout)2 Window (java.awt.Window)2 Collection (java.util.Collection)2 Locale (java.util.Locale)2 JLabel (javax.swing.JLabel)2 TrainDiagram (net.parostroj.timetable.model.TrainDiagram)2 BnCheckBox (org.beanfabrics.swing.BnCheckBox)2 BorderLayout (java.awt.BorderLayout)1 Component (java.awt.Component)1