From 7c12f8eb9879172c5c437143ca5eb811a8daf5c7 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Fri, 24 Feb 2006 11:44:02 +0000 Subject: [PATCH] Features now an array --- src/jalview/gui/Jalview2XML.java | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index e387967..7e2d1dd 100755 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -195,20 +195,21 @@ public class Jalview2XML if(jal.getSequenceAt(i).getDatasetSequence().getSequenceFeatures()!=null) { - Enumeration en = jal.getSequenceAt(i).getDatasetSequence().getSequenceFeatures().elements(); - while(en.hasMoreElements()) + jalview.datamodel.SequenceFeature[] sf + = jal.getSequenceAt(i).getDatasetSequence().getSequenceFeatures(); + int index = 0; + while(index < sf.length) { Features features = new Features(); - jalview.datamodel.SequenceFeature sf - = (jalview.datamodel.SequenceFeature)en.nextElement(); - - features.setBegin(sf.getBegin()); - features.setEnd(sf.getEnd()); - features.setDescription(sf.getDescription()); - features.setStatus(sf.getStatus()); - features.setType(sf.getType()); - features.setFeatureGroup(sf.getFeatureGroup()); + + features.setBegin(sf[index].getBegin()); + features.setEnd(sf[index].getEnd()); + features.setDescription(sf[index].getDescription()); + features.setStatus(sf[index].getStatus()); + features.setType(sf[index].getType()); + features.setFeatureGroup(sf[index].getFeatureGroup()); jseq.addFeatures(features); + index ++; } } @@ -458,7 +459,7 @@ public class Jalview2XML view.setShowText(av.getShowText()); view.setWrapAlignment(av.getWrapAlignment()); - if(af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed!=null) + if(av.featuresDisplayed!=null) { jalview.binding.FeatureSettings fs = new jalview.binding.FeatureSettings(); @@ -472,7 +473,7 @@ public class Jalview2XML af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().getColour(type).getRGB() ); setting.setDisplay( - af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed.contains(type) + av.featuresDisplayed.contains(type) ); fs.addSetting(setting); @@ -887,7 +888,7 @@ public class Jalview2XML if(jms.getFeatureSettings()!=null) { - af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed = new Vector(); + af.viewport.featuresDisplayed = new Hashtable(); // af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featuresDisplayed!=null) // jalview.binding.FeatureSettings fs = new jalview.binding.FeatureSettings(); for(int fs=0; fs