use of java.awt.Dimension in project EnrichmentMapApp by BaderLab.
the class ControlPanel method createContents.
@AfterInjection
private void createContents() {
setMinimumSize(new Dimension(390, 400));
setPreferredSize(new Dimension(390, 600));
JButton helpButton = SwingUtil.createOnlineHelpButton(EnrichmentMapBuildProperties.USER_MANUAL_URL, "Online Manual...", serviceRegistrar);
makeSmall(getAboutButton(), getClosePanelButton());
final GroupLayout layout = new GroupLayout(this);
setLayout(layout);
layout.setAutoCreateContainerGaps(LookAndFeelUtil.isWinLAF());
layout.setAutoCreateGaps(!LookAndFeelUtil.isAquaLAF());
layout.setHorizontalGroup(layout.createParallelGroup(CENTER, true).addGroup(layout.createSequentialGroup().addComponent(getEmViewCombo(), DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addPreferredGap(ComponentPlacement.RELATED).addComponent(getCreateEmButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addPreferredGap(ComponentPlacement.RELATED).addComponent(getOptionsButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE)).addComponent(getCtrlPanelsContainer(), DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addGroup(layout.createSequentialGroup().addComponent(helpButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getAboutButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addGap(0, 0, Short.MAX_VALUE).addComponent(getClosePanelButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE)));
layout.setVerticalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(CENTER, false).addComponent(getEmViewCombo(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getCreateEmButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getOptionsButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE)).addComponent(getCtrlPanelsContainer(), DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addGroup(layout.createParallelGroup(CENTER, false).addComponent(helpButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getAboutButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getClosePanelButton(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE)));
if (LookAndFeelUtil.isAquaLAF())
setOpaque(false);
}
use of java.awt.Dimension in project EnrichmentMapApp by BaderLab.
the class ControlPanel method styleHeaderButton.
private void styleHeaderButton(final AbstractButton btn, final Font font) {
btn.setFont(font);
btn.setBorder(null);
btn.setContentAreaFilled(false);
btn.setBorderPainted(false);
int h = getEmViewCombo().getPreferredSize().height;
btn.setMinimumSize(new Dimension(h, h));
btn.setPreferredSize(new Dimension(h, h));
}
use of java.awt.Dimension in project EnrichmentMapApp by BaderLab.
the class CardDialog method createComponents.
private void createComponents() {
dialog.setLayout(new BorderLayout());
dialog.setPreferredSize(params.getPreferredSize());
Dimension minimumSize = params.getMinimumSize();
if (minimumSize != null) {
dialog.setMinimumSize(minimumSize);
}
dialog.setTitle(params.getTitle());
// Create message and button panel first because the controller can call callbacks from inside createBodyPanel()
JPanel buttonPanel = createButtonPanel();
JPanel bodyPanel = createBodyPanel();
Border padding = BorderFactory.createEmptyBorder(5, 5, 5, 5);
Border separator = BorderFactory.createMatteBorder(1, 0, 0, 0, UIManager.getColor("Separator.foreground"));
Border border = BorderFactory.createCompoundBorder(separator, padding);
buttonPanel.setBorder(border);
dialog.add(bodyPanel, BorderLayout.CENTER);
dialog.add(buttonPanel, BorderLayout.SOUTH);
}
use of java.awt.Dimension in project EnrichmentMapApp by BaderLab.
the class SliderBarPanel method getTextField.
public JFormattedTextField getTextField() {
if (textField == null) {
textField = new JFormattedTextField(format) {
@Override
public Dimension getPreferredSize() {
final Dimension d = super.getPreferredSize();
if (this.getGraphics() != null) {
// Set the preferred text field size after it gets a Graphics
int sw = 16 + this.getGraphics().getFontMetrics().stringWidth(format.format(max));
d.width = Math.max(sw, 48);
}
return d;
}
};
textField.setHorizontalAlignment(JTextField.RIGHT);
textField.addActionListener(evt -> {
textFieldValueChanged();
});
textField.addFocusListener(new FocusAdapter() {
@Override
public void focusLost(FocusEvent e) {
textFieldValueChanged();
}
});
}
return textField;
}
use of java.awt.Dimension in project EnrichmentMapApp by BaderLab.
the class SwingUtil method createOnlineHelpButton.
public static JButton createOnlineHelpButton(String url, String toolTipText, CyServiceRegistrar serviceRegistrar) {
JButton btn = new JButton();
btn.setToolTipText(toolTipText);
btn.addActionListener((ActionEvent evt) -> {
serviceRegistrar.getService(OpenBrowser.class).openURL(url);
});
if (LookAndFeelUtil.isAquaLAF()) {
btn.putClientProperty("JButton.buttonType", "help");
} else {
btn.setFont(serviceRegistrar.getService(IconManager.class).getIconFont(22.0f));
btn.setText(IconManager.ICON_QUESTION_CIRCLE);
btn.setBorderPainted(false);
btn.setContentAreaFilled(false);
btn.setFocusPainted(false);
btn.setBorder(BorderFactory.createEmptyBorder());
btn.setMinimumSize(new Dimension(22, 22));
}
return btn;
}
Aggregations