From: Ben Soares Date: Mon, 5 Nov 2018 08:57:38 +0000 (+0000) Subject: JAL-3141 couple of minor fixes for example files being displayed in the Preferences tab X-Git-Tag: Release_2_11_0~17^2~97^2~43 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=25a6090732b9f6547fac3d12ddc15ca21b09a840;p=jalview.git JAL-3141 couple of minor fixes for example files being displayed in the Preferences tab --- diff --git a/src/jalview/gui/Preferences.java b/src/jalview/gui/Preferences.java index e1c6089..255c8fc 100755 --- a/src/jalview/gui/Preferences.java +++ b/src/jalview/gui/Preferences.java @@ -567,6 +567,7 @@ public class Preferences extends GPreferences backupfilesConfirmDelete.setSelected( Cache.getDefault(BackupFiles.CONFIRM_DELETE_OLD, true)); backupsOptionsSetEnabled(enableBackupFiles.isSelected()); + updateBackupFilesExampleLabel(); /* suffixPanel.setPreferredSize( new Dimension(width, suffixPanel.getHeight())); diff --git a/src/jalview/jbgui/GPreferences.java b/src/jalview/jbgui/GPreferences.java index a99d018..e789d6a 100755 --- a/src/jalview/jbgui/GPreferences.java +++ b/src/jalview/jbgui/GPreferences.java @@ -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 }