JAL-3141 couple of minor fixes for example files being displayed in the Preferences tab
[jalview.git] / src / jalview / jbgui / GPreferences.java
index a99d018..e789d6a 100755 (executable)
@@ -2039,7 +2039,7 @@ public class GPreferences extends JPanel
     return exampleFilesPanel;
   }
 
-  private void updateBackupFilesExampleLabel()
+  protected void updateBackupFilesExampleLabel()
   {
     int exampleindex = 12;
     String base = "filename";
@@ -2069,7 +2069,8 @@ public class GPreferences extends JPanel
               "Failed casting (Integer) backupfilesRollMaxSpinner.getValue()");
     }
 
-    int surround = 2;
+    int lowersurround = 2;
+    int uppersurround = 0;
     StringBuilder exampleSB = new StringBuilder();
     boolean firstLine = true;
     if (reverse)
@@ -2079,11 +2080,11 @@ public class GPreferences extends JPanel
       int max = keepAll ? exampleindex : rollMax;
       for (int index = min; index <= max; index++)
       {
-        if (index == min + surround && index < max)
+        if (index == min + lowersurround && index < max - uppersurround - 1)
         {
           exampleSB.append("\n...");
         }
-        else if (index > min + surround && index < max)
+        else if (index > min + lowersurround && index < max - uppersurround)
         {
           // nothing
         }
@@ -2124,11 +2125,11 @@ public class GPreferences extends JPanel
       for (int index = min; index <= max; index++)
       {
 
-        if (index == min + surround && index < max)
+        if (index == min + lowersurround && index < max - uppersurround - 1)
         {
           exampleSB.append("\n...");
         }
-        else if (index > min + surround && index < max)
+        else if (index > min + lowersurround && index < max - uppersurround)
         {
           // nothing
         }