JAL-3253-applet JAL-3383 Overview speed up -- see Issue comments.
[jalview.git] / src / jalview / datamodel / features / SequenceFeatures.java
index 5390975..93ee71b 100644 (file)
@@ -109,12 +109,10 @@ public class SequenceFeatures implements SequenceFeaturesI
           String... type)
   {
     List<SequenceFeature> result = new ArrayList<>();
-
     for (FeatureStore featureSet : varargToTypes(type))
     {
       result.addAll(featureSet.findOverlappingFeatures(from, to));
     }
-
     return result;
   }
 
@@ -219,6 +217,7 @@ public class SequenceFeatures implements SequenceFeaturesI
       return featureStore.values();
     }
 
+
     List<FeatureStore> types = new ArrayList<>();
     List<String> args = Arrays.asList(type);
     for (Entry<String, FeatureStore> featureType : featureStore.entrySet())
@@ -373,7 +372,7 @@ public class SequenceFeatures implements SequenceFeaturesI
     {
       return true;
     }
-    SequenceOntologyI so = SequenceOntologyFactory.getInstance();
+    SequenceOntologyI so = SequenceOntologyFactory.getSequenceOntology();
     for (String term : soTerm)
     {
       if (type.equals(term) || so.isA(type, term))
@@ -447,13 +446,39 @@ public class SequenceFeatures implements SequenceFeaturesI
    * {@inheritDoc}
    */
   @Override
-  public boolean shiftFeatures(int shift)
+  public boolean shiftFeatures(int fromPosition, int shiftBy)
   {
     boolean modified = false;
     for (FeatureStore fs : featureStore.values())
     {
-      modified |= fs.shiftFeatures(shift);
+      modified |= fs.shiftFeatures(fromPosition, shiftBy);
     }
     return modified;
   }
-}
\ No newline at end of file
+
+  /**
+   * {@inheritDoc}
+   */
+  @Override
+  public void deleteAll()
+  {
+    featureStore.clear();
+  }
+
+  /**
+   * Simplified find for features associated with a given position.
+   * 
+   * @author Bob Hanson 2019.07.30
+   */
+  @Override
+  public void findFeatures(int pos, String type, List<SequenceFeature> list)
+  {
+    FeatureStore fs = featureStore.get(type);
+    if (fs != null)
+    {
+      fs.findOverlappingFeatures(pos, list);
+    }
+  }
+
+
+}