Skip to content

Commit 1a46698

Browse files
committed
Merge branch 'master' of github.com:biojava/biojava
2 parents bef6130 + ea33b12 commit 1a46698

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

  • biojava3-structure-gui/src/main/java/org/biojava/bio/structure/align/gui

biojava3-structure-gui/src/main/java/org/biojava/bio/structure/align/gui/AlignmentGui.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,18 @@
2525

2626
import java.awt.Dimension;
2727
import java.awt.event.ActionEvent;
28+
import java.io.File;
2829
import java.util.logging.Logger;
30+
2931
import javax.swing.AbstractAction;
3032
import javax.swing.Action;
31-
32-
3333
import javax.swing.Box;
3434
import javax.swing.JButton;
3535
import javax.swing.JComboBox;
3636
import javax.swing.JFrame;
3737
import javax.swing.JLabel;
3838
import javax.swing.JMenuBar;
3939
import javax.swing.JOptionPane;
40-
4140
import javax.swing.JProgressBar;
4241
import javax.swing.JTabbedPane;
4342

@@ -51,7 +50,6 @@
5150
import org.biojava.bio.structure.align.util.ResourceManager;
5251
import org.biojava.bio.structure.align.util.UserConfiguration;
5352
import org.biojava.bio.structure.align.webstart.AligUIManager;
54-
5553
import org.biojava.bio.structure.align.webstart.WebStartMain;
5654
import org.biojava.bio.structure.gui.util.PDBUploadPanel;
5755
import org.biojava.bio.structure.gui.util.ScopSelectPanel;
@@ -442,7 +440,7 @@ private void calcDBSearch() {
442440
s = tab.getStructure1();
443441

444442
if ( s == null) {
445-
System.err.println("please select structure 1");
443+
JOptionPane.showMessageDialog(null,"please select structure 1");
446444
return ;
447445
}
448446

@@ -458,10 +456,18 @@ private void calcDBSearch() {
458456

459457
System.out.println("name1 in alig gui:" + name1);
460458
String file = dbsearch.getOutFileLocation();
461-
if ( file == null || file.equals("")){
459+
if ( file == null || file.equals("") ){
462460
JOptionPane.showMessageDialog(null,"Please select a directory to contain the DB search results.");
463461
return;
464462
}
463+
File outFile = new File(file);
464+
if( !outFile.exists() ) {
465+
outFile.mkdirs();
466+
}
467+
if( !outFile.isDirectory() || !outFile.canWrite()) {
468+
JOptionPane.showMessageDialog(null,"Unable to write to "+outFile.getAbsolutePath());
469+
return;
470+
}
465471

466472
UserConfiguration config = WebStartMain.getWebStartConfig();
467473

0 commit comments

Comments
 (0)