Skip to content

Commit 5c38118

Browse files
committed
Post Analysis dialog (Signature Discovery) is not closed anymore when clicking "Add" and it is not ready. Fixes a few "genesets" labels.
1 parent f3d1c95 commit 5c38118

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/view/postanalysis/PostAnalysisInputPanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ boolean isReady() {
314314
if (knownSignatureRadio.isSelected())
315315
return getKnownSignaturePanel().isReady();
316316
else
317-
return true;
317+
return getSignatureDiscoveryPanel().isReady();
318318
}
319319

320320
/**

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/view/postanalysis/PostAnalysisKnownSignaturePanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public boolean isReady() {
131131
String filePath = (String) knownSignatureGMTFileNameTextField.getValue();
132132

133133
if (!EnrichmentMapParameters.checkFile(filePath)) {
134-
String message = "Signature GMT file name not valid.\n";
134+
String message = "Signature GMT file name not valid.";
135135
knownSignatureGMTFileNameTextField.setForeground(Color.RED);
136136
JOptionPane.showMessageDialog(application.getJFrame(), message, "Post Analysis Known Signature", JOptionPane.WARNING_MESSAGE);
137137

EnrichmentMapPlugin/src/main/java/org/baderlab/csplugins/enrichmentmap/view/postanalysis/PostAnalysisSignatureDiscoveryPanel.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ private JPanel createSignatureGenesetsPanel() {
205205
availSigSetsField.addListSelectionListener(this);
206206
selectedSigSetsField.addListSelectionListener(this);
207207

208-
JButton clearButton = new JButton("Clear Signature Genesets");
208+
JButton clearButton = new JButton("Clear Signature Gene Sets");
209209

210210
clearButton.addActionListener(e -> {
211211
availSigSetsModel.clear();
@@ -222,7 +222,7 @@ private JPanel createSignatureGenesetsPanel() {
222222
makeSmall(addSelectedButton, removeSelectedButton, clearButton);
223223

224224
JPanel panel = new JPanel();
225-
panel.setBorder(LookAndFeelUtil.createTitledBorder("Signature Genesets"));
225+
panel.setBorder(LookAndFeelUtil.createTitledBorder("Signature Gene Sets"));
226226

227227
final GroupLayout layout = new GroupLayout(panel);
228228
panel.setLayout(layout);
@@ -329,7 +329,7 @@ private JPanel createSignatureDiscoveryGMTPanel() {
329329

330330
//TODO: Maybe move loading SigGMT to File-selection Event add load button
331331
JButton loadButton = new JButton();
332-
loadButton.setText("Load Genesets");
332+
loadButton.setText("Load Gene Sets");
333333
loadButton.addActionListener(e -> {
334334
String filePath = (String) signatureDiscoveryGMTFileNameTextField.getValue();
335335

@@ -502,4 +502,16 @@ public void setAvSigCount(int count) {
502502
public void setSelSigCount(int count) {
503503
selectedLabel.setText(String.format(SELECTED_FORMAT, count));
504504
}
505+
506+
public boolean isReady() {
507+
if (selectedSigSetsField == null || selectedSigSetsField.getModel().getSize() == 0) {
508+
String msg = "Please load and select gene sets first.";
509+
JOptionPane.showMessageDialog(
510+
application.getJFrame(), msg, "Post Analysis Signature Discovery", JOptionPane.WARNING_MESSAGE);
511+
512+
return false;
513+
}
514+
515+
return true;
516+
}
505517
}

0 commit comments

Comments
 (0)