From ca812007f560910bab66a186420d8fde7cb461cf Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 30 Aug 2011 16:12:04 +0100 Subject: [PATCH] patch for JAL-729 - NPE avoided and cut and paste import pane is opened --- src/jalview/appletgui/AlignFrame.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index d2b04f9..7030637 100644 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -1032,7 +1032,7 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, private Hashtable getDisplayedFeatureCols() { - if (alignPanel.getFeatureRenderer() != null) + if (alignPanel.getFeatureRenderer() != null && viewport.featuresDisplayed!=null) { FeatureRenderer fr = alignPanel.getFeatureRenderer(); Hashtable fcols = new Hashtable(); @@ -1065,12 +1065,25 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener, if (displayTextbox) { - CutAndPasteTransfer cap = new CutAndPasteTransfer(false, this); + boolean frimport=false; + if (features==null || features.equals("No Features Visible")) + { + features = "# No features visible - paste some and import them here."; + frimport=true; + } + + CutAndPasteTransfer cap = new CutAndPasteTransfer(frimport, this); + if (frimport) + { + cap.setAnnotationImport(); + } Frame frame = new Frame(); frame.add(cap); jalview.bin.JalviewLite.addFrame(frame, "Features", 600, 500); - cap.setText(features); + } else { + if (features==null) + features = ""; } return features; -- 1.7.10.2