- String format = IdentifyFile.Identify(getText(), "Paste");\r
- SequenceI[] sequences = null;\r
-\r
- if (FormatAdapter.formats.contains(format))\r
- {\r
- sequences = FormatAdapter.readFile(getText(), "Paste", format);\r
- }\r
-\r
- if (sequences != null)\r
- {\r
- AlignFrame af = new AlignFrame(new Alignment(sequences));\r
- af.currentFileFormat = format;\r
- Desktop.addInternalFrame(af, "Cut & Paste input - " + format,\r
- AlignFrame.NEW_WINDOW_WIDTH, AlignFrame.NEW_WINDOW_HEIGHT);\r
- af.statusBar.setText("Successfully pasted alignment file");\r
-\r
- try\r
- {\r
- af.setMaximum( jalview.bin.Cache.getDefault("SHOW_FULLSCREEN", false));\r
- }\r
- catch (Exception ex)\r
- {\r
- }\r
-\r
- try\r
- {\r
- this.setClosed(true);\r
- }\r
- catch (Exception ex)\r
- {\r
- }\r
- }\r
- else\r
- {\r
- JOptionPane.showInternalMessageDialog(Desktop.desktop,\r
- "Couldn't read the pasted text.\n" +\r
- "Formats currently supported are\n" +\r
- "Fasta, MSF, Clustal, BLC, PIR, MSP, and PFAM",\r
- "Error parsing text", JOptionPane.WARNING_MESSAGE);\r
- }\r