From aeb173dd7daa4559e760548d955ee83aac6828d8 Mon Sep 17 00:00:00 2001 From: jprocter Date: Fri, 3 Aug 2012 17:28:48 +0100 Subject: [PATCH] JAL-1136 JAL-811 JAL-812 store/recover autocalc alignment annotation based on calcId if present --- src/jalview/gui/Jalview2XML.java | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 4c042b3..7fb7f0b 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -3367,7 +3367,16 @@ public class Jalview2XML ); } } - + if (view.getCalcIdParam()!=null) + { + for (CalcIdParam calcIdParam:view.getCalcIdParam()) + { + if (recoverCalcIdParam(calcIdParam, af.viewport)) { + } else { + warn("Couldn't recover parameters for "+calcIdParam.getCalcId()); + } + } + } af.setMenusFromViewport(af.viewport); // TODO: we don't need to do this if the viewport is aready visible. Desktop.addInternalFrame(af, view.getTitle(), view.getWidth(), @@ -3397,10 +3406,13 @@ public class Jalview2XML } for (JvAnnotRow auan : autoAlan) { - visan.put(auan.template.label, auan); + visan.put(auan.template.label+(auan.template.getCalcId()==null ? "" : "\t"+auan.template.getCalcId()), auan); } int hSize = al.getAlignmentAnnotation().length; ArrayList reorder = new ArrayList(); + // work through any autoCalculated annotation already on the view + // removing it if it should be placed in a different location on the + // annotation panel. for (int h = 0; h < hSize; h++) { jalview.datamodel.AlignmentAnnotation jalan = al @@ -3408,10 +3420,15 @@ public class Jalview2XML if (jalan.autoCalculated) { JvAnnotRow valan = visan.get(jalan.label); + if (jalan.getCalcId()!=null) + { + valan = visan.get(jalan.label+ "\t"+jalan.getCalcId()); + } + if (valan != null) { // delete the auto calculated row from the alignment - al.deleteAnnotation(al.getAlignmentAnnotation()[h], false); + al.deleteAnnotation(jalan, false); hSize--; h--; if (valan != nullAnnot) -- 1.7.10.2