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;
}
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;
}
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);
}
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;
}
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;
}
Aggregations