use of org.baderlab.csplugins.enrichmentmap.style.WidthFunction.EdgeWidthParams 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