X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FJalview2XML.java;h=f0551e89fa6f4a7f7ed9701b036d470be54aeffa;hb=def10fb2252c67e8256ec1fddc6605e34d760c63;hp=eda5eacd555a93b6a08d5e94290e831f9a7f671f;hpb=de337ac6b1859d64049325520bae15ae737345a8;p=jalview.git diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index eda5eac..f0551e8 100755 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -530,32 +530,40 @@ public class Jalview2XML } an.setLabel(aa[i].label); - + if (aa[i].hasScore()) + { + an.setScore(aa[i].getScore()); + } AnnotationElement ae; - - for (int a = 0; a < aa[i].annotations.length; a++) + if (aa[i].annotations!=null) { - if ( (aa[i] == null) || (aa[i].annotations[a] == null)) + an.setScoreOnly(false); + for (int a = 0; a < aa[i].annotations.length; a++) { - continue; - } + if ((aa[i] == null) || (aa[i].annotations[a] == null)) + { + continue; + } - ae = new AnnotationElement(); - ae.setDescription(aa[i].annotations[a].description); - ae.setDisplayCharacter(aa[i].annotations[a].displayCharacter); - ae.setValue(aa[i].annotations[a].value); - ae.setPosition(a); - ae.setSecondaryStructure(aa[i].annotations[a].secondaryStructure + - ""); + ae = new AnnotationElement(); + ae.setDescription(aa[i].annotations[a].description); + ae.setDisplayCharacter(aa[i].annotations[a].displayCharacter); + ae.setValue(aa[i].annotations[a].value); + ae.setPosition(a); + ae + .setSecondaryStructure(aa[i].annotations[a].secondaryStructure + + ""); - if (aa[i].annotations[a].colour != java.awt.Color.black) - { - ae.setColour(aa[i].annotations[a].colour.getRGB()); - } + if (aa[i].annotations[a].colour != java.awt.Color.black) + { + ae.setColour(aa[i].annotations[a].colour.getRGB()); + } - an.addAnnotationElement(ae); + an.addAnnotationElement(ae); + } + } else { + an.setScoreOnly(true); } - vamsasSet.addAnnotation(an); } } @@ -1310,21 +1318,24 @@ public class Jalview2XML } AnnotationElement[] ae = an[i].getAnnotationElement(); - jalview.datamodel.Annotation[] anot = new jalview.datamodel.Annotation[ - al.getWidth()]; + jalview.datamodel.Annotation[] anot = null; + if (!an[i].getScoreOnly()) + { + anot = new jalview.datamodel.Annotation[ + al.getWidth()]; - for (int aa = 0; aa < ae.length && aa < anot.length; aa++) - { - anot[ae[aa].getPosition()] = new jalview.datamodel.Annotation(ae[aa]. - getDisplayCharacter(), - ae[aa].getDescription(), - ae[aa].getSecondaryStructure().length() == 0 ? ' ' : - ae[aa].getSecondaryStructure().charAt(0), - ae[aa].getValue()); - anot[ae[aa].getPosition()].colour = new java.awt.Color(ae[aa]. - getColour()); + for (int aa = 0; aa < ae.length && aa < anot.length; aa++) + { + anot[ae[aa].getPosition()] = new jalview.datamodel.Annotation(ae[aa]. + getDisplayCharacter(), + ae[aa].getDescription(), + ae[aa].getSecondaryStructure().length() == 0 ? ' ' : + ae[aa].getSecondaryStructure().charAt(0), + ae[aa].getValue()); + anot[ae[aa].getPosition()].colour = new java.awt.Color(ae[aa]. + getColour()); + } } - jalview.datamodel.AlignmentAnnotation jaa = null; if (an[i].getGraph()) @@ -1365,7 +1376,10 @@ public class Jalview2XML ); al.findName(an[i].getSequenceRef()).addAlignmentAnnotation(jaa); } - + if (an[i].hasScore()) + { + jaa.setScore(an[i].getScore()); + } al.addAnnotation(jaa); } }