Search in sources :

Example 91 with EmptyBorder

use of javax.swing.border.EmptyBorder in project beast-mcmc by beast-dev.

the class SelectParametersDialog method showDialog.

public int showDialog(String message, List<Parameter> parameterList) {
    optionPanel.removeAll();
    if (message != null && !message.isEmpty()) {
        optionPanel.addSpanningComponent(new JLabel(message));
    }
    parameterCombo.removeAllItems();
    for (Parameter parameter : parameterList) {
        parameterCombo.addItem(parameter);
    }
    optionPanel.addComponentWithLabel("Parameter:", parameterCombo);
    JOptionPane optionPane = new JOptionPane(optionPanel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, null, null);
    optionPane.setBorder(new EmptyBorder(12, 12, 12, 12));
    int result = JOptionPane.CANCEL_OPTION;
    final JDialog dialog = optionPane.createDialog(frame, "Add Parameter");
    dialog.pack();
    dialog.setVisible(true);
    Integer value = (Integer) optionPane.getValue();
    if (value != null && value != -1) {
        result = value;
    }
    return result;
}
Also used : Parameter(dr.app.beauti.options.Parameter) EmptyBorder(javax.swing.border.EmptyBorder)

Example 92 with EmptyBorder

use of javax.swing.border.EmptyBorder in project beast-mcmc by beast-dev.

the class CloneModelDialog method showDialog.

public int showDialog(List<PartitionSubstitutionModel> sourceModels) {
    JOptionPane optionPane = new JOptionPane(optionPanel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, null, null);
    optionPane.setBorder(new EmptyBorder(12, 12, 12, 12));
    sourceModelCombo.removeAllItems();
    for (PartitionSubstitutionModel model : sourceModels) {
        sourceModelCombo.addItem(model);
    }
    final JDialog dialog = optionPane.createDialog(frame, "Clone model settings");
    dialog.pack();
    dialog.setVisible(true);
    int result = JOptionPane.CANCEL_OPTION;
    Integer value = (Integer) optionPane.getValue();
    if (value != null && value != -1) {
        result = value;
    }
    return result;
}
Also used : EmptyBorder(javax.swing.border.EmptyBorder) PartitionSubstitutionModel(dr.app.beauti.options.PartitionSubstitutionModel)

Example 93 with EmptyBorder

use of javax.swing.border.EmptyBorder in project processdash by dtuma.

the class DefectImportForm method buildAndShowWindow.

private void buildAndShowWindow(Element xml, String windowName) {
    frame = new JFrame(windowName) {

        public void dispose() {
            super.dispose();
            disposeForm();
        }
    };
    DashboardIconFactory.setWindowIcon(frame);
    frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    frame.getContentPane().setLayout(new BorderLayout());
    ((JComponent) getContainer()).setBorder(new EmptyBorder(5, 5, 5, 5));
    frame.getContentPane().add(BorderLayout.NORTH, getContainer());
    BoundDefectTable defectTable = new BoundDefectTable(this);
    defectTable.setBorder(new EmptyBorder(0, 10, 0, 10));
    frame.getContentPane().add(BorderLayout.CENTER, defectTable);
    frame.getContentPane().add(BorderLayout.SOUTH, createButtonBox());
    int width = XMLUtils.getXMLInt(xml, "windowWidth");
    if (width <= 0)
        width = 600;
    int height = XMLUtils.getXMLInt(xml, "windowHeight");
    if (height <= 0)
        height = 500;
    frame.setSize(width, height);
    frame.setVisible(true);
}
Also used : BorderLayout(java.awt.BorderLayout) JFrame(javax.swing.JFrame) JComponent(javax.swing.JComponent) EmptyBorder(javax.swing.border.EmptyBorder)

Example 94 with EmptyBorder

use of javax.swing.border.EmptyBorder in project processdash by dtuma.

the class PreferencesDialog method getBottomSection.

private Component getBottomSection() {
    JButton okButton = new JButton(resources.getString("OK_Button"));
    okButton.addActionListener((ActionListener) EventHandler.create(ActionListener.class, this, "saveAndClose"));
    JButton cancelButton = new JButton(resources.getString("Cancel_Button"));
    cancelButton.addActionListener((ActionListener) EventHandler.create(ActionListener.class, this, "closePreferences"));
    applyButton = new JButton(resources.getString("Apply_Button"));
    applyButton.addActionListener((ActionListener) EventHandler.create(ActionListener.class, this, "applyChanges"));
    restartRequireLabel = new JLabel(resources.getString("Restart_Required"));
    restartRequireLabel.setIcon(DashboardIconFactory.getRestartRequiredIcon());
    Box bottomBox = Box.createHorizontalBox();
    bottomBox.add(restartRequireLabel);
    bottomBox.add(Box.createHorizontalGlue());
    bottomBox.add(okButton);
    bottomBox.add(Box.createHorizontalStrut(CONTROL_BUTTONS_SPACING));
    bottomBox.add(cancelButton);
    bottomBox.add(Box.createHorizontalStrut(CONTROL_BUTTONS_SPACING));
    bottomBox.add(applyButton);
    bottomBox.setBorder(new EmptyBorder(BUTTON_BOX_BORDER, BUTTON_BOX_BORDER, BUTTON_BOX_BORDER, BUTTON_BOX_BORDER));
    updateApplyButton();
    updateRestartRequired();
    return bottomBox;
}
Also used : JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) Box(javax.swing.Box) EmptyBorder(javax.swing.border.EmptyBorder)

Example 95 with EmptyBorder

use of javax.swing.border.EmptyBorder in project beast-mcmc by beast-dev.

the class GenerateTreeDialog method showDialog.

public int showDialog(BeautiOptions options) {
    JOptionPane optionPane = new JOptionPane(optionPanel, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, null, null);
    optionPane.setBorder(new EmptyBorder(12, 12, 12, 12));
    partitionCombo.removeAllItems();
    for (AbstractPartitionData partition : options.dataPartitions) {
        partitionCombo.addItem(partition);
    }
    final JDialog dialog = optionPane.createDialog(frame, "Construct New Tree");
    dialog.pack();
    dialog.setVisible(true);
    int result = JOptionPane.CANCEL_OPTION;
    Integer value = (Integer) optionPane.getValue();
    if (value != null && value != -1) {
        result = value;
    }
    return result;
}
Also used : AbstractPartitionData(dr.app.beauti.options.AbstractPartitionData) EmptyBorder(javax.swing.border.EmptyBorder)

Aggregations

EmptyBorder (javax.swing.border.EmptyBorder)224 JPanel (javax.swing.JPanel)96 BorderLayout (java.awt.BorderLayout)87 JLabel (javax.swing.JLabel)70 JButton (javax.swing.JButton)44 JScrollPane (javax.swing.JScrollPane)44 Insets (java.awt.Insets)37 Dimension (java.awt.Dimension)35 Border (javax.swing.border.Border)30 GridBagLayout (java.awt.GridBagLayout)29 ActionEvent (java.awt.event.ActionEvent)27 ActionListener (java.awt.event.ActionListener)27 TitledBorder (javax.swing.border.TitledBorder)25 GridBagConstraints (java.awt.GridBagConstraints)24 Box (javax.swing.Box)22 JTextField (javax.swing.JTextField)21 CompoundBorder (javax.swing.border.CompoundBorder)20 BoxLayout (javax.swing.BoxLayout)17 FlowLayout (java.awt.FlowLayout)16 JCheckBox (javax.swing.JCheckBox)16