patch for JAL-729 - NPE avoided and cut and paste import pane is opened
authorjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 30 Aug 2011 15:12:04 +0000 (16:12 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Tue, 30 Aug 2011 15:12:04 +0000 (16:12 +0100)
src/jalview/appletgui/AlignFrame.java

index d2b04f9..7030637 100644 (file)
@@ -1032,7 +1032,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 \r
   private Hashtable getDisplayedFeatureCols()\r
   {\r
-    if (alignPanel.getFeatureRenderer() != null)\r
+    if (alignPanel.getFeatureRenderer() != null && viewport.featuresDisplayed!=null)\r
     {\r
       FeatureRenderer fr = alignPanel.getFeatureRenderer();\r
       Hashtable fcols = new Hashtable();\r
@@ -1065,12 +1065,25 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 \r
     if (displayTextbox)\r
     {\r
-      CutAndPasteTransfer cap = new CutAndPasteTransfer(false, this);\r
+      boolean frimport=false;\r
+      if (features==null || features.equals("No Features Visible"))\r
+      {\r
+        features = "# No features visible - paste some and import them here.";\r
+        frimport=true;\r
+      }\r
+      \r
+      CutAndPasteTransfer cap = new CutAndPasteTransfer(frimport, this);\r
+      if (frimport)\r
+      {\r
+        cap.setAnnotationImport();\r
+      }\r
       Frame frame = new Frame();\r
       frame.add(cap);\r
       jalview.bin.JalviewLite.addFrame(frame, "Features", 600, 500);\r
-\r
       cap.setText(features);\r
+    } else {\r
+      if (features==null)\r
+        features = "";\r
     }\r
 \r
     return features;\r