From 770bcd6eedfcb6329d0e1310502a0a03c7279b18 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Sun, 18 Jan 2015 15:43:17 +0000 Subject: [PATCH] JAL-1628 employ new AnnotationFile reader method to allow the current view's ColumnSelection to be modified --- src/jalview/appletgui/CutAndPasteTransfer.java | 4 ++-- src/jalview/bin/JalviewLite.java | 8 ++++---- src/jalview/gui/AlignFrame.java | 2 +- src/jalview/io/packed/ParsePackedSet.java | 3 ++- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/jalview/appletgui/CutAndPasteTransfer.java b/src/jalview/appletgui/CutAndPasteTransfer.java index 636dd7f..ce2a3ac 100644 --- a/src/jalview/appletgui/CutAndPasteTransfer.java +++ b/src/jalview/appletgui/CutAndPasteTransfer.java @@ -203,8 +203,8 @@ public class CutAndPasteTransfer extends Panel implements ActionListener, } if (tcf == null) { - if (new AnnotationFile().readAnnotationFile( - alignFrame.viewport.getAlignment(), textarea.getText(), + if (new AnnotationFile().annotateAlignmentView(alignFrame.viewport, + textarea.getText(), jalview.io.AppletFormatAdapter.PASTE)) { alignFrame.alignPanel.fontChanged(); diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 833dd7e..dab649e 100644 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -709,8 +709,8 @@ public class JalviewLite extends Applet implements */ public void loadAnnotationFrom(AlignFrame alf, String annotation) { - if (new AnnotationFile().readAnnotationFile(alf.getAlignViewport() - .getAlignment(), annotation, AppletFormatAdapter.PASTE)) + if (new AnnotationFile().annotateAlignmentView(alf.getAlignViewport(), + annotation, AppletFormatAdapter.PASTE)) { alf.alignPanel.fontChanged(); alf.alignPanel.setScrollValues(0, 0); @@ -1999,8 +1999,8 @@ public class JalviewLite extends Applet implements { param = setProtocolState(param); - if (new AnnotationFile().readAnnotationFile( - newAlignFrame.viewport.getAlignment(), param, protocol)) + if (new AnnotationFile().annotateAlignmentView( + newAlignFrame.viewport, param, protocol)) { newAlignFrame.alignPanel.fontChanged(); newAlignFrame.alignPanel.setScrollValues(0, 0); diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 269e103..5c42418 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -5148,7 +5148,7 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener, // try to parse as annotation. boolean isAnnotation = (format == null || format .equalsIgnoreCase("PFAM")) ? new AnnotationFile() - .readAnnotationFile(viewport.getAlignment(), file, protocol) + .annotateAlignmentView(viewport, file, protocol) : false; if (!isAnnotation) diff --git a/src/jalview/io/packed/ParsePackedSet.java b/src/jalview/io/packed/ParsePackedSet.java index df1acf1..8980e2c 100644 --- a/src/jalview/io/packed/ParsePackedSet.java +++ b/src/jalview/io/packed/ParsePackedSet.java @@ -123,8 +123,9 @@ public class ParsePackedSet { br = new BufferedReader(src.getReader()); } + // TODO: add columnSelection to context if (new jalview.io.AnnotationFile().parseAnnotationFrom( - context.getLastAlignment(), br)) + context.getLastAlignment(), null, br)) { context.updateSetModified(true); } -- 1.7.10.2