From 51f05d7903402a5dec8e915fbe5e49ce913d069a Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 22 Dec 2015 08:58:50 +0000 Subject: [PATCH] JAL-653 hold AlignedCodonFrame collections as list rather than set --- src/jalview/gui/Jalview2XML.java | 2 +- src/jalview/io/VamsasAppDatastore.java | 5 ++--- src/jalview/structure/StructureSelectionManager.java | 17 ++++++++++------- src/jalview/ws/AWSThread.java | 4 +++- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 7258b63..96abf81 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -880,7 +880,7 @@ public class Jalview2XML // SAVE MAPPINGS if (jal.getCodonFrames() != null) { - Set jac = jal.getCodonFrames(); + List jac = jal.getCodonFrames(); for (AlignedCodonFrame acf : jac) { AlcodonFrame alc = new AlcodonFrame(); diff --git a/src/jalview/io/VamsasAppDatastore.java b/src/jalview/io/VamsasAppDatastore.java index a093ebe..2c35547 100644 --- a/src/jalview/io/VamsasAppDatastore.java +++ b/src/jalview/io/VamsasAppDatastore.java @@ -43,7 +43,6 @@ import java.util.Hashtable; import java.util.IdentityHashMap; import java.util.Iterator; import java.util.List; -import java.util.Set; import java.util.Vector; import java.util.jar.JarInputStream; import java.util.jar.JarOutputStream; @@ -1433,7 +1432,7 @@ public class VamsasAppDatastore // to the align frames. boolean gathered = false; String newviewid = null; - Set mappings = av.getAlignment() + List mappings = av.getAlignment() .getCodonFrames(); for (int i = 0; i < views.length; i++) { @@ -2732,7 +2731,7 @@ public class VamsasAppDatastore } // Store any sequence mappings. - Set cframes = av.getAlignment().getCodonFrames(); + List cframes = av.getAlignment().getCodonFrames(); if (cframes != null) { for (AlignedCodonFrame acf : cframes) diff --git a/src/jalview/structure/StructureSelectionManager.java b/src/jalview/structure/StructureSelectionManager.java index 26b7d48..b497824 100644 --- a/src/jalview/structure/StructureSelectionManager.java +++ b/src/jalview/structure/StructureSelectionManager.java @@ -43,10 +43,8 @@ import java.util.Collections; import java.util.Enumeration; import java.util.HashMap; import java.util.IdentityHashMap; -import java.util.LinkedHashSet; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.Vector; import MCview.Atom; @@ -70,7 +68,7 @@ public class StructureSelectionManager /* * Set of any registered mappings between (dataset) sequences. */ - public Set seqmappings = new LinkedHashSet(); + private List seqmappings = new ArrayList(); private List commandListeners = new ArrayList(); @@ -929,13 +927,13 @@ public class StructureSelectionManager /** * Add each of the given codonFrames to the stored set, if not aready present. * - * @param set + * @param mappings */ - public void registerMappings(Set set) + public void registerMappings(List mappings) { - if (set != null) + if (mappings != null) { - for (AlignedCodonFrame acf : set) + for (AlignedCodonFrame acf : mappings) { registerMapping(acf); } @@ -1147,4 +1145,9 @@ public class StructureSelectionManager } return null; } + + public List getSequenceMappings() + { + return seqmappings; + } } diff --git a/src/jalview/ws/AWSThread.java b/src/jalview/ws/AWSThread.java index fe28d6c..b158448 100644 --- a/src/jalview/ws/AWSThread.java +++ b/src/jalview/ws/AWSThread.java @@ -32,6 +32,7 @@ import jalview.util.MessageManager; import jalview.viewmodel.seqfeatures.FeatureRendererSettings; import java.util.LinkedHashSet; +import java.util.List; import java.util.Set; public abstract class AWSThread extends Thread @@ -98,6 +99,7 @@ public abstract class AWSThread extends Thread /** * generic web service job/subjob poll loop */ + @Override public void run() { JobStateSummary jstate = null; @@ -378,7 +380,7 @@ public abstract class AWSThread extends Thread WsUrl = wsurl2; if (alframe != null) { - Set cf = alframe.getViewport().getAlignment() + List cf = alframe.getViewport().getAlignment() .getCodonFrames(); if (cf != null) { -- 1.7.10.2