JAL-1925 update source version in license
[jalview.git] / src / jalview / io / FormatAdapter.java
index e795925..182f2f4 100755 (executable)
@@ -1,6 +1,6 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
- * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b2)
+ * Copyright (C) 2015 The Jalview Authors
  * 
  * This file is part of Jalview.
  * 
@@ -29,7 +29,6 @@ import jalview.datamodel.ColumnSelection;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
-import jalview.gui.AlignmentPanel;
 
 /**
  * Additional formatting methods used by the application in a number of places.
@@ -51,7 +50,7 @@ public class FormatAdapter extends AppletFormatAdapter
     init();
   }
 
-  public FormatAdapter(AlignmentPanel alignPanel,
+  public FormatAdapter(AlignmentViewPanel alignPanel,
           AlignExportSettingI settings)
   {
     super(alignPanel, settings);
@@ -64,9 +63,9 @@ public class FormatAdapter extends AppletFormatAdapter
       annotFromStructure = jalview.bin.Cache.getDefault("ADD_TEMPFACT_ANN",
               true);
       localSecondaryStruct = jalview.bin.Cache.getDefault("ADD_SS_ANN",
-            true);
-    serviceSecondaryStruct = jalview.bin.Cache.getDefault("USE_RNAVIEW",
-            true);
+              true);
+      serviceSecondaryStruct = jalview.bin.Cache.getDefault("USE_RNAVIEW",
+              true);
     }
     else
     {
@@ -108,12 +107,10 @@ public class FormatAdapter extends AppletFormatAdapter
       {
         startRes = seqs[i].getStart();
         endRes = seqs[i].getEnd();
-
-        startIndex = startEnd[0];
-        endIndex = startEnd[1];
-
         if (startEnd != null)
         {
+          startIndex = startEnd[0];
+          endIndex = startEnd[1];
           // get first non-gaped residue start position
           while (jalview.util.Comparison.isGap(seqs[i]
                   .getCharAt(startIndex)) && startIndex < endIndex)
@@ -129,9 +126,7 @@ public class FormatAdapter extends AppletFormatAdapter
           }
 
           startRes = seqs[i].findPosition(startIndex);
-          startRes = seqs[i].getStart() > 1 ? startRes - seqs[i].getStart()
-                  : startRes;
-          endRes = seqs[i].findPosition(endIndex) - seqs[i].getStart();
+          endRes = seqs[i].findPosition(endIndex);
         }
 
         tmp[i] = new Sequence(seqs[i].getName(), omitHiddenColumns[i],
@@ -272,14 +267,12 @@ public class FormatAdapter extends AppletFormatAdapter
           ColumnSelection colSel)
   {
     return formatSequences(format, alignment, omitHidden, exportRange,
-            suffix, colSel,
-            null);
+            suffix, colSel, null);
   }
 
   public String formatSequences(String format, AlignmentI alignment,
           String[] omitHidden, int[] exportRange, boolean suffix,
-          ColumnSelection colSel,
-          jalview.datamodel.SequenceGroup selgp)
+          ColumnSelection colSel, jalview.datamodel.SequenceGroup selgp)
   {
     if (omitHidden != null)
     {
@@ -364,5 +357,4 @@ public class FormatAdapter extends AppletFormatAdapter
             selectedOnly);
   }
 
-
 }