use of javax.swing.JPanel in project EnrichmentMapApp by BaderLab.
the class MannWhitneyRanksDialog method createDataSetPanel.
private JPanel createDataSetPanel() {
JPanel panel = new JPanel(new GridBagLayout());
panel.setBorder(LookAndFeelUtil.createTitledBorder("Select ranks to use for each data set."));
int y = 0;
List<EMDataSet> dataSets = getDataSets();
for (EMDataSet dataset : dataSets) {
final String dataSetName = dataset.getName();
JLabel label = new JLabel(dataSetName + ":");
JComboBox<String> combo = new JComboBox<>();
for (String ranksName : dataset.getExpressionSets().getAllRanksNames()) {
combo.addItem(ranksName);
}
SwingUtil.makeSmall(label, combo);
if (combo.getItemCount() <= 1) {
combo.setEnabled(false);
}
combo.addActionListener(e -> {
String ranks = combo.getSelectedItem().toString();
results.put(dataSetName, ranks);
});
results.put(dataSetName, combo.getSelectedItem().toString());
panel.add(label, GBCFactory.grid(0, y).weightx(.5).anchor(EAST).fill(NONE).get());
panel.add(combo, GBCFactory.grid(1, y).weightx(.5).get());
y++;
}
return panel;
}
use of javax.swing.JPanel in project EnrichmentMapApp by BaderLab.
the class MannWhitneyRanksDialog method createButtonPanel.
private JPanel createButtonPanel() {
JButton okButton = new JButton(new AbstractAction("OK") {
public void actionPerformed(ActionEvent e) {
dispose();
}
});
JButton cancelButton = new JButton(new AbstractAction("Cancel") {
public void actionPerformed(ActionEvent e) {
cancelled = true;
dispose();
}
});
JPanel buttonPanel = LookAndFeelUtil.createOkCancelPanel(okButton, cancelButton);
LookAndFeelUtil.setDefaultOkCancelKeyStrokes(getRootPane(), okButton.getAction(), cancelButton.getAction());
getRootPane().setDefaultButton(okButton);
//okButton.setEnabled(false);
return buttonPanel;
}
use of javax.swing.JPanel in project EnrichmentMapApp by BaderLab.
the class PostAnalysisInputPanel method createNamePanel.
private JPanel createNamePanel() {
nameText = new JTextField();
makeSmall(nameText);
JPanel panel = new JPanel();
panel.setBorder(LookAndFeelUtil.createTitledBorder("Data Set Name (optional)"));
final GroupLayout layout = new GroupLayout(panel);
panel.setLayout(layout);
layout.setAutoCreateContainerGaps(true);
layout.setAutoCreateGaps(!LookAndFeelUtil.isAquaLAF());
layout.setHorizontalGroup(layout.createSequentialGroup().addComponent(nameText, DEFAULT_SIZE, DEFAULT_SIZE, Short.MAX_VALUE));
layout.setVerticalGroup(layout.createParallelGroup(Alignment.CENTER, false).addComponent(nameText, PREFERRED_SIZE, DEFAULT_SIZE, PREFERRED_SIZE));
if (LookAndFeelUtil.isAquaLAF())
panel.setOpaque(false);
return panel;
}
use of javax.swing.JPanel in project EnrichmentMapApp by BaderLab.
the class LegendPanelMediator method init.
@AfterInjection
@SuppressWarnings("serial")
private void init() {
invokeOnEDTAndWait(() -> {
dialog = new JDialog(swingApplication.getJFrame(), "EnrichmentMap Legend", ModalityType.MODELESS);
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
dialog.setMinimumSize(new Dimension(440, 380));
JButton closeButton = new JButton(new AbstractAction("Close") {
@Override
public void actionPerformed(ActionEvent e) {
dialog.dispose();
}
});
creationParamsButton.addActionListener(e -> showCreationParamsDialog());
JPanel bottomPanel = LookAndFeelUtil.createOkCancelPanel(null, closeButton, creationParamsButton);
dialog.getContentPane().add(legendPanelProvider.get(), BorderLayout.CENTER);
dialog.getContentPane().add(bottomPanel, BorderLayout.SOUTH);
LookAndFeelUtil.setDefaultOkCancelKeyStrokes(dialog.getRootPane(), null, closeButton.getAction());
dialog.getRootPane().setDefaultButton(closeButton);
dialog.setLocationRelativeTo(swingApplication.getJFrame());
});
}
use of javax.swing.JPanel in project EnrichmentMapApp by BaderLab.
the class EdgeWidthDialog method createButtonPanel.
private JPanel createButtonPanel() {
JButton restoreDefaultsButton = new JButton("Restore Defaults");
restoreDefaultsButton.addActionListener(e -> {
setTextFieldValues(EdgeWidthParams.defaultValues());
});
JButton cancelButton = new JButton(new AbstractAction("Cancel") {
@Override
public void actionPerformed(ActionEvent e) {
dispose();
}
});
JButton okButton = new JButton(new AbstractAction("OK") {
@Override
public void actionPerformed(ActionEvent e) {
double emLowerWidth = ((Number) emLowerWidthText.getValue()).doubleValue();
double emUpperWidth = ((Number) emUpperWidthText.getValue()).doubleValue();
double lessThan100 = ((Number) lessThan100Text.getValue()).doubleValue();
double lessThan10 = ((Number) lessThan10Text.getValue()).doubleValue();
double greaterThan = ((Number) greaterThanText.getValue()).doubleValue();
EdgeWidthParams params = new EdgeWidthParams(emLowerWidth, emUpperWidth, lessThan100, lessThan10, greaterThan);
params.save(network);
Task task = new Task() {
public void run(TaskMonitor taskMonitor) throws Exception {
taskMonitor.setTitle("EnrichmentMap");
taskMonitor.setStatusMessage("Calculating Post-Analysis Edge Widths");
WidthFunction widthFunction = widthFunctionProvider.get();
widthFunction.setEdgeWidths(network, prefix, taskMonitor);
}
public void cancel() {
}
};
taskManager.execute(new TaskIterator(task));
dispose();
}
});
JPanel bottomPanel = LookAndFeelUtil.createOkCancelPanel(okButton, cancelButton, restoreDefaultsButton);
LookAndFeelUtil.setDefaultOkCancelKeyStrokes(getRootPane(), okButton.getAction(), cancelButton.getAction());
getRootPane().setDefaultButton(okButton);
return bottomPanel;
}
Aggregations