use of javax.swing.GroupLayout in project EnrichmentMapApp by BaderLab.
the class PostAnalysisWeightPanel method createHypergeomPanel.
private JPanel createHypergeomPanel() {
ActionListener universeSelectActionListener = e -> {
boolean enable = e.getActionCommand().equals("User Defined");
universeSelectionTextField.setEnabled(enable);
};
gmtRadioButton = new JRadioButton();
gmtRadioButton.setActionCommand("GMT");
gmtRadioButton.addActionListener(universeSelectActionListener);
gmtRadioButton.setSelected(true);
expressionSetRadioButton = new JRadioButton();
expressionSetRadioButton.setActionCommand("Expression Set");
expressionSetRadioButton.addActionListener(universeSelectActionListener);
intersectionRadioButton = new JRadioButton();
intersectionRadioButton.setActionCommand("Intersection");
intersectionRadioButton.addActionListener(universeSelectActionListener);
userDefinedRadioButton = new JRadioButton("User Defined:");
userDefinedRadioButton.setActionCommand("User Defined");
userDefinedRadioButton.addActionListener(universeSelectActionListener);
ButtonGroup buttonGroup = new ButtonGroup();
buttonGroup.add(gmtRadioButton);
buttonGroup.add(expressionSetRadioButton);
buttonGroup.add(intersectionRadioButton);
buttonGroup.add(userDefinedRadioButton);
DecimalFormat intFormat = new DecimalFormat();
intFormat.setParseIntegerOnly(true);
universeSelectionTextField = new JFormattedTextField(intFormat);
universeSelectionTextField.addPropertyChangeListener("value", e -> {
Number val = (Number) universeSelectionTextField.getValue();
if (val == null || val.intValue() < 0) {
universeSelectionTextField.setValue(1);
CySwingApplication application = serviceRegistrar.getService(CySwingApplication.class);
JOptionPane.showMessageDialog(application.getJFrame(), "Universe value must be greater than zero", "Parameter out of bounds", JOptionPane.WARNING_MESSAGE);
}
});
universeSelectionTextField.setEnabled(false);
gmtRadioButton.setText("GMT");
expressionSetRadioButton.setText("Expression Set");
intersectionRadioButton.setText("Intersection");
universeSelectionTextField.setValue(0);
makeSmall(gmtRadioButton, expressionSetRadioButton, intersectionRadioButton, userDefinedRadioButton, universeSelectionTextField);
JPanel panel = new JPanel();
panel.setBorder(LookAndFeelUtil.createTitledBorder("Advanced Hypergeometric Universe"));
final GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
layout.setAutoCreateContainerGaps(true);
layout.setAutoCreateGaps(!LookAndFeelUtil.isAquaLAF());
layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING, true).addComponent(gmtRadioButton).addComponent(expressionSetRadioButton).addComponent(intersectionRadioButton).addGroup(layout.createSequentialGroup().addComponent(userDefinedRadioButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addPreferredGap(ComponentPlacement.RELATED).addComponent(universeSelectionTextField, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE)));
layout.setVerticalGroup(layout.createSequentialGroup().addComponent(gmtRadioButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(expressionSetRadioButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(intersectionRadioButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addGroup(layout.createParallelGroup(Alignment.CENTER, false).addComponent(userDefinedRadioButton, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(universeSelectionTextField, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE)));
if (LookAndFeelUtil.isAquaLAF())
panel.setOpaque(false);
return panel;
}
use of javax.swing.GroupLayout in project EnrichmentMapApp by BaderLab.
the class CardDialog method createChooserPanel.
private JPanel createChooserPanel(List<CardDialogPage> pages) {
JLabel label = new JLabel(params.getPageChooserLabelText());
pageChooserCombo = new JComboBox<>();
for (CardDialogPage page : pages) {
pageChooserCombo.addItem(new ComboItem<>(page, page.getPageComboText()));
}
SwingUtil.makeSmall(label, pageChooserCombo);
JPanel panel = new JPanel();
final GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
layout.setAutoCreateContainerGaps(true);
layout.setAutoCreateGaps(true);
layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(label).addComponent(pageChooserCombo).addGap(0, 0, Short.MAX_VALUE));
layout.setVerticalGroup(layout.createParallelGroup(Alignment.CENTER, true).addComponent(label).addComponent(pageChooserCombo, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE));
panel.setBorder(LookAndFeelUtil.createPanelBorder());
if (LookAndFeelUtil.isAquaLAF())
panel.setOpaque(false);
return panel;
}
use of javax.swing.GroupLayout in project EnrichmentMapApp by BaderLab.
the class SliderBarPanel method init.
@SuppressWarnings("unchecked")
protected void init() {
JLabel titleLabel = new JLabel(title);
titleLabel.setVisible(title != null && !title.trim().isEmpty());
makeSmall(titleLabel, getSlider(), getTextField());
final GroupLayout layout = new GroupLayout(this);
this.setLayout(layout);
layout.setAutoCreateContainerGaps(false);
layout.setAutoCreateGaps(!LookAndFeelUtil.isAquaLAF());
layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING, true).addComponent(titleLabel).addGroup(layout.createSequentialGroup().addComponent(getSlider(), DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE).addComponent(getTextField(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE)));
layout.setVerticalGroup(layout.createSequentialGroup().addComponent(titleLabel, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addGroup(layout.createParallelGroup(Alignment.LEADING, true).addComponent(getSlider(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getTextField(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE)));
if (LookAndFeelUtil.isAquaLAF())
setOpaque(false);
// Change the slider's label sizes -- only works if it's done after the slider has been added to
// its parent container and had its UI assigned
final Font tickFont = getSlider().getFont().deriveFont(getSmallFontSize());
final Dictionary<Integer, JLabel> labelTable = getSlider().getLabelTable();
for (Enumeration<Integer> enumeration = labelTable.keys(); enumeration.hasMoreElements(); ) {
int k = enumeration.nextElement();
final JLabel label = labelTable.get(k);
// Updates the font size
label.setFont(tickFont);
// Updates the label size and slider layout
label.setSize(label.getPreferredSize());
}
revalidate();
}
use of javax.swing.GroupLayout in project EnrichmentMapApp by BaderLab.
the class PostAnalysisInputPanel method createAnalysisTypePanel.
/**
* Creates a JPanel containing scope radio buttons
*/
private JPanel createAnalysisTypePanel() {
makeSmall(getKnownSignatureRadio(), getSignatureDiscoveryRadio());
ButtonGroup analysisOptions = new ButtonGroup();
analysisOptions.add(getKnownSignatureRadio());
analysisOptions.add(getSignatureDiscoveryRadio());
JPanel panel = new JPanel();
panel.setBorder(LookAndFeelUtil.createTitledBorder("Post Analysis Type"));
final GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
layout.setAutoCreateContainerGaps(true);
layout.setAutoCreateGaps(true);
layout.setHorizontalGroup(layout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE).addComponent(getKnownSignatureRadio()).addComponent(getSignatureDiscoveryRadio()).addGap(0, 0, Short.MAX_VALUE));
layout.setVerticalGroup(layout.createParallelGroup(Alignment.CENTER, true).addComponent(getKnownSignatureRadio(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE).addComponent(getSignatureDiscoveryRadio(), PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE));
if (LookAndFeelUtil.isAquaLAF())
panel.setOpaque(false);
return panel;
}
use of javax.swing.GroupLayout in project zaproxy by zaproxy.
the class DialogAddAutoTagScanner method getFieldsPanel.
@Override
protected JPanel getFieldsPanel() {
JPanel fieldsPanel = new JPanel();
GroupLayout layout = new GroupLayout(fieldsPanel);
fieldsPanel.setLayout(layout);
layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
JLabel nameLabel = new JLabel(NAME_FIELD_LABEL);
JLabel typeLabel = new JLabel(TYPE_FIELD_LABEL);
JLabel configurationLabel = new JLabel(CONFIGURATION_FIELD_LABEL);
JLabel requestUrlRegexLabel = new JLabel(REQUEST_URL_REGEX_FIELD_LABEL);
JLabel requestHeaderRegexLabel = new JLabel(REQUEST_HEADER_REGEX_FIELD_LABEL);
JLabel responseHeaderRegexLabel = new JLabel(RESPONSE_HEADER_REGEX_FIELD_LABEL);
JLabel responseBodyRegexLabel = new JLabel(RESPONSE_BODY_REGEX_FIELD_LABEL);
JLabel enabledLabel = new JLabel(ENABLED_FIELD_LABEL);
layout.setHorizontalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(nameLabel).addComponent(typeLabel).addComponent(configurationLabel).addComponent(requestUrlRegexLabel).addComponent(requestHeaderRegexLabel).addComponent(responseHeaderRegexLabel).addComponent(responseBodyRegexLabel).addComponent(enabledLabel)).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(getNameTextField()).addComponent(getTypeTextField()).addComponent(getConfigurationTextField()).addComponent(getRequestUrlRegexTextField()).addComponent(getRequestHeaderRegexTextField()).addComponent(getResponseHeaderRegexTextField()).addComponent(getResponseBodyRegexTextField()).addComponent(getEnabledCheckBox())));
layout.setVerticalGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(nameLabel).addComponent(getNameTextField())).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(typeLabel).addComponent(getTypeTextField())).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(configurationLabel).addComponent(getConfigurationTextField())).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(requestUrlRegexLabel).addComponent(getRequestUrlRegexTextField())).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(requestHeaderRegexLabel).addComponent(getRequestHeaderRegexTextField())).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(responseHeaderRegexLabel).addComponent(getResponseHeaderRegexTextField())).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(responseBodyRegexLabel).addComponent(getResponseBodyRegexTextField())).addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(enabledLabel).addComponent(getEnabledCheckBox())));
return fieldsPanel;
}
Aggregations