Merge branch 'develop' into alpha/JAL-3362_Jalview_212_alpha
[jalview.git] / src / jalview / datamodel / Sequence.java
index efcf6ae..25e9611 100755 (executable)
@@ -456,18 +456,19 @@ public class Sequence extends ASequence implements SequenceI
   }
 
   /**
-   * DOCUMENT ME!
+   * Answers the sequence name, with '/start-end' appended if jvsuffix is true
    * 
-   * @return DOCUMENT ME!
+   * @return
    */
   @Override
   public String getDisplayId(boolean jvsuffix)
   {
-    StringBuffer result = new StringBuffer(name);
-    if (jvsuffix)
+    if (!jvsuffix)
     {
-      result.append("/" + start + "-" + end);
+      return name;
     }
+    StringBuilder result = new StringBuilder(name);
+    result.append("/").append(start).append("-").append(end);
 
     return result.toString();
   }
@@ -506,6 +507,7 @@ public class Sequence extends ASequence implements SequenceI
   public void setStart(int start)
   {
     this.start = start;
+    sequenceChanged();
   }
 
   /**
@@ -1051,7 +1053,8 @@ public class Sequence extends ASequence implements SequenceI
   @Override
   public ContiguousI findPositions(int fromColumn, int toColumn)
   {
-    if (toColumn < fromColumn || fromColumn < 1)
+    fromColumn = Math.max(fromColumn, 1);
+    if (toColumn < fromColumn)
     {
       return null;
     }
@@ -1923,15 +1926,6 @@ public class Sequence extends ASequence implements SequenceI
 
     List<SequenceFeature> result = getFeatures().findFeatures(startPos,
             endPos, types);
-    if (datasetSequence != null)
-    {
-      result = datasetSequence.getFeatures().findFeatures(startPos, endPos,
-              types);
-    }
-    else
-    {
-      result = sequenceFeatureStore.findFeatures(startPos, endPos, types);
-    }
 
     /*
      * if end column is gapped, endPos may be to the right,