From 7724430e3293cbb862d0c50c5308a3b3b0417cac Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 25 Jan 2007 16:00:41 +0000 Subject: [PATCH 1/1] Output annotations --- src/jalview/appletgui/AlignFrame.java | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index 479d771..4115999 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -502,7 +502,7 @@ public void itemStateChanged(ItemEvent evt) else if (source == loadAnnotations) loadAnnotations(); else if (source == outputAnnotations) - outputAnnotations(); + outputAnnotations(true); else if(source == outputFeatures) outputFeatures(true, "Jalview"); else if(source==closeMenuItem) @@ -670,16 +670,24 @@ public void itemStateChanged(ItemEvent evt) } - public void outputAnnotations() + public String outputAnnotations(boolean displayTextbox) { - CutAndPasteTransfer cap = new CutAndPasteTransfer(false, this); - Frame frame = new Frame(); - frame.add(cap); - jalview.bin.JalviewLite.addFrame(frame, - "Annotations", - 600, 500); - cap.setText( new AnnotationFile().printAnnotations( - viewport.alignment.getAlignmentAnnotation() ) ); + String annotation = new AnnotationFile().printAnnotations( + viewport.alignment.getAlignmentAnnotation() ); + + if(displayTextbox) + { + + CutAndPasteTransfer cap = new CutAndPasteTransfer(false, this); + Frame frame = new Frame(); + frame.add(cap); + jalview.bin.JalviewLite.addFrame(frame, + "Annotations", + 600, 500); + cap.setText(annotation); + } + + return annotation; } public String outputFeatures(boolean displayTextbox, String format) -- 1.7.10.2