Cut and paste changes
authoramwaterhouse <Andrew Waterhouse>
Fri, 27 May 2005 14:06:36 +0000 (14:06 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 27 May 2005 14:06:36 +0000 (14:06 +0000)
src/jalview/gui/Desktop.java

index 0548646..0dbfe9b 100755 (executable)
@@ -277,38 +277,8 @@ this.setDropTarget(new java.awt.dnd.DropTarget(desktop, this));
  public void inputTextboxMenuItem_actionPerformed(ActionEvent e)\r
  {\r
    CutAndPasteTransfer cap = new CutAndPasteTransfer();\r
-   int accept =  JOptionPane.showInternalOptionDialog(Desktop.desktop, cap, "Cut & paste Alignment File",\r
-                                       JOptionPane.YES_NO_CANCEL_OPTION,\r
-                                       JOptionPane.PLAIN_MESSAGE,\r
-                                       null,\r
-                                       new Object[]{"Accept", "Cancel", }, null);\r
-\r
-\r
-  if(accept == JOptionPane.YES_OPTION)\r
-  {\r
-    String format = IdentifyFile.Identify(cap.getText(), "Paste");\r
-    SequenceI [] sequences = null;\r
-\r
-    if (FormatAdapter.formats.contains( format ))\r
-      sequences = FormatAdapter.readFile(cap.getText(), "Paste", format);\r
-\r
-\r
-      if(sequences!=null)\r
-      {\r
-        AlignFrame af = new AlignFrame(new Alignment(sequences));\r
-        af.currentFileFormat = format;\r
-        addInternalFrame(af, "Cut & Paste input - "+format,\r
-                         AlignFrame.NEW_WINDOW_WIDTH,\r
-                         AlignFrame.NEW_WINDOW_HEIGHT);\r
-        af.statusBar.setText("Successfully pasted alignment file");\r
-      }\r
-      else\r
-        JOptionPane.showInternalMessageDialog(Desktop.desktop, "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
-   }\r
+   cap.setForInput();\r
+   Desktop.addInternalFrame(cap, "Cut & Paste Alignment File", 600, 500);\r
  }\r
 \r
 /*\r