From 836c80393a86ef51b1d2c6f763c3bc50274e7c96 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 10 May 2007 07:14:18 +0000 Subject: [PATCH] Visible state of annotation --- src/jalview/gui/Jalview2XML.java | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 9bf6a21..aa1abb3 100755 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -520,6 +520,8 @@ public class Jalview2XML continue; } + an.setVisible(aa[i].visible); + an.setDescription(aa[i].description); if (aa[i].sequenceRef != null) @@ -1361,6 +1363,9 @@ public class Jalview2XML for (int aa = 0; aa < ae.length && aa < anot.length; aa++) { + if(ae[aa].getPosition()>=anot.length) + continue; + anot[ae[aa].getPosition()] = new jalview.datamodel.Annotation( ae[aa].getDisplayCharacter(), @@ -1411,15 +1416,22 @@ public class Jalview2XML if (an[i].getSequenceRef() != null) { - jaa.createSequenceMapping( - al.findName(an[i].getSequenceRef()), 1, true - ); - al.findName(an[i].getSequenceRef()).addAlignmentAnnotation(jaa); + if (al.findName(an[i].getSequenceRef()) != null) + { + jaa.createSequenceMapping( + al.findName(an[i].getSequenceRef()), 1, true + ); + al.findName(an[i].getSequenceRef()).addAlignmentAnnotation(jaa); + } } if (an[i].hasScore()) { jaa.setScore(an[i].getScore()); } + + if(an[i].hasVisible()) + jaa.visible = an[i].getVisible(); + al.addAnnotation(jaa); } } -- 1.7.10.2