- else\r
- JOptionPane.showInternalMessageDialog(Desktop.desktop, "Couldn't open file.\n"\r
- + "Formats currently supported are\n"\r
- + "Fasta, MSF, Clustal, BLC, PIR, MSP or PFAM"\r
- ,"Error loading file",\r
- JOptionPane.WARNING_MESSAGE);\r
+ public void run()\r
+ {\r
+ SequenceI [] sequences = null;\r
+\r
+ if (FormatAdapter.formats.contains(format))\r
+ sequences = FormatAdapter.readFile(file, protocol, format);\r
+\r
+ if (sequences != null && sequences.length>0)\r
+ {\r
+ AlignFrame af = new AlignFrame(new Alignment(sequences));\r
+ addInternalFrame(af, file, AlignFrame.NEW_WINDOW_WIDTH, AlignFrame.NEW_WINDOW_HEIGHT);\r
+ af.currentFileFormat = format;\r
+ af.statusBar.setText("Successfully loaded file " + file);\r
+ try{\r
+ af.setMaximum(Preferences.showFullscreen);\r
+ }catch(Exception ex){}\r
+\r
+ }\r
+ else\r
+ JOptionPane.showInternalMessageDialog(Desktop.desktop, "Couldn't open file.\n"\r
+ + "Formats currently supported are\n"\r
+ + "Fasta, MSF, Clustal, BLC, PIR, MSP, and PFAM" // JBPNote - message should be generated through FormatAdapter!\r
+ ,"Error loading file",\r
+ JOptionPane.WARNING_MESSAGE);\r