closes if accepted
authoramwaterhouse <Andrew Waterhouse>
Mon, 6 Jun 2005 10:00:32 +0000 (10:00 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 6 Jun 2005 10:00:32 +0000 (10:00 +0000)
src/jalview/gui/CutAndPasteTransfer.java
src/jalview/jbgui/GCutAndPasteTransfer.java

index 327609a..5f615f4 100755 (executable)
@@ -66,17 +66,31 @@ public class CutAndPasteTransfer extends GCutAndPasteTransfer
         {
           AlignFrame af = new AlignFrame(new Alignment(sequences));
           af.currentFileFormat = format;
-          Desktop.addInternalFrame(af, "Cut & Paste input - "+format,
-                           AlignFrame.NEW_WINDOW_WIDTH,
-                           AlignFrame.NEW_WINDOW_HEIGHT);
+          Desktop.addInternalFrame(af, "Cut & Paste input - " + format,
+                                   AlignFrame.NEW_WINDOW_WIDTH,
+                                   AlignFrame.NEW_WINDOW_HEIGHT);
           af.statusBar.setText("Successfully pasted alignment file");
+          try
+          {  af.setMaximum(Preferences.showFullscreen);    }
+          catch (Exception ex)
+          {}
+          try
+          {
+            this.setClosed(true);
+          }
+          catch (Exception ex)
+          {}
+
+
         }
         else
-          JOptionPane.showInternalMessageDialog(Desktop.desktop, "Couldn't read the pasted text.\n"
-                                        +"Formats currently supported are\n"
-                                        +"Fasta, MSF, Clustal, BLC, PIR, MSP, and PFAM",
-                                        "Error parsing text", JOptionPane.WARNING_MESSAGE);
-
+          JOptionPane.showInternalMessageDialog(Desktop.desktop,
+                                                "Couldn't read the pasted text.\n"
+                                                + "Formats currently supported are\n"
+                                                +
+              "Fasta, MSF, Clustal, BLC, PIR, MSP, and PFAM",
+                                                "Error parsing text",
+                                                JOptionPane.WARNING_MESSAGE);
   }
 
   public void cancel_actionPerformed(ActionEvent e)
index 32fb570..e9a0164 100755 (executable)
@@ -11,7 +11,9 @@ package jalview.jbgui;
 import javax.swing.*;\r
 import java.awt.*;\r
 import java.awt.event.*;\r
-\r
+import java.beans.VetoableChangeListener;\r
+import java.beans.PropertyChangeEvent;\r
+import java.beans.PropertyVetoException;\r
 \r
 public class GCutAndPasteTransfer extends JInternalFrame\r
 {\r
@@ -60,9 +62,23 @@ public class GCutAndPasteTransfer extends JInternalFrame
       }\r
     });\r
     textarea.setBorder(null);\r
+    textarea.addVetoableChangeListener(new VetoableChangeListener()\r
+    {\r
+      public void vetoableChange(PropertyChangeEvent evt)\r
+      {\r
+        try\r
+        {\r
+          textarea_vetoableChange(evt);\r
+        }\r
+        catch (java.beans.PropertyVetoException exception0)\r
+        {\r
+          exception0.printStackTrace();\r
+        }\r
+\r
+      }\r
+    });\r
     editMenubar.add(editMenu);\r
     textarea.setFont(new java.awt.Font("Verdana", 0, 12));\r
-    textarea.setText("Paste your alignment file here");\r
     textarea.addMouseListener(new java.awt.event.MouseAdapter()\r
     {\r
       public void mousePressed(MouseEvent e)\r
@@ -124,4 +140,10 @@ public class GCutAndPasteTransfer extends JInternalFrame
 \r
   }\r
 \r
+  public void textarea_vetoableChange(PropertyChangeEvent evt)\r
+      throws PropertyVetoException\r
+  {\r
+\r
+  }\r
+\r
 }\r