Merge branch 'patch/Release_2_11_1_Branch_patch_JAL-3490' into releases/Release_2_11_...
authorJim Procter <jprocter@issues.jalview.org>
Mon, 17 Aug 2020 10:03:57 +0000 (11:03 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Mon, 17 Aug 2020 10:03:57 +0000 (11:03 +0100)
1  2 
resources/lang/Messages.properties
resources/lang/Messages_es.properties
src/jalview/gui/AlignFrame.java
src/jalview/gui/AnnotationColumnChooser.java
src/jalview/gui/SeqPanel.java
src/jalview/viewmodel/AlignmentViewport.java

@@@ -377,7 -377,7 +377,7 @@@ label.example = Exampl
  label.example_param = Example: {0}
  label.select_file_format_before_saving = You must select a file format before saving!
  label.file_format_not_specified = File format not specified
 -label.couldnt_save_file = Couldn't save file: {0}
 +label.couldnt_save_file = Couldn''t save file: {0}
  label.error_saving_file = Error Saving File
  label.remove_from_default_list = Remove from default list?
  label.remove_user_defined_colour = Remove user defined colour
@@@ -406,11 -406,11 +406,11 @@@ label.pdb_entries_couldnt_be_retrieved 
  label.couldnt_load_file = Couldn't load file
  label.couldnt_find_pdb_id_in_file = Couldn't find a PDB id in the file supplied. Please enter an Id to identify this structure.
  label.no_pdb_id_in_file = No PDB Id in File
 -label.couldnt_read_pasted_text = Couldn't read the pasted text {0}
 +label.couldnt_read_pasted_text = Couldn''t read the pasted text {0}
  label.error_parsing_text = Error parsing text
  label.input_alignment_from_url = Input Alignment From URL
  label.input_alignment = Input Alignment
 -label.couldnt_import_as_vamsas_session = Couldn't import {0} as a new vamsas session.
 +label.couldnt_import_as_vamsas_session = Couldn''t import {0} as a new vamsas session.
  label.vamsas_document_import_failed = Vamsas Document Import Failed
  label.couldnt_locate = Could not locate {0}
  label.url_not_found = URL not found
@@@ -855,7 -855,7 +855,7 @@@ label.invalid_name = Invalid nam
  label.set_proxy_settings = Please set up your proxy settings in the 'Connections' tab of the Preferences window
  label.proxy_authorization_failed = Proxy Authorization Failed
  label.internal_jalview_error = Internal Jalview Error
 -label.secondary_structure_prediction_service_couldnt_be_located = The Secondary Structure Prediction Service named {0} at {1} couldn't be located.
 +label.secondary_structure_prediction_service_couldnt_be_located = The Secondary Structure Prediction Service named {0} at {1} couldn''t be located.
  label.service_called_is_not_msa_service = The Service called \n{0}\nis not a \nMultiple Sequence Alignment Service\!
  label.msa_service_is_unknown = The Multiple Sequence Alignment Service named {0} is unknown
  label.service_called_is_not_seq_search_service = The Service called \n{0}\nis not a \nSequence Search Service\!
@@@ -985,7 -985,7 +985,7 @@@ error.cannot_set_arguments_to_jabaws_pa
  error.implementation_error_runner_config_not_available = Implementation Error: Runner Config not available for a JABAWS service of type {0} ({1})
  error.implementation_error_cannot_handle_jaba_param = Implementation Error: Cannot handle Jaba parameter object {0}
  error.implementation_error_attempt_to_delete_service_preset = Implementation error: Attempt to delete a service preset!
 -error.implementation_error_cannot_locate_oldname_presetname = Implementation error: Can't locate either oldname ({0}) or presetName ({1}in the datastore!"
 +error.implementation_error_cannot_locate_oldname_presetname = Implementation error: Can''t locate either oldname ({0}) or presetName ({1}in the datastore!"
  error.implementation_error_jabaws_param_set_only_handled_by = Implementation error: JabaWsParamSets can only be handled by JabaParamStore
  error.cannot_set_source_file_for = Cannot set source file for {0}
  error.mismatch_service_instance_preset = Probable mismatch between service instance and preset!
@@@ -993,7 -993,7 +993,7 @@@ error.cannot_set_params_for_ws_preset 
  error.implementation_error_can_only_instantiate_jaba_param_sets = Implementation error: Can only instantiate Jaba parameter sets
  error.no_aacon_service_found = No AACon service found
  error.implementation_error_couldnt_copy_value_constraint = Implementation error: could not copy ValueConstrain!
 -error.couldnt_encode_as_utf8 = Couldn't encode {0} as UTF-8.
 +error.couldnt_encode_as_utf8 = Couldn''t encode {0} as UTF-8.
  error.tree_inputtype_not_yet_implemented = Tree InputType not yet implemented
  error.implementation_error_need_to_have_httpresponse = Implementation Error: need to have an HttpResponse to process
  error.dbrefsource_implementation_exception =DBRefSource Implementation Exception
@@@ -1049,18 -1049,18 +1049,18 @@@ error.implementation_error_reset_called
  exception.number_of_residues_in_query_sequence_differ_from_prediction = Number of residues in {0} supposed query sequence ({1}\n{2})\ndiffer from number of prediction sites in prediction ({3})
  label.mapped = mapped
  exception.jpredconcide_entry_has_unexpected_number_of_columns = JPredConcise: Entry ({0}) has an unexpected number of columns
 -exception.couldnt_parse_concise_annotation_for_prediction = Couldn't parse concise annotation for prediction profile.\n{0}
 +exception.couldnt_parse_concise_annotation_for_prediction = Couldn''t parse concise annotation for prediction profile.\n{0}
  exception.newfile = NewickFile\: {0}\n
  label.no_tree_read_in = No Tree read in
 -exception.rnaml_couldnt_access_datasource = Couldn't access datasource ({0})
 -exception.ranml_couldnt_process_data = Couldn't process data as RNAML file ({0})
 +exception.rnaml_couldnt_access_datasource = Couldn''t access datasource ({0})
 +exception.ranml_couldnt_process_data = Couldn''t process data as RNAML file ({0})
  exception.ranml_invalid_file = Invalid RNAML file ({0})
  exception.ranml_problem_parsing_data = Problem parsing data as RNAML ({0})
  exception.pfam_no_sequences_found = No sequences found (PFAM input)
  exception.stockholm_invalid_format = This file is not in valid STOCKHOLM format: First line does not contain '# STOCKHOLM'
  exception.couldnt_parse_sequence_line = Could not parse sequence line: {0}
  exception.unknown_annotation_detected = Unknown annotation detected: {0} {1}
 -exception.couldnt_store_sequence_mappings = Couldn't store sequence mappings for {0}
 +exception.couldnt_store_sequence_mappings = Couldn''t store sequence mappings for {0}
  exception.matrix_too_many_iteration = Too many iterations in {0} (max is {1})
  exception.browser_not_found = Exception in finding browser: {0}
  exception.browser_unable_to_locate = Unable to locate browser: {0}
@@@ -1071,6 -1071,7 +1071,6 @@@ exception.unable_to_create_internet_con
  exception.invocation_target_calling_url = InvocationTargetException while calling openURL: {0}
  exception.illegal_access_calling_url = IllegalAccessException while calling openURL: {0}
  exception.interrupted_launching_browser = InterruptedException while launching browser: {0}
 -exception.ebiembl_retrieval_failed_on = EBI EMBL XML retrieval failed on {0}:{1}
  exception.no_pdb_records_for_chain = No PDB Records for {0} chain {1}
  exception.unexpected_handling_rnaml_translation_for_pdb = Unexpected exception when handling RNAML translation of PDB data
  exception.couldnt_recover_sequence_properties_for_alignment = Couldn't recover sequence properties for alignment
@@@ -1093,7 -1094,7 +1093,7 @@@ warn.service_not_supported = Service no
  warn.input_is_too_big = Input is too big!
  warn.invalid_job_param_set = Invalid job parameter set!
  warn.oneseq_msainput_selection = The current selection only contains a single sequence. Do you want to submit all sequences for alignment instead ?   
 -info.job_couldnt_be_run_server_doesnt_support_program = Job could not be run because the server doesn't support this program.\n{0}
 +info.job_couldnt_be_run_server_doesnt_support_program = Job could not be run because the server doesn''t support this program.\n{0}
  info.job_couldnt_be_run_exceeded_hard_limit = Job could not be run because it exceeded a hard limit on the server.\n{0}
  info.job_couldnt_be_run_incorrect_param_setting = Job could not be run because some of the parameter settings are not supported by the server.\n{0}\nPlease check to make sure you have used the correct parameter set for this service\!\n
  info.no_jobs_ran = No jobs ran
@@@ -1345,7 -1346,6 +1345,7 @@@ label.backupfiles_confirm_save_file = C
  label.backupfiles_confirm_save_file_backupfiles_roll_wrong = Something possibly went wrong with the backups of this file.
  label.backupfiles_confirm_save_new_saved_file_ok = The new saved file seems okay.
  label.backupfiles_confirm_save_new_saved_file_not_ok = The new saved file might not be okay.
 +label.continue_operation = Continue operation?
  label.backups = Backups
  label.backup = Backup
  label.backup_files = Backup Files
@@@ -1412,7 -1412,6 +1412,9 @@@ label.include_linked_features = Includ
  label.include_linked_tooltip = Include visible {0} features<br>converted to local sequence coordinates
  label.features_not_shown = {0} feature(s) not shown
  label.no_features_to_sort_by = No features to sort by
 +label.log_level = Log level
 +label.log_level_tooltip = Temporarily set the log level for this console. The log level will revert to {0} when this Java console is closed.
 +label.copy_to_clipboard = Copy to clipboard
 +label.copy_to_clipboard_tooltip = Copy all of the log text in this console to the system clipboard
+ label.ignore_hidden = Ignore hidden columns
+ label.ignore_hidden_tooltip = Ignore any characters in hidden columns when matching
 -
@@@ -211,7 -211,7 +211,7 @@@ label.show_non_conserved = Mostrar no c
  label.overview_window = Ventana resumen
  label.none = Ninguno
  label.above_identity_threshold = Por encima del umbral de identidad
 -label.show_sequence_features = Mostrar las características de las secuencias
 +label.show_sequence_features = Mostrar las características de secuencia
  label.nucleotide = Nucleótido
  label.to_new_alignment = A nuevo alineamiento
  label.to_this_alignment = Añadir a este alineamiento
@@@ -693,12 -693,7 +693,12 @@@ label.annotations_for_params = Anotacio
  label.generating_features_for_params = Generando características de - {0}
  label.generating_annotations_for_params = Generando anotaciones de - {0}
  label.varna_params = VARNA - {0}
 -label.sequence_feature_settings = Configuración de las características de la secuencia
 +label.sequence_feature_settings = Configuración de las características de secuencia
 +label.sequence_feature_settings_for = Configuración de las características de secuencia para {0}
 +label.sequence_feature_settings_for_view = Configuración de las características de secuencia para vista "{0}"
 +label.sequence_feature_settings_for_CDS_and_Protein = Configuración de las características de secuencia para CDS y Proteína 
 +action.undo_changes_to_feature_settings = Deshacer todos los cambios no aplicados
 +action.undo_changes_to_feature_settings_and_close_the_dialog = Deshacer cambios pendientes, cerrar diálogo
  label.pairwise_aligned_sequences = Secuencias alineadas a pares
  label.original_data_for_params = Datos originales de {0}
  label.points_for_params = Puntos de {0}
@@@ -995,6 -990,7 +995,6 @@@ exception.unable_to_create_internet_con
  exception.invocation_target_calling_url = InvocationTargetException mientras se invocaba openURL: {0}
  exception.illegal_access_calling_url = IllegalAccessException mientras se invocaba openURL: {0}
  exception.interrupted_launching_browser = InterruptedException mientras se lanzaba el navegador: {0}
 -exception.ebiembl_retrieval_failed_on = La recuperación de datos EBI EMBL XML ha fallado en {0}:{1}
  exception.no_pdb_records_for_chain = No se han encontrado registros {0} para la cadena {1}
  exception.unexpected_handling_rnaml_translation_for_pdb = Excepcion inesperada cuando se traducían a RNAML los datos PDB
  exception.couldnt_recover_sequence_properties_for_alignment = No es posible recuperar las propiedades de la secuencia para el alineamiento
@@@ -1195,7 -1191,6 +1195,7 @@@ warn.urls_not_contacted=URLs que no pud
  label.prot_alignment_colour=Color del Alineamiento Proteico
  info.associate_wit_sequence=Asociar con secuencia
  label.protein=Proteína
 +label.CDS=CDS
  warn.oneseq_msainput_selection=La selección actual sólo contiene una única secuencia. ¿Quieres enviar todas las secuencias para la alineación en su lugar?
  label.use_rnaview=Usar RNAView para estructura secondaria
  label.search_all=Introducir uno o más valores de búsqueda separados por punto y coma ";" (Nota: buscará en toda la base de datos PDB)
@@@ -1346,7 -1341,6 +1346,7 @@@ label.backupfiles_confirm_save_file = C
  label.backupfiles_confirm_save_file_backupfiles_roll_wrong = Posiblemente algo está mal con los archivos de respaldos.
  label.backupfiles_confirm_save_new_saved_file_ok = El nuevo archivo guardado parece estar bien.
  label.backupfiles_confirm_save_new_saved_file_not_ok = El nuevo archivo guardado podría no estar bien.
 +label.continue_operation = ¿Continuar operación?
  label.backups = Respaldos
  label.backup = Respaldo
  label.backup_files = Archivos de respaldos
@@@ -1413,7 -1407,5 +1413,9 @@@ label.include_linked_features = Inclui
  label.include_linked_tooltip = Incluir características de {0}<br>convertidas a coordenadas de secuencia local
  label.features_not_shown = {0} característica(s) no mostradas
  label.no_features_to_sort_by = No hay características para ordenar
 +label.log_level = Nivel del registro
 +label.log_level_tooltip = Establezca temporalmente el nivel de registro para esta consola. El nivel de registro volverá a {0} cuando se cierre esta consola de Java.
 +label.copy_to_clipboard = Copiar en el portapapeles
 +label.copy_to_clipboard_tooltip = Copie todo el texto de registro en esta consola al portapapeles del sistema
+ label.ignore_hidden = Ignorar columnas ocultas
+ label.ignore_hidden_tooltip = Ignorar caracteres en columnas ocultas
   */
  package jalview.gui;
  
 +import java.awt.BorderLayout;
 +import java.awt.Component;
 +import java.awt.Rectangle;
 +import java.awt.Toolkit;
 +import java.awt.datatransfer.Clipboard;
 +import java.awt.datatransfer.DataFlavor;
 +import java.awt.datatransfer.StringSelection;
 +import java.awt.datatransfer.Transferable;
 +import java.awt.dnd.DnDConstants;
 +import java.awt.dnd.DropTargetDragEvent;
 +import java.awt.dnd.DropTargetDropEvent;
 +import java.awt.dnd.DropTargetEvent;
 +import java.awt.dnd.DropTargetListener;
 +import java.awt.event.ActionEvent;
 +import java.awt.event.ActionListener;
 +import java.awt.event.FocusAdapter;
 +import java.awt.event.FocusEvent;
 +import java.awt.event.ItemEvent;
 +import java.awt.event.ItemListener;
 +import java.awt.event.KeyAdapter;
 +import java.awt.event.KeyEvent;
 +import java.awt.event.MouseEvent;
 +import java.awt.print.PageFormat;
 +import java.awt.print.PrinterJob;
 +import java.beans.PropertyChangeEvent;
 +import java.io.File;
 +import java.io.FileWriter;
 +import java.io.IOException;
 +import java.io.PrintWriter;
 +import java.net.URL;
 +import java.util.ArrayList;
 +import java.util.Arrays;
 +import java.util.Deque;
 +import java.util.Enumeration;
 +import java.util.Hashtable;
 +import java.util.List;
 +import java.util.Vector;
 +
 +import javax.swing.ButtonGroup;
 +import javax.swing.JCheckBoxMenuItem;
 +import javax.swing.JEditorPane;
 +import javax.swing.JInternalFrame;
 +import javax.swing.JLayeredPane;
 +import javax.swing.JMenu;
 +import javax.swing.JMenuItem;
 +import javax.swing.JScrollPane;
 +import javax.swing.SwingUtilities;
 +
  import jalview.analysis.AlignmentSorter;
  import jalview.analysis.AlignmentUtils;
  import jalview.analysis.CrossRef;
@@@ -139,7 -91,6 +139,7 @@@ import jalview.schemes.ColourSchemes
  import jalview.schemes.ResidueColourScheme;
  import jalview.schemes.TCoffeeColourScheme;
  import jalview.util.MessageManager;
 +import jalview.util.Platform;
  import jalview.viewmodel.AlignmentViewport;
  import jalview.viewmodel.ViewportRanges;
  import jalview.ws.DBRefFetcher;
@@@ -149,6 -100,53 +149,6 @@@ import jalview.ws.jws2.Jws2Discoverer
  import jalview.ws.jws2.jabaws2.Jws2Instance;
  import jalview.ws.seqfetcher.DbSourceProxy;
  
 -import java.awt.BorderLayout;
 -import java.awt.Component;
 -import java.awt.Rectangle;
 -import java.awt.Toolkit;
 -import java.awt.datatransfer.Clipboard;
 -import java.awt.datatransfer.DataFlavor;
 -import java.awt.datatransfer.StringSelection;
 -import java.awt.datatransfer.Transferable;
 -import java.awt.dnd.DnDConstants;
 -import java.awt.dnd.DropTargetDragEvent;
 -import java.awt.dnd.DropTargetDropEvent;
 -import java.awt.dnd.DropTargetEvent;
 -import java.awt.dnd.DropTargetListener;
 -import java.awt.event.ActionEvent;
 -import java.awt.event.ActionListener;
 -import java.awt.event.FocusAdapter;
 -import java.awt.event.FocusEvent;
 -import java.awt.event.ItemEvent;
 -import java.awt.event.ItemListener;
 -import java.awt.event.KeyAdapter;
 -import java.awt.event.KeyEvent;
 -import java.awt.event.MouseEvent;
 -import java.awt.print.PageFormat;
 -import java.awt.print.PrinterJob;
 -import java.beans.PropertyChangeEvent;
 -import java.io.File;
 -import java.io.FileWriter;
 -import java.io.PrintWriter;
 -import java.net.URL;
 -import java.util.ArrayList;
 -import java.util.Arrays;
 -import java.util.Deque;
 -import java.util.Enumeration;
 -import java.util.Hashtable;
 -import java.util.List;
 -import java.util.Vector;
 -
 -import javax.swing.ButtonGroup;
 -import javax.swing.JCheckBoxMenuItem;
 -import javax.swing.JEditorPane;
 -import javax.swing.JInternalFrame;
 -import javax.swing.JLayeredPane;
 -import javax.swing.JMenu;
 -import javax.swing.JMenuItem;
 -import javax.swing.JScrollPane;
 -import javax.swing.SwingUtilities;
 -
  /**
   * DOCUMENT ME!
   * 
@@@ -538,8 -536,7 +538,8 @@@ public class AlignFrame extends GAlignF
            }
            if (viewport.cursorMode)
            {
 -            alignPanel.getSeqPanel().moveCursor(0, 1);
 +            alignPanel.getSeqPanel().moveCursor(0, 1,
 +                    evt.isShiftDown() && !evt.isAltDown());
            }
            break;
  
            }
            if (viewport.cursorMode)
            {
 -            alignPanel.getSeqPanel().moveCursor(0, -1);
 +            alignPanel.getSeqPanel().moveCursor(0, -1,
 +                    evt.isShiftDown() && !evt.isAltDown());
            }
 -
            break;
  
          case KeyEvent.VK_LEFT:
            }
            else
            {
 -            alignPanel.getSeqPanel().moveCursor(-1, 0);
 +            alignPanel.getSeqPanel().moveCursor(-1, 0, evt.isShiftDown());
            }
  
            break;
            }
            else
            {
 -            alignPanel.getSeqPanel().moveCursor(1, 0);
 +            alignPanel.getSeqPanel().moveCursor(1, 0, evt.isShiftDown());
            }
            break;
  
  
        statusBar.setText(MessageManager.formatMessage(
                "label.successfully_saved_to_file_in_format", new Object[]
 -              { fileName, format }));
 +              { file, format }));
  
      }
      else
        else
        {
          // create backupfiles object and get new temp filename destination
 +        Cache.log.trace("ALIGNFRAME making backupfiles object for " + file);
          BackupFiles backupfiles = new BackupFiles(file);
  
          try
          {
 -          PrintWriter out = new PrintWriter(
 -                  new FileWriter(backupfiles.getTempFilePath()));
 +          String tempFilePath = backupfiles.getTempFilePath();
 +          Cache.log.trace(
 +                  "ALIGNFRAME setting PrintWriter to " + tempFilePath);
 +          PrintWriter out = new PrintWriter(new FileWriter(tempFilePath));
 +
 +          Cache.log.trace(
 +                  "ALIGNFRAME about to write to temp file " + tempFilePath);
  
            out.print(output);
 +          Cache.log.trace("ALIGNFRAME about to close file");
            out.close();
 +          Cache.log.trace("ALIGNFRAME closed file");
            this.setTitle(file);
            statusBar.setText(MessageManager.formatMessage(
                    "label.successfully_saved_to_file_in_format", new Object[]
 -                  { fileName, format.getName() }));
 +                  { file, format.getName() }));
 +        } catch (IOException e)
 +        {
 +          success = false;
 +          Cache.log.error(
 +                  "ALIGNFRAME Something happened writing the temp file");
 +          Cache.log.error(e.getMessage());
 +          Cache.log.debug(Cache.getStackTraceString(e));
 +
          } catch (Exception ex)
          {
            success = false;
 -          ex.printStackTrace();
 +          Cache.log.error(
 +                  "ALIGNFRAME Something unexpected happened writing the temp file");
 +          Cache.log.error(ex.getMessage());
 +          Cache.log.debug(Cache.getStackTraceString(ex));
          }
  
          backupfiles.setWriteSuccess(success);
 +        Cache.log.debug("ALIGNFRAME writing temp file was "
 +                + (success ? "" : "NOT ") + "successful");
          // do the backup file roll and rename the temp file to actual file
 +        Cache.log.trace("ALIGNFRAME about to rollBackupsAndRenameTempFile");
          success = backupfiles.rollBackupsAndRenameTempFile();
 +        Cache.log.debug("ALIGNFRAME performed rollBackupsAndRenameTempFile "
 +                + (success ? "" : "un") + "successfully");
  
        }
      }
  
      if (!success)
      {
 -      JvOptionPane.showInternalMessageDialog(this, MessageManager
 -              .formatMessage("label.couldnt_save_file", new Object[]
 -              { fileName }),
 -              MessageManager.getString("label.error_saving_file"),
 -              JvOptionPane.WARNING_MESSAGE);
 +      if (!Platform.isHeadless())
 +      {
 +        JvOptionPane.showInternalMessageDialog(this, MessageManager
 +                .formatMessage("label.couldnt_save_file", new Object[]
 +                { file }),
 +                MessageManager.getString("label.error_saving_file"),
 +                JvOptionPane.WARNING_MESSAGE);
 +      }
      }
  
      return success;
    synchronized void slideSequences(boolean right, int size)
    {
      List<SequenceI> sg = new ArrayList<>();
 -    if (viewport.cursorMode)
 -    {
 -      sg.add(viewport.getAlignment()
 -              .getSequenceAt(alignPanel.getSeqPanel().seqCanvas.cursorY));
 -    }
 -    else if (viewport.getSelectionGroup() != null
 -            && viewport.getSelectionGroup().getSize() != viewport
 -                    .getAlignment().getHeight())
 +    if (viewport.getSelectionGroup() != null && viewport.getSelectionGroup()
 +            .getSize() != viewport.getAlignment().getHeight())
      {
        sg = viewport.getSelectionGroup()
                .getSequences(viewport.getHiddenRepSequences());
      }
  
 +    if (sg.size() == 0 && viewport.cursorMode)
 +    {
 +      sg.add(viewport.getAlignment()
 +              .getSequenceAt(alignPanel.getSeqPanel().seqCanvas.cursorY));
 +    }
 +
      if (sg.size() < 1)
      {
        return;
      }
      viewport.setSelectionGroup(null);
      viewport.getColumnSelection().clear();
 -    viewport.setSelectionGroup(null);
 +    viewport.setSearchResults(null);
      alignPanel.getIdPanel().getIdCanvas().searchResults = null;
      // JAL-2034 - should delegate to
      // alignPanel to decide if overview needs
    }
  
    /**
-    * DOCUMENT ME!
+    * Opens a Finder dialog
     * 
     * @param e
-    *          DOCUMENT ME!
     */
    @Override
    public void findMenuItem_actionPerformed(ActionEvent e)
    {
-     new Finder();
+     new Finder(alignPanel);
    }
  
    /**
  
      if (viewport.getViewName() == null)
      {
 -      viewport.setViewName(MessageManager
 -              .getString("label.view_name_original"));
 +      viewport.setViewName(
 +              MessageManager.getString("label.view_name_original"));
      }
  
      /*
       * otherwise set the chosen colour scheme (or null for 'None')
       */
      ColourSchemeI cs = ColourSchemes.getInstance().getColourScheme(name,
 -            viewport,
 -            viewport.getAlignment(), viewport.getHiddenRepSequences());
 +            viewport, viewport.getAlignment(),
 +            viewport.getHiddenRepSequences());
      changeColour(cs);
    }
  
    }
  
    private Rectangle lastFeatureSettingsBounds = null;
 +
    @Override
    public void setFeatureSettingsGeometry(Rectangle bounds)
    {
@@@ -21,7 -21,6 +21,7 @@@
  
  package jalview.gui;
  
 +import jalview.datamodel.AlignmentAnnotation;
  import jalview.datamodel.HiddenColumns;
  import jalview.io.cache.JvCacheableInputBox;
  import jalview.schemes.AnnotationColourGradient;
@@@ -255,7 -254,7 +255,7 @@@ public class AnnotationColumnChooser ex
    {
      if (slider.isEnabled())
      {
 -      getCurrentAnnotation().threshold.value = slider.getValue() / 1000f;
 +      getCurrentAnnotation().threshold.value = getSliderValue();
        updateView();
        propagateSeqAssociatedThreshold(updateAllAnnotation,
                getCurrentAnnotation());
      thresholdValue.setEnabled(true);
      percentThreshold.setEnabled(true);
  
 +    final AlignmentAnnotation currentAnnotation = getCurrentAnnotation();
      if (selectedThresholdItem == AnnotationColourGradient.NO_THRESHOLD)
      {
        slider.setEnabled(false);
      }
      else if (selectedThresholdItem != AnnotationColourGradient.NO_THRESHOLD)
      {
 -      if (getCurrentAnnotation().threshold == null)
 +      if (currentAnnotation.threshold == null)
        {
 -        getCurrentAnnotation().setThreshold(new jalview.datamodel.GraphLine(
 -                (getCurrentAnnotation().graphMax
 -                        - getCurrentAnnotation().graphMin) / 2f,
 +        currentAnnotation.setThreshold(new jalview.datamodel.GraphLine(
 +                (currentAnnotation.graphMax
 +                        - currentAnnotation.graphMin) / 2f,
                  "Threshold", Color.black));
        }
  
        adjusting = true;
 -      float range = getCurrentAnnotation().graphMax * 1000
 -              - getCurrentAnnotation().graphMin * 1000;
  
 -      slider.setMinimum((int) (getCurrentAnnotation().graphMin * 1000));
 -      slider.setMaximum((int) (getCurrentAnnotation().graphMax * 1000));
 -      slider.setValue(
 -              (int) (getCurrentAnnotation().threshold.value * 1000));
 +      setSliderModel(currentAnnotation.graphMin,
 +              currentAnnotation.graphMax,
 +              currentAnnotation.threshold.value);
  
        setThresholdValueText();
  
 -      slider.setMajorTickSpacing((int) (range / 10f));
        slider.setEnabled(true);
        thresholdValue.setEnabled(true);
        adjusting = false;
        // build filter params
        filterParams.setThresholdType(
                AnnotationFilterParameter.ThresholdType.NO_THRESHOLD);
 -      if (getCurrentAnnotation().isQuantitative())
 +      if (currentAnnotation.isQuantitative())
        {
          filterParams
 -                .setThresholdValue(getCurrentAnnotation().threshold.value);
 +                .setThresholdValue(currentAnnotation.threshold.value);
  
          if (selectedThresholdItem == AnnotationColourGradient.ABOVE_THRESHOLD)
          {
      // adding them to the selection
      av.showAllHiddenColumns();
      av.getColumnSelection().filterAnnotations(
 -            getCurrentAnnotation().annotations, filterParams);
 +            currentAnnotation.annotations, filterParams);
  
      boolean hideCols = getActionOption() == ACTION_OPTION_HIDE;
      if (hideCols)
      private static final String FILTER_BY_ANN_CACHE_KEY = "CACHE.SELECT_FILTER_BY_ANNOT";
  
      public JvCacheableInputBox<String> searchBox = new JvCacheableInputBox<>(
-             FILTER_BY_ANN_CACHE_KEY);
+             FILTER_BY_ANN_CACHE_KEY, 23);
  
      public SearchPanel(AnnotationColumnChooser aColChooser)
      {
        this.setBorder(new TitledBorder(
                MessageManager.getString("label.search_filter")));
  
-       searchBox.setPrototypeDisplayValue("XXXXXXXXXXXXXXXXXXXXXXX");
        searchBox.setToolTipText(
                MessageManager.getString("info.enter_search_text_here"));
        searchBox.getEditor().getEditorComponent()
@@@ -460,80 -460,47 +460,80 @@@ public class SeqPanel extends JPane
  
    void moveCursor(int dx, int dy)
    {
 -    seqCanvas.cursorX += dx;
 -    seqCanvas.cursorY += dy;
 -
 +    moveCursor(dx, dy,false);
 +  }
 +  void moveCursor(int dx, int dy, boolean nextWord)
 +  {
      HiddenColumns hidden = av.getAlignment().getHiddenColumns();
  
 -    if (av.hasHiddenColumns() && !hidden.isVisible(seqCanvas.cursorX))
 +    if (nextWord)
      {
 -      int original = seqCanvas.cursorX - dx;
        int maxWidth = av.getAlignment().getWidth();
 -
 -      if (!hidden.isVisible(seqCanvas.cursorX))
 +      int maxHeight=av.getAlignment().getHeight();
 +      SequenceI seqAtRow = av.getAlignment().getSequenceAt(seqCanvas.cursorY);
 +      // look for next gap or residue
 +      boolean isGap = Comparison.isGap(seqAtRow.getCharAt(seqCanvas.cursorX));
 +      int p = seqCanvas.cursorX,lastP,r=seqCanvas.cursorY,lastR;
 +      do
        {
 -        int visx = hidden.absoluteToVisibleColumn(seqCanvas.cursorX - dx);
 -        int[] region = hidden.getRegionWithEdgeAtRes(visx);
 -
 -        if (region != null) // just in case
 +        lastP = p;
 +        lastR = r;
 +        if (dy != 0)
          {
 -          if (dx == 1)
 +          r += dy;
 +          if (r < 0)
            {
 -            // moving right
 -            seqCanvas.cursorX = region[1] + 1;
 +            r = 0;
            }
 -          else if (dx == -1)
 +          if (r >= maxHeight)
            {
 -            // moving left
 -            seqCanvas.cursorX = region[0] - 1;
 +            r = maxHeight - 1;
            }
 +          seqAtRow = av.getAlignment().getSequenceAt(r);
          }
 -        seqCanvas.cursorX = (seqCanvas.cursorX < 0) ? 0 : seqCanvas.cursorX;
 -      }
 +        p = nextVisible(hidden, maxWidth, p, dx);
 +      } while ((dx != 0 ? p != lastP : r != lastR)
 +              && isGap == Comparison.isGap(seqAtRow.getCharAt(p)));
 +      seqCanvas.cursorX=p;
 +      seqCanvas.cursorY=r;
 +    } else {
 +      int maxWidth = av.getAlignment().getWidth();
 +      seqCanvas.cursorX = nextVisible(hidden, maxWidth, seqCanvas.cursorX, dx);
 +      seqCanvas.cursorY += dy;
 +    }
 +    scrollToVisible(false);
 +  }
 +
 +  private int nextVisible(HiddenColumns hidden,int maxWidth, int original, int dx)
 +  {
 +    int newCursorX=original+dx;
 +    if (av.hasHiddenColumns() && !hidden.isVisible(newCursorX))
 +    {
 +      int visx = hidden.absoluteToVisibleColumn(newCursorX - dx);
 +      int[] region = hidden.getRegionWithEdgeAtRes(visx);
  
 -      if (seqCanvas.cursorX >= maxWidth
 -              || !hidden.isVisible(seqCanvas.cursorX))
 +      if (region != null) // just in case
        {
 -        seqCanvas.cursorX = original;
 +        if (dx == 1)
 +        {
 +          // moving right
 +          newCursorX = region[1] + 1;
 +        }
 +        else if (dx == -1)
 +        {
 +          // moving left
 +          newCursorX = region[0] - 1;
 +        }
        }
      }
 -
 -    scrollToVisible(false);
 +    newCursorX = (newCursorX < 0) ? 0 : newCursorX;
 +    if (newCursorX >= maxWidth
 +            || !hidden.isVisible(newCursorX))
 +    {
 +      newCursorX = original;
 +    }
 +    return newCursorX;
    }
 -
    /**
     * Scroll to make the cursor visible in the viewport.
     * 
      AlignFrame af = Desktop.getAlignFrameFor(complement);
      FeatureRendererModel fr2 = af.getFeatureRenderer();
  
-     int j = results.getSize();
+     List<SearchResultMatchI> matches = results.getResults();
+     int j = matches.size();
      List<String> infos = new ArrayList<>();
      for (int i = 0; i < j; i++)
      {
-       SearchResultMatchI match = results.getResults().get(i);
+       SearchResultMatchI match = matches.get(i);
        int pos = match.getStart();
        if (pos == match.getEnd())
        {
                    pos);
            if (mf != null)
            {
 -            unshownFeatures = seqARep.appendFeatures(tooltipText,
 +            unshownFeatures += seqARep.appendFeatures(tooltipText,
                      pos, mf, fr2, MAX_TOOLTIP_LENGTH);
            }
          }
@@@ -959,7 -959,6 +959,7 @@@ public abstract class AlignmentViewpor
      ranges = null;
      currentTree = null;
      selectionGroup = null;
 +    colSel = null;
      setAlignment(null);
    }
  
        codingComplement.setUpdateStructures(needToUpdateStructureViews);
      }
    }
+   @Override
+   public Iterator<int[]> getViewAsVisibleContigs(boolean selectedRegionOnly)
+   {
+     int start = 0;
+     int end = 0;
+     if (selectedRegionOnly && selectionGroup != null)
+     {
+       start = selectionGroup.getStartRes();
+       end = selectionGroup.getEndRes() + 1;
+     }
+     else
+     {
+       end = alignment.getWidth();
+     }
+     return (alignment.getHiddenColumns().getVisContigsIterator(start, end,
+             false));
+   }
  }