Skip to content

Commit 13716a3

Browse files
committed
Removing db-related gui tools
1 parent b3d6fba commit 13716a3

6 files changed

Lines changed: 1 addition & 1039 deletions

File tree

biojava-structure-gui/src/main/java/org/biojava/nbio/structure/align/gui/AlignmentCalcDB.java

Lines changed: 0 additions & 195 deletions
This file was deleted.

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

Lines changed: 0 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ public class AlignmentGui extends JFrame{
8282
JProgressBar progress;
8383

8484

85-
private DBSearchGUI dbsearch;
86-
87-
8885
public static void main(String[] args){
8986

9087
AlignmentGui.getInstance();
@@ -163,10 +160,6 @@ protected AlignmentGui() {
163160

164161
masterPane.addTab("Pairwise Comparison", vBox);
165162

166-
dbsearch = new DBSearchGUI();
167-
168-
masterPane.addTab("Database Search",dbsearch);
169-
170163
//JPanel dir = tab1.getPDBDirPanel(pdbDir);
171164

172165
Box vBoxMain = Box.createVerticalBox();
@@ -278,8 +271,6 @@ public void actionPerformed(ActionEvent evt) {
278271
int selectedIndex = masterPane.getSelectedIndex();
279272
if (selectedIndex == 0)
280273
calcAlignment();
281-
else if ( selectedIndex == 1)
282-
calcDBSearch();
283274
else {
284275
System.err.println("Unknown TAB: " + selectedIndex);
285276
}
@@ -408,110 +399,6 @@ private void calcAlignment() {
408399

409400
}
410401

411-
412-
private void calcDBSearch() {
413-
414-
JTabbedPane tabPane = dbsearch.getTabPane();
415-
System.out.println("run DB search " + tabPane.getSelectedIndex());
416-
417-
Structure s = null;
418-
boolean domainSplit = dbsearch.isDomainSplit();
419-
420-
StructurePairSelector tab = null;
421-
int pos = tabPane.getSelectedIndex();
422-
423-
if (pos == 0 ){
424-
425-
tab = dbsearch.getSelectPDBPanel();
426-
427-
} else if (pos == 1){
428-
429-
tab = dbsearch.getScopSelectPanel();
430-
431-
432-
} else if (pos == 2){
433-
434-
tab = dbsearch.getPDBUploadPanel();
435-
436-
}
437-
438-
try {
439-
440-
s = tab.getStructure1();
441-
442-
if ( s == null) {
443-
JOptionPane.showMessageDialog(null,"please select structure 1");
444-
return ;
445-
}
446-
447-
} catch (Exception e){
448-
e.printStackTrace();
449-
}
450-
451-
String name1 = s.getName();
452-
if ( name1 == null || name1.equals(""))
453-
name1 = s.getPDBCode();
454-
455-
456-
457-
System.out.println("name1 in alig gui:" + name1);
458-
String file = dbsearch.getOutFileLocation();
459-
if ( file == null || file.equals("") ){
460-
JOptionPane.showMessageDialog(null,"Please select a directory to contain the DB search results.");
461-
return;
462-
}
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-
}
471-
472-
UserConfiguration config = WebStartMain.getWebStartConfig();
473-
474-
int totalNrCPUs = Runtime.getRuntime().availableProcessors();
475-
476-
int useNrCPUs = 1;
477-
if ( totalNrCPUs > 1){
478-
Object[] options = new Integer[totalNrCPUs];
479-
int posX = 0;
480-
for ( int i = totalNrCPUs; i> 0 ; i--){
481-
options[posX] = i;
482-
posX++;
483-
}
484-
int n = JOptionPane.showOptionDialog(null,
485-
"How many would you like to use for the calculations?",
486-
"We detected " + totalNrCPUs + " processors on your system.",
487-
JOptionPane.OK_CANCEL_OPTION,
488-
JOptionPane.QUESTION_MESSAGE,
489-
null,
490-
options,
491-
options[0]);
492-
493-
if ( n < 0)
494-
return;
495-
useNrCPUs = (Integer) options[n];
496-
System.out.println("will use " + useNrCPUs + " CPUs." );
497-
}
498-
System.out.println("using domainSplit data");
499-
alicalc = new AlignmentCalcDB(this, s, name1,config,file, domainSplit);
500-
alicalc.setNrCPUs(useNrCPUs);
501-
abortB.setEnabled(true);
502-
progress.setIndeterminate(true);
503-
ProgressThreadDrawer drawer = new ProgressThreadDrawer(progress);
504-
drawer.start();
505-
506-
Thread t = new Thread(alicalc);
507-
t.start();
508-
}
509-
510-
511-
public DBSearchGUI getDBSearch(){
512-
return dbsearch;
513-
}
514-
515402
public void notifyCalcFinished(){
516403
abortB.setEnabled(false);
517404
thread = null;

0 commit comments

Comments
 (0)