Merge remote-tracking branch 'origin/features/JAL-2620alternativeCodeTables' into...
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 5 Mar 2019 16:44:20 +0000 (16:44 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 5 Mar 2019 16:44:20 +0000 (16:44 +0000)
1  2 
resources/lang/Messages.properties
resources/lang/Messages_es.properties
src/jalview/gui/AlignFrame.java
src/jalview/jbgui/GAlignFrame.java
src/jalview/schemes/ResidueProperties.java

@@@ -30,7 -30,6 +30,7 @@@ action.minimize_associated_windows = Mi
  action.close_all = Close all
  action.load_project = Load Project
  action.save_project = Save Project
 +action.save_project_as = Save Project as...
  action.quit = Quit
  action.expand_views = Expand Views
  action.gather_views = Gather Views
@@@ -173,9 -172,10 +173,9 @@@ label.principal_component_analysis = Pr
  label.average_distance_identity = Average Distance Using % Identity
  label.neighbour_joining_identity = Neighbour Joining Using % Identity
  label.choose_calculation = Choose Calculation
 -label.treecalc_title = {0} Using {1}
 +label.calc_title = {0} Using {1}
  label.tree_calc_av = Average Distance
  label.tree_calc_nj = Neighbour Joining
 -label.select_score_model = Select score model
  label.score_model_pid = % Identity
  label.score_model_blosum62 = BLOSUM62
  label.score_model_pam250 = PAM 250
@@@ -266,7 -266,6 +266,7 @@@ label.use_rnaview = Use RNAView for sec
  label.autoadd_secstr = Add secondary structure annotation to alignment
  label.autoadd_temp = Add Temperature Factor annotation to alignment
  label.structure_viewer = Default structure viewer
 +label.double_click_to_browse = Double-click to browse for file
  label.chimera_path = Path to Chimera program
  label.chimera_path_tip = Jalview will first try any path entered here, else standard installation locations.<br>Double-click to browse for file.
  label.invalid_chimera_path = Chimera path not found or not executable
@@@ -403,6 -402,10 +403,6 @@@ label.view_name_original = Origina
  label.enter_view_name = Enter View Name
  label.enter_label = Enter label
  label.enter_label_for_the_structure = Enter a label for the structure
 -label.pdb_entry_is_already_displayed = {0} is already displayed.\nDo you want to re-use this viewer ?
 -label.map_sequences_to_visible_window = Map Sequences to Visible Window: {0}
 -label.add_pdbentry_to_view = Do you want to add {0} to the view called\n{1}\n
 -label.align_to_existing_structure_view = Align to existing structure view
  label.pdb_entries_couldnt_be_retrieved = The following pdb entries could not be retrieved from the PDB\:\n{0}\nPlease retry, or try downloading them manually.
  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.
@@@ -416,7 -419,7 +416,7 @@@ label.input_alignment_from_url = Input 
  label.input_alignment = Input Alignment
  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 = Couldn't locate {0}
 +label.couldnt_locate = Could not locate {0}
  label.url_not_found = URL not found
  label.new_sequence_url_link = New sequence URL link
  label.cannot_edit_annotations_in_wrapped_view = Cannot edit annotations in wrapped view
@@@ -502,10 -505,6 +502,10 @@@ label.edit_name_description = Edit Name
  label.create_sequence_feature = Create Sequence Feature...
  label.edit_sequence = Edit Sequence
  label.edit_sequences = Edit Sequences
 +label.insert_gap = Insert 1 gap
 +label.insert_gaps = Insert {0} gaps
 +label.delete_gap = Delete 1 gap
 +label.delete_gaps = Delete {0} gaps
  label.sequence_details = Sequence Details
  label.jmol_help = Jmol Help
  label.chimera_help = Chimera Help
@@@ -775,7 -774,7 +775,7 @@@ label.run_with_preset_params = Run {0} 
  label.view_and_change_parameters_before_running_calculation = View and change parameters before running calculation
  label.view_documentation = View documentation
  label.select_return_type = Select return type
- label.translation_of_params = Translation of {0}
+ label.translation_of_params = Translation of {0} (Table {1})
  label.features_for_params = Features for - {0}
  label.annotations_for_params = Annotations for - {0}
  label.generating_features_for_params = Generating features for - {0}
@@@ -883,6 -882,7 +883,6 @@@ label.error_unsupported_owwner_user_col
  label.save_alignment_to_file = Save Alignment to file
  label.save_features_to_file = Save Features to File
  label.save_annotation_to_file = Save Annotation to File
 -label.no_features_on_alignment = No features found on alignment
  label.save_pdb_file = Save PDB File
  label.save_text_to_file = Save Text to File
  label.save_state = Save State
@@@ -1218,6 -1218,7 +1218,6 @@@ label.pdb_sequence_fetcher = PDB Sequen
  label.result = result
  label.results = results
  label.structure_chooser = Structure Chooser
 -label.select = Select : 
  label.invert = Invert 
  label.select_pdb_file = Select PDB File
  info.select_filter_option = Select Filter Option/Manual Entry
@@@ -1287,6 -1288,7 +1287,6 @@@ label.SEQUENCE_ID_for_DB_ACCESSION1 = P
  label.SEQUENCE_ID_for_DB_ACCESSION2 = URL links using '$SEQUENCE_ID$' for DB accessions now use '$DB_ACCESSION$'.
  label.do_not_display_again = Do not display this message again
  exception.url_cannot_have_duplicate_id = {0} cannot be used as a label for more than one line
 -label.filter = Filter text:
  action.customfilter = Custom only
  action.showall = Show All
  label.insert = Insert:
@@@ -1354,6 -1356,7 +1354,6 @@@ label.colour_by_text = Colour by tex
  label.graduated_colour = Graduated Colour
  label.by_text_of = By text of
  label.by_range_of = By range of
 -label.filters_tooltip = Click to set or amend filters
  label.or = Or
  label.and = And
  label.sequence_feature_colours = Sequence Feature Colours
@@@ -1364,59 -1367,3 +1364,59 @@@ label.most_bound_molecules = Most Boun
  label.most_polymer_residues = Most Polymer Residues
  label.cached_structures = Cached Structures
  label.free_text_search = Free Text Search
 +label.backupfiles_confirm_delete = Confirm delete
 +label.backupfiles_confirm_delete_old_files = Delete the following older backup files? (see the Backups tab in Preferences for more options)
 +label.backupfiles_confirm_save_file = Confirm save file
 +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.backups = Backups
 +label.backup = Backup
 +label.backup_files = Backup Files
 +label.enable_backupfiles = Enable backup files
 +label.backup_filename_strategy = Backup filename strategy
 +label.append_to_filename = Append to filename (%n is replaced by the backup number)
 +label.append_to_filename_tooltip = %n in the text will be replaced by the backup number. The text will appear after the filename. See the summary box above.
 +label.index_digits = Number of digits to use for the backup number (%n)
 +label.summary_of_backups_scheme = Summary of backup scheme
 +label.increment_index = Increase appended text numbers - newest file has largest number.
 +label.reverse_roll = "Roll" appended text numbers - newest backup file is always number 1.
 +label.keep_files = Deleting old backup files
 +label.keep_all_backup_files = Do not delete old backup files
 +label.keep_only_this_number_of_backup_files = Keep only this number of most recent backup files
 +label.autodelete_old_backup_files = Autodelete old backup files:
 +label.always_ask = Always ask
 +label.auto_delete = Automatically delete
 +label.filename = filename
 +label.braced_oldest = (oldest)
 +label.braced_newest = (most recent)
 +label.configuration = Configuration
 +label.configure_feature_tooltip = Click to configure variable colour or filters
 +label.schemes = Schemes
 +label.customise = Customise
 +label.default = Default
 +label.single_file = Single backup
 +label.keep_all_versions = Keep all versions
 +label.rolled_backups = Rolled backup files
 +label.previously_saved_scheme = Previously saved scheme
 +label.no_backup_files = NO BACKUP FILES
 +label.include_backup_files = Include backup files
 +label.cancel_changes = Cancel changes
 +label.warning_confirm_change_reverse = Warning!\nIf you change the increment/decrement of the backup filename number, without changing the suffix or number of digits,\nthis may cause loss of backup files created with the previous backup filename scheme.\nAre you sure you wish to do this?
 +label.change_increment_decrement = Change increment/decrement?
 +label.was_previous = was {0}
 +label.newerdelete_replacement_line = Backup file\n''{0}''\t(modified {2}, size {4})\nis to be deleted and replaced by apparently older file\n''{1}''\t(modified {3}, size {5}).
 +label.confirm_deletion_or_rename = Confirm deletion of ''{0}'' or rename to ''{1}''?
 +label.newerdelete_line = Backup file\n''{0}''\t(modified {2}, size {4})\nis to be deleted but is newer than the oldest remaining backup file\n''{1}''\t(modified {3}, size {5}).
 +label.confirm_deletion = Confirm deletion of ''{0}''?
 +label.delete = Delete
 +label.rename = Rename
 +label.keep = Keep
 +label.file_info = (modified {0}, size {1})
 +label.annotation_name = Annotation Name
 +label.annotation_description = Annotation Description 
 +label.edit_annotation_name_description = Edit Annotation Name/Description
 +label.alignment = alignment
 +label.pca = PCA
 +label.create_image_of = Create {0} image of {1}
 +label.click_to_edit = Click to edit, right-click for menu
@@@ -30,7 -30,6 +30,7 @@@ action.minimize_associated_windows = Mi
  action.close_all = Cerrar todo
  action.load_project = Cargar proyecto
  action.save_project = Guardar proyecto
 +action.save_project_as = Guardar proyecto como...
  action.quit = Salir
  action.expand_views = Expandir vistas
  action.gather_views = Capturar vistas
@@@ -170,9 -169,10 +170,9 @@@ label.principal_component_analysis = An
  label.average_distance_identity = Distancia Media Usando % de Identidad
  label.neighbour_joining_identity = Unir vecinos utilizando % de Identidad
  label.choose_calculation = Elegir el cálculo
 -label.treecalc_title = {0} utilizando {1}
 +label.calc_title = {0} utilizando {1}
  label.tree_calc_av = Distancia media
  label.tree_calc_nj = Unir vecinos
 -label.select_score_model = Selecciones modelo de puntuación
  label.score_model_pid = % Identidad
  label.score_model_blosum62 = BLOSUM62
  label.score_model_pam250 = PAM 250
@@@ -370,6 -370,10 +370,6 @@@ label.ignore_unmatched_dropped_files = 
  label.enter_view_name = Introduzca un nombre para la vista
  label.enter_label = Introducir etiqueta
  label.enter_label_for_the_structure = Introducir una etiqueta para la estructura
 -label.pdb_entry_is_already_displayed = {0} Ya est\u00E1 mostrado.\nQuieres volver a usar este visor?
 -label.map_sequences_to_visible_window = Mapa de secuencias en ventana visible: {0}
 -label.add_pdbentry_to_view = Quieres a\u00F1adir {0} a la vista llamada\n{1}\n
 -label.align_to_existing_structure_view = Alinear a una estructura ya existente
  label.pdb_entries_couldnt_be_retrieved = Las siguientes entradas pdb no pueden ser extra\u00EDdas del PDB\:\n{0}\nPor favor, prueba descarg\u00E1ndolas manualmente.
  label.couldnt_load_file = No se pudo cargar el fichero
  label.couldnt_find_pdb_id_in_file = No se pudo encontrar un Id PDB en el fichero suministrado. Por favor, introduzca un Id para identificar esta estructura.
@@@ -468,10 -472,6 +468,10 @@@ label.edit_name_description = Editar no
  label.create_sequence_feature = Crear función de secuencia
  label.edit_sequence = Editar secuencia
  label.edit_sequences = Editar secuencias
 +label.insert_gap = Insertar 1 hueco
 +label.insert_gaps = Insertar {0} huecos
 +label.delete_gap = Borrar 1 hueco
 +label.delete_gaps = Borrar {0} huecos
  label.sequence_details = Detalles de la secuencia
  label.jmol_help = Ayuda de Jmol
  # Todos/Todas is gender-sensitive, but currently only used for feminine (cadena / anotación)! 
@@@ -704,7 -704,7 +704,7 @@@ label.run_with_preset_params = Ejecuta
  label.view_and_change_parameters_before_running_calculation = Ver y cambiar los parámetros antes de lanzar el cálculo
  label.view_documentation = Ver documentación
  label.select_return_type = Seleccionar el tipo de retorno
- label.translation_of_params = Traducción de {0}
+ label.translation_of_params = Traducción de {0} (Tabla {1})
  label.features_for_params = Características de - {0}
  label.annotations_for_params = Anotaciones de - {0}
  label.generating_features_for_params = Generando características de - {0}
@@@ -808,6 -808,7 +808,6 @@@ label.error_unsupported_owwner_user_col
  label.save_alignment_to_file = Guardar Alineamiento en fichero
  label.save_features_to_file = Guardar Características en un fichero
  label.save_annotation_to_file = Guardar Anotación en un fichero
 -label.no_features_on_alignment = No se han encontrado características en el alineamiento
  label.save_pdb_file = Guardar fichero PDB 
  label.save_text_to_file = Guardar Texto en un fichero
  label.save_state = Guardar estado
@@@ -1177,12 -1178,12 +1177,12 @@@ label.structures_filter=Filtro de Estru
  label.scale_protein_to_cdna=Adaptar proteína a cDNA
  label.scale_protein_to_cdna_tip=Hacer a los residuos de proteínas de la misma anchura que los codones en ventanas divididas
  status.loading_cached_pdb_entries=Cargando Entradas PDB en Caché
 -label.select=Seleccionar :
  label.select_by_annotation=Seleccionar/Ocultar Columnas por Anotación
  action.select_by_annotation=Seleccionar/Ocultar Columnas por Anotación...
  action.export_features=Exportar Características
  error.invalid_regex=Expresión regular inválida
  label.autoadd_temp=Añadir anotación factor de temperatura al alineamiento
 +label.double_click_to_browse = Haga doble clic para buscar fichero 
  label.chimera_path_tip=Jalview intentará primero las rutas introducidas aquí, Y si no las rutas usuales de instalación
  label.structure_chooser=Selector de Estructuras
  label.structure_chooser_manual_association=Selector de Estructuras - asociación manual
@@@ -1229,13 -1230,13 +1229,13 @@@ exception.resource_not_be_found=El recu
  label.aacon_calculations=cálculos AACon
  label.pdb_web-service_error=Error de servicio web PDB
  exception.unable_to_detect_internet_connection=Jalview no puede detectar una conexión a Internet
 -label.chimera_path=Ruta de acceso a programa Chimera
 +label.chimera_path=Ruta de acceso a Chimera
  warn.delete_all=<html>Borrar todas las secuencias cerrará la ventana del alineamiento.<br>Confirmar o Cancelar.
  label.select_all=Seleccionar Todos
  label.alpha_helix=Hélice Alfa
  label.chimera_help=Ayuda para Chimera
  label.find_tip=Buscar alineamiento, selección o IDs de secuencia para una subsecuencia (sin huecos)
 -label.structure_viewer=Visualizador de estructura por defecto
 +label.structure_viewer=Visualizador por defecto
  label.embbed_biojson=Incrustar BioJSON al exportar HTML
  label.transparency_tip=Ajustar la transparencia a "ver a través" los colores de las características.
  label.choose_annotations=Escoja anotaciones
@@@ -1288,6 -1289,7 +1288,6 @@@ label.SEQUENCE_ID_for_DB_ACCESSION1 = P
  label.SEQUENCE_ID_for_DB_ACCESSION2 = URL enlaza usando '$SEQUENCE_ID$' para accesiones DB ahora usar '$DB_ACCESSION$'.
  label.do_not_display_again = No mostrar este mensaje de nuevo
  exception.url_cannot_have_duplicate_id = {0} no puede ser usada como etiqueta en más de un enlace
 -label.filter = Filtrar texto:
  action.customfilter = Sólo personalizado
  action.showall = Mostrar todo
  label.insert = Insertar:
@@@ -1355,6 -1357,7 +1355,6 @@@ label.colour_by_text = Colorear por tex
  label.graduated_colour = Color graduado
  label.by_text_of = Por texto de
  label.by_range_of = Por rango de
 -label.filters_tooltip = Haga clic para configurar o modificar los filtros
  label.or = O
  label.and = Y
  label.sequence_feature_colours = Colores de características de las secuencias
@@@ -1365,59 -1368,3 +1365,59 @@@ label.most_bound_molecules = Más Molécu
  label.most_polymer_residues = Más Residuos de Polímeros
  label.cached_structures = Estructuras en Caché
  label.free_text_search = Búsqueda de texto libre
 +label.backupfiles_confirm_delete = Confirmar borrar
 +label.backupfiles_confirm_delete_old_files = ¿Borrar los siguientes archivos? (ver la pestaña 'Copias' de la ventana de Preferencias para más opciones)
 +label.backupfiles_confirm_save_file = Confirmar guardar archivo
 +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.backups = Respaldos
 +label.backup = Respaldo
 +label.backup_files = Archivos de respaldos
 +label.enable_backupfiles = Habilitar archivos de respaldos
 +label.backup_filename_strategy = Estrategia de nombres de archivo de respaldos
 +label.append_to_filename = Adjuntar texto (%n es reemplazado por el número de respaldo)
 +label.append_to_filename_tooltip = %n en el texto será reemplazado por el número de respaldo. El texto será después del nombre del archivo. Vea el cuadro de resumen arriba.
 +label.index_digits = Número de dígitos a utilizar para el número de respaldo.
 +label.summary_of_backups_scheme = Resumen del esquema de copias de seguridad
 +label.increment_index = Aumente los números de texto adjuntos: el archivo más nuevo tiene el número más grande
 +label.reverse_roll = Ciclos de texto adjuntos: el respaldo más reciente es siempre el número 1
 +label.keep_files = Borrando los respaldos antiguos
 +label.keep_all_backup_files = No borrar respaldos antiguas
 +label.keep_only_this_number_of_backup_files = Mantenga solo este número de respaldos más recientes
 +label.autodelete_old_backup_files = Borrer automáticamente respaldos antiguos:
 +label.always_ask = Pregunta siempre
 +label.auto_delete = Borrer automáticamente
 +label.filename = nombre_de_archivo
 +label.braced_oldest = (mas antiguo)
 +label.braced_newest = (mas nuevo)
 +label.configuration = Configuración
 +label.configure_feature_tooltip = Haga clic para configurar el color o los filtros
 +label.schemes = Esquemas
 +label.customise = Personalizado
 +label.default = Defecto
 +label.single_file = Solo uno respaldo
 +label.keep_all_versions = Mantener todas las versiones
 +label.rolled_backups = Ciclos respaldos
 +label.previously_saved_scheme = Esquema previamente guardado
 +label.no_backup_files = NO ARCHIVOS DE RESPALDOS
 +label.include_backup_files = Incluir archivos de respaldos
 +label.cancel_changes = Cancelar cambios
 +label.warning_confirm_change_reverse = ¡Advertencia!\nSi cambia el incremento/decremento del número de archivos de respaldos, sin cambiar el sufijo o número de dígitos,\nesto puede causar la pérdida de los archivos de respaldos creados con el esquema anterior de nombre de archivo de respaldos.\n¿Está seguro de que desea hacer esto?
 +label.change_increment_decrement = ¿Cambiar de incremento/decremento?
 +label.was_previous = era {0}
 +label.newerdelete_replacement_line = El archivo de respaldo\n''{0}''\t(modificado {2}, tamaño {4})\nserá borrado y reemplazarse por un archivo aparentemente más antiguo\n''{1}''\t(modificado {3}, tamaño {5}).
 +label.confirm_deletion_or_rename = Confirmar borrar ''{0}'', o cambiar el nombre a ''{1}''?
 +label.newerdelete_line = El archivo de respaldo\n''{0}''\t(modificado {2}, tamaño {4})\nserá borrado pero es mas nuevo que el archivo de respaldo restante más antiguo\n''{1}''\t(modified {3}, size {5}).
 +label.confirm_deletion = Confirmar eliminar ''{0}''?
 +label.delete = Borrar
 +label.rename = Cambiar
 +label.keep = Mantener
 +label.file_info = (modificado {0}, tamaño {1})
 +label.annotation_name = Nombre de la anotación
 +label.annotation_description = Descripción de la anotación 
 +label.edit_annotation_name_description = Editar el nombre/descripción de la anotación
 +label.alignment = alineamiento
 +label.pca = ACP
 +label.create_image_of = Crear imagen {0} de {1}
 +label.click_to_edit = Haga clic para editar, clic en el botón derecho para ver el menú  
@@@ -24,6 -24,7 +24,7 @@@ import jalview.analysis.AlignmentSorter
  import jalview.analysis.AlignmentUtils;
  import jalview.analysis.CrossRef;
  import jalview.analysis.Dna;
+ import jalview.analysis.GeneticCodeI;
  import jalview.analysis.ParseProperties;
  import jalview.analysis.SequenceIdMatcher;
  import jalview.api.AlignExportSettingI;
@@@ -64,7 -65,6 +65,7 @@@ import jalview.gui.ColourMenuHelper.Col
  import jalview.gui.ViewSelectionMenu.ViewSetProvider;
  import jalview.io.AlignmentProperties;
  import jalview.io.AnnotationFile;
 +import jalview.io.BackupFiles;
  import jalview.io.BioJsHTMLOutput;
  import jalview.io.DataSourceType;
  import jalview.io.FileFormat;
@@@ -734,9 -734,9 +735,9 @@@ public class AlignFrame extends GAlignF
  
      int aSize = alignPanels.size();
  
 -    tabbedPane.setVisible(aSize > 1 || ap.av.viewName != null);
 +    tabbedPane.setVisible(aSize > 1 || ap.av.getViewName() != null);
  
 -    if (aSize == 1 && ap.av.viewName == null)
 +    if (aSize == 1 && ap.av.getViewName() == null)
      {
        this.getContentPane().add(ap, BorderLayout.CENTER);
      }
  
        expandViews.setEnabled(true);
        gatherViews.setEnabled(true);
 -      tabbedPane.addTab(ap.av.viewName, ap);
 +      tabbedPane.addTab(ap.av.getViewName(), ap);
  
        ap.setVisible(false);
      }
      gatherViews.setEnabled(true);
      tabbedPane.setVisible(true);
      AlignmentPanel first = alignPanels.get(0);
 -    tabbedPane.addTab(first.av.viewName, first);
 +    tabbedPane.addTab(first.av.getViewName(), first);
      this.getContentPane().add(tabbedPane, BorderLayout.CENTER);
    }
  
     * @param av
     *          AlignViewport
     */
 -  void setMenusFromViewport(AlignViewport av)
 +  public void setMenusFromViewport(AlignViewport av)
    {
      padGapsMenuitem.setSelected(av.isPadGaps());
      colourTextMenuItem.setSelected(av.isShowColourText());
      return progressBar.operationInProgress();
    }
  
 +  /**
 +   * Sets the text of the status bar. Note that setting a null or empty value
 +   * will cause the status bar to be hidden, with possibly undesirable flicker
 +   * of the screen layout.
 +   */
    @Override
    public void setStatus(String text)
    {
                  shortName.lastIndexOf(java.io.File.separatorChar) + 1);
        }
  
 -      success = new Jalview2XML().saveAlignment(this, file, shortName);
 +      success = new jalview.project.Jalview2XML().saveAlignment(this, file,
 +              shortName);
  
        statusBar.setText(MessageManager.formatMessage(
                "label.successfully_saved_to_file_in_format", new Object[]
        }
        else
        {
 +        // create backupfiles object and get new temp filename destination
 +        BackupFiles backupfiles = new BackupFiles(file);
 +
          try
          {
 -          PrintWriter out = new PrintWriter(new FileWriter(file));
 +          PrintWriter out = new PrintWriter(
 +                  new FileWriter(backupfiles.getTempFilePath()));
  
            out.print(output);
            out.close();
            success = false;
            ex.printStackTrace();
          }
 +
 +        backupfiles.setWriteSuccess(success);
 +        // do the backup file roll and rename the temp file to actual file
 +        success = backupfiles.rollBackupsAndRenameTempFile();
 +
        }
      }
  
    @Override
    public void selectAllSequenceMenuItem_actionPerformed(ActionEvent e)
    {
 -    SequenceGroup sg = new SequenceGroup();
 -
 -    for (int i = 0; i < viewport.getAlignment().getSequences().size(); i++)
 -    {
 -      sg.addSequence(viewport.getAlignment().getSequenceAt(i), false);
 -    }
 +    SequenceGroup sg = new SequenceGroup(
 +            viewport.getAlignment().getSequences());
  
      sg.setEndRes(viewport.getAlignment().getWidth() - 1);
      viewport.setSelectionGroup(sg);
 +    viewport.isSelectionGroupChanged(true);
      viewport.sendSelection();
      // JAL-2034 - should delegate to
      // alignPanel to decide if overview needs
      /*
       * Create a new AlignmentPanel (with its own, new Viewport)
       */
 -    AlignmentPanel newap = new Jalview2XML().copyAlignPanel(alignPanel);
 +    AlignmentPanel newap = new jalview.project.Jalview2XML()
 +            .copyAlignPanel(alignPanel);
      if (!copyAnnotation)
      {
        /*
  
      newap.av.setGatherViewsHere(false);
  
 -    if (viewport.viewName == null)
 +    if (viewport.getViewName() == null)
      {
 -      viewport.viewName = MessageManager
 -              .getString("label.view_name_original");
 +      viewport.setViewName(MessageManager
 +              .getString("label.view_name_original"));
      }
  
      /*
        newap.refresh(true); // adjust layout of annotations
      }
  
 -    newap.av.viewName = getNewViewName(viewTitle);
 +    newap.av.setViewName(getNewViewName(viewTitle));
  
      addAlignmentPanel(newap, true);
      newap.alignmentChanged();
        if (comp instanceof AlignmentPanel)
        {
          AlignmentPanel ap = (AlignmentPanel) comp;
 -        if (!existingNames.contains(ap.av.viewName))
 +        if (!existingNames.contains(ap.av.getViewName()))
          {
 -          existingNames.add(ap.av.viewName);
 +          existingNames.add(ap.av.getViewName());
          }
        }
      }
      viewport.setFollowHighlight(state);
      if (state)
      {
 -      alignPanel.scrollToPosition(viewport.getSearchResults(), false);
 +      alignPanel.scrollToPosition(viewport.getSearchResults());
      }
    }
  
      viewport.expandColSelection(sg, false);
      viewport.hideAllSelectedSeqs();
      viewport.hideSelectedColumns();
 +    alignPanel.updateLayout();
      alignPanel.paintAlignment(true, true);
      viewport.sendSelection();
    }
    public void hideSelColumns_actionPerformed(ActionEvent e)
    {
      viewport.hideSelectedColumns();
 +    alignPanel.updateLayout();
      alignPanel.paintAlignment(true, true);
      viewport.sendSelection();
    }
                  alignPanel.setOverviewPanel(null);
                };
              });
 +    if (getKeyListeners().length > 0)
 +    {
 +      frame.addKeyListener(getKeyListeners()[0]);
 +    }
  
      alignPanel.setOverviewPanel(overview);
    }
  
      frameTitle += " from ";
  
 -    if (viewport.viewName != null)
 +    if (viewport.getViewName() != null)
      {
 -      frameTitle += viewport.viewName + " of ";
 +      frameTitle += viewport.getViewName() + " of ";
      }
  
      frameTitle += this.title;
     * frame's DNA sequences to their aligned protein (amino acid) equivalents.
     */
    @Override
-   public void showTranslation_actionPerformed(ActionEvent e)
+   public void showTranslation_actionPerformed(GeneticCodeI codeTable)
    {
      AlignmentI al = null;
      try
      {
        Dna dna = new Dna(viewport, viewport.getViewAsVisibleContigs(true));
  
-       al = dna.translateCdna();
+       al = dna.translateCdna(codeTable);
      } catch (Exception ex)
      {
        jalview.bin.Cache.log.error(
        af.setFileFormat(this.currentFileFormat);
        final String newTitle = MessageManager
                .formatMessage("label.translation_of_params", new Object[]
-               { this.getTitle() });
+               { this.getTitle(), codeTable.getId() });
        af.setTitle(newTitle);
        if (Cache.getDefault(Preferences.ENABLE_SPLIT_FRAME, true))
        {
              int assocfiles = 0;
              if (filesmatched.size() > 0)
              {
 -              if (Cache.getDefault("AUTOASSOCIATE_PDBANDSEQS", false)
 -                      || JvOptionPane.showConfirmDialog(thisaf,
 -                              MessageManager.formatMessage(
 -                                      "label.automatically_associate_structure_files_with_sequences_same_name",
 -                                      new Object[]
 -                                      { Integer.valueOf(filesmatched.size())
 -                                              .toString() }),
 -                              MessageManager.getString(
 -                                      "label.automatically_associate_structure_files_by_name"),
 -                              JvOptionPane.YES_NO_OPTION) == JvOptionPane.YES_OPTION)
 -
 +              boolean autoAssociate = Cache.getDefault("AUTOASSOCIATE_PDBANDSEQS", false);
 +              if (!autoAssociate)
 +              {
 +                String msg = MessageManager.formatMessage(
 +                        "label.automatically_associate_structure_files_with_sequences_same_name",
 +                        new Object[]
 +                        { Integer.valueOf(filesmatched.size())
 +                                .toString() });
 +                String ttl = MessageManager.getString(
 +                        "label.automatically_associate_structure_files_by_name");
 +                int choice = JvOptionPane.showConfirmDialog(thisaf, msg,
 +                        ttl, JvOptionPane.YES_NO_OPTION);
 +                autoAssociate = choice == JvOptionPane.YES_OPTION;
 +              }
 +              if (autoAssociate)
                {
                  for (Object[] fm : filesmatched)
                  {
                    alignPanel.paintAlignment(true, false);
                  }
                }
 +              else
 +              {
 +                /*
 +                 * add declined structures as sequences
 +                 */
 +                for (Object[] o : filesmatched)
 +                {
 +                  filesnotmatched.add((String) o[0]);
 +                }
 +              }
              }
              if (filesnotmatched.size() > 0)
              {
  
        if (reply != null)
        {
 -        viewport.viewName = reply;
 +        viewport.setViewName(reply);
          // TODO warn if reply is in getExistingViewNames()?
          tabbedPane.setTitleAt(tabbedPane.getSelectedIndex(), reply);
        }
    {
      if (avc.createGroup())
      {
 +      if (applyAutoAnnotationSettings.isSelected())
 +      {
 +        alignPanel.updateAnnotation(true, false);
 +      }
        alignPanel.alignmentChanged();
      }
    }
     */
    public List<? extends AlignmentViewPanel> getAlignPanels()
    {
 -    return alignPanels == null ? Arrays.asList(alignPanel) : alignPanels;
 +    // alignPanels is never null
 +    // return alignPanels == null ? Arrays.asList(alignPanel) : alignPanels;
 +    return alignPanels;
    }
  
    /**
@@@ -21,6 -21,8 +21,8 @@@
  package jalview.jbgui;
  
  import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
+ import jalview.analysis.GeneticCodeI;
+ import jalview.analysis.GeneticCodes;
  import jalview.api.SplitContainerI;
  import jalview.bin.Cache;
  import jalview.gui.JvSwingUtils;
@@@ -75,7 -77,7 +77,7 @@@ public class GAlignFrame extends JInter
  
    protected JMenu sortByAnnotScore = new JMenu();
  
 -  public JLabel statusBar = new JLabel();
 +  protected JLabel statusBar = new JLabel();
  
    protected JMenu outputTextboxMenu = new JMenu();
  
  
    protected JCheckBoxMenuItem showDbRefsMenuitem = new JCheckBoxMenuItem();
  
-   protected JMenuItem showTranslation = new JMenuItem();
+   protected JMenu showTranslation = new JMenu();
  
    protected JMenuItem showReverse = new JMenuItem();
  
          vamsasStore_actionPerformed(e);
        }
      });
-     showTranslation
-             .setText(MessageManager.getString("label.translate_cDNA"));
-     showTranslation.addActionListener(new ActionListener()
-     {
-       @Override
-       public void actionPerformed(ActionEvent e)
+     /*
+      * Translate as cDNA with sub-menu of translation tables
+      */
+     showTranslation.setText(MessageManager
+             .getString("label.translate_cDNA"));
+     boolean first = true;
+     for (final GeneticCodeI table : GeneticCodes.getInstance()
+             .getCodeTables())
+     {
+       JMenuItem item = new JMenuItem(table.getId() + " " + table.getName());
+       showTranslation.add(item);
+       item.addActionListener(new ActionListener()
+       {
+         @Override
+         public void actionPerformed(ActionEvent e)
+         {
+           showTranslation_actionPerformed(table);
+         }
+       });
+       if (first)
        {
-         showTranslation_actionPerformed(e);
+         showTranslation.addSeparator();
        }
-     });
+       first = false;
+     }
      showReverse.setText(MessageManager.getString("label.reverse"));
      showReverse.addActionListener(new ActionListener()
      {
  
    }
  
-   public void showTranslation_actionPerformed(ActionEvent e)
+   public void showTranslation_actionPerformed(GeneticCodeI codeTable)
    {
  
    }
@@@ -20,6 -20,8 +20,8 @@@
   */
  package jalview.schemes;
  
+ import jalview.analysis.GeneticCodes;
  import java.awt.Color;
  import java.util.ArrayList;
  import java.util.Arrays;
@@@ -502,260 -504,6 +504,6 @@@ public class ResiduePropertie
  
    public static String START = "ATG";
  
-   /**
-    * Nucleotide Ambiguity Codes
-    */
-   public static final Map<String, String[]> ambiguityCodes = new Hashtable<>();
-   /**
-    * Codon triplets with additional symbols for unambiguous codons that include
-    * ambiguity codes
-    */
-   public static final Hashtable<String, String> codonHash2 = new Hashtable<>();
-   /**
-    * all ambiguity codes for a given base
-    */
-   public final static Hashtable<String, List<String>> _ambiguityCodes = new Hashtable<>();
-   static
-   {
-     /*
-      * Ambiguity codes as per http://www.chem.qmul.ac.uk/iubmb/misc/naseq.html
-      */
-     ambiguityCodes.put("R", new String[] { "A", "G" });
-     ambiguityCodes.put("Y", new String[] { "T", "C" });
-     ambiguityCodes.put("W", new String[] { "A", "T" });
-     ambiguityCodes.put("S", new String[] { "G", "C" });
-     ambiguityCodes.put("M", new String[] { "A", "C" });
-     ambiguityCodes.put("K", new String[] { "G", "T" });
-     ambiguityCodes.put("H", new String[] { "A", "T", "C" });
-     ambiguityCodes.put("B", new String[] { "G", "T", "C" });
-     ambiguityCodes.put("V", new String[] { "G", "A", "C" });
-     ambiguityCodes.put("D", new String[] { "G", "A", "T" });
-     ambiguityCodes.put("N", new String[] { "G", "A", "T", "C" });
-     // Now build codon translation table
-     codonHash2.put("AAA", "K");
-     codonHash2.put("AAG", "K");
-     codonHash2.put("AAC", "N");
-     codonHash2.put("AAT", "N");
-     codonHash2.put("CAA", "Q");
-     codonHash2.put("CAG", "Q");
-     codonHash2.put("CAC", "H");
-     codonHash2.put("CAT", "H");
-     codonHash2.put("GAA", "E");
-     codonHash2.put("GAG", "E");
-     codonHash2.put("GAC", "D");
-     codonHash2.put("GAT", "D");
-     codonHash2.put("TAC", "Y");
-     codonHash2.put("TAT", "Y");
-     codonHash2.put("ACA", "T");
-     codonHash2.put("ACC", "T");
-     codonHash2.put("ACT", "T");
-     codonHash2.put("ACG", "T");
-     codonHash2.put("CCA", "P");
-     codonHash2.put("CCG", "P");
-     codonHash2.put("CCC", "P");
-     codonHash2.put("CCT", "P");
-     codonHash2.put("GCA", "A");
-     codonHash2.put("GCG", "A");
-     codonHash2.put("GCC", "A");
-     codonHash2.put("GCT", "A");
-     codonHash2.put("TCA", "S");
-     codonHash2.put("TCG", "S");
-     codonHash2.put("TCC", "S");
-     codonHash2.put("TCT", "S");
-     codonHash2.put("AGC", "S");
-     codonHash2.put("AGT", "S");
-     codonHash2.put("AGA", "R");
-     codonHash2.put("AGG", "R");
-     codonHash2.put("CGA", "R");
-     codonHash2.put("CGG", "R");
-     codonHash2.put("CGC", "R");
-     codonHash2.put("CGT", "R");
-     codonHash2.put("GGA", "G");
-     codonHash2.put("GGG", "G");
-     codonHash2.put("GGC", "G");
-     codonHash2.put("GGT", "G");
-     codonHash2.put("TGA", "*");
-     codonHash2.put("TAA", "*");
-     codonHash2.put("TAG", "*");
-     codonHash2.put("TGG", "W");
-     codonHash2.put("TGC", "C");
-     codonHash2.put("TGT", "C");
-     codonHash2.put("ATA", "I");
-     codonHash2.put("ATC", "I");
-     codonHash2.put("ATT", "I");
-     codonHash2.put("ATG", "M");
-     codonHash2.put("CTA", "L");
-     codonHash2.put("CTG", "L");
-     codonHash2.put("CTC", "L");
-     codonHash2.put("CTT", "L");
-     codonHash2.put("TTA", "L");
-     codonHash2.put("TTG", "L");
-     codonHash2.put("GTA", "V");
-     codonHash2.put("GTG", "V");
-     codonHash2.put("GTC", "V");
-     codonHash2.put("GTT", "V");
-     codonHash2.put("TTC", "F");
-     codonHash2.put("TTT", "F");
-     buildAmbiguityCodonSet();
-   }
-   /**
-    * programmatic generation of codons including ambiguity codes
-    */
-   public static void buildAmbiguityCodonSet()
-   {
-     if (_ambiguityCodes.size() > 0)
-     {
-       System.err
-               .println("Ignoring multiple calls to buildAmbiguityCodonSet");
-       return;
-     }
-     // Invert the ambiguity code set
-     for (Map.Entry<String, String[]> acode : ambiguityCodes.entrySet())
-     {
-       for (String r : acode.getValue())
-       {
-         List<String> codesfor = _ambiguityCodes.get(r);
-         if (codesfor == null)
-         {
-           _ambiguityCodes.put(r, codesfor = new ArrayList<>());
-         }
-         if (!codesfor.contains(acode.getKey()))
-         {
-           codesfor.add(acode.getKey());
-         }
-         else
-         {
-           System.err.println(
-                   "Inconsistency in the IUBMB ambiguity code nomenclature table: collision for "
-                           + acode.getKey() + " in residue " + r);
-         }
-       }
-     }
-     // and programmatically add in the ambiguity codes that yield the same amino
-     // acid
-     String[] unambcodons = codonHash2.keySet()
-             .toArray(new String[codonHash2.size()]);
-     for (String codon : unambcodons)
-     {
-       String residue = codonHash2.get(codon);
-       String acodon[][] = new String[codon.length()][];
-       for (int i = 0, iSize = codon.length(); i < iSize; i++)
-       {
-         String _ac = "" + codon.charAt(i);
-         List<String> acodes = _ambiguityCodes.get(_ac);
-         if (acodes != null)
-         {
-           acodon[i] = acodes.toArray(new String[acodes.size()]);
-         }
-         else
-         {
-           acodon[i] = new String[] {};
-         }
-       }
-       // enumerate all combinations and test for veracity of translation
-       int tpos[] = new int[codon.length()],
-               cpos[] = new int[codon.length()];
-       for (int i = 0; i < tpos.length; i++)
-       {
-         tpos[i] = -1;
-       }
-       tpos[acodon.length - 1] = 0;
-       int ipos, j;
-       while (tpos[0] < acodon[0].length)
-       {
-         // make all codons for this combination
-         char allres[][] = new char[tpos.length][];
-         String _acodon = "";
-         for (ipos = 0; ipos < tpos.length; ipos++)
-         {
-           if (acodon[ipos].length == 0 || tpos[ipos] < 0)
-           {
-             _acodon += codon.charAt(ipos);
-             allres[ipos] = new char[] { codon.charAt(ipos) };
-           }
-           else
-           {
-             _acodon += acodon[ipos][tpos[ipos]];
-             String[] altbase = ambiguityCodes.get(acodon[ipos][tpos[ipos]]);
-             allres[ipos] = new char[altbase.length];
-             j = 0;
-             for (String ab : altbase)
-             {
-               allres[ipos][j++] = ab.charAt(0);
-             }
-           }
-         }
-         // test all codons for this combination
-         for (ipos = 0; ipos < cpos.length; ipos++)
-         {
-           cpos[ipos] = 0;
-         }
-         boolean valid = true;
-         do
-         {
-           String _codon = "";
-           for (j = 0; j < cpos.length; j++)
-           {
-             _codon += allres[j][cpos[j]];
-           }
-           String tr = codonHash2.get(_codon);
-           if (valid = (tr != null && tr.equals(residue)))
-           {
-             // advance to next combination
-             ipos = acodon.length - 1;
-             while (++cpos[ipos] >= allres[ipos].length && ipos > 0)
-             {
-               cpos[ipos] = 0;
-               ipos--;
-             }
-           }
-         } while (valid && cpos[0] < allres[0].length);
-         if (valid)
-         {
-           // Add this to the set of codons we will translate
-           // System.out.println("Adding ambiguity codon: " + _acodon + " for "
-           // + residue);
-           codonHash2.put(_acodon, residue);
-         }
-         else
-         {
-           // System.err.println("Rejecting ambiguity codon: " + _acodon
-           // + " for " + residue);
-         }
-         // next combination
-         ipos = acodon.length - 1;
-         while (++tpos[ipos] >= acodon[ipos].length && ipos > 0)
-         {
-           tpos[ipos] = -1;
-           ipos--;
-         }
-       }
-     }
-   }
    // Stores residue codes/names and colours and other things
    public static Map<String, Map<String, Integer>> propHash = new Hashtable<>();
  
  
    public static String codonTranslate(String lccodon)
    {
-     String cdn = codonHash2.get(lccodon.toUpperCase());
-     if ("*".equals(cdn))
+     String peptide = GeneticCodes.getInstance().getStandardCodeTable()
+             .translate(lccodon);
+     if ("*".equals(peptide))
      {
-       return STOP;
+       return "STOP";
      }
-     return cdn;
+     return peptide;
    }
  
 -  public static Hashtable<String, String> toDssp3State;
 +  /*
 +   * lookup of (A-Z) alternative secondary structure symbols'
 +   * equivalents in DSSP3 notation
 +   */
 +  private static char[] toDssp3State;
    static
    {
 -    toDssp3State = new Hashtable<>();
 -    toDssp3State.put("H", "H");
 -    toDssp3State.put("E", "E");
 -    toDssp3State.put("C", " ");
 -    toDssp3State.put(" ", " ");
 -    toDssp3State.put("T", " ");
 -    toDssp3State.put("B", "E");
 -    toDssp3State.put("G", "H");
 -    toDssp3State.put("I", "H");
 -    toDssp3State.put("X", " ");
 +    toDssp3State = new char[9]; // for 'A'-'I'; extend if needed
 +    Arrays.fill(toDssp3State, ' ');
 +    toDssp3State['B' - 'A'] = 'E';
 +    toDssp3State['E' - 'A'] = 'E';
 +    toDssp3State['G' - 'A'] = 'H';
 +    toDssp3State['H' - 'A'] = 'H';
 +    toDssp3State['I' - 'A'] = 'H';
    }
  
    /**
     * translate from other dssp secondary structure alphabets to 3-state
     * 
 -   * @param ssstring
 -   * @return ssstring as a three-state secondary structure assignment.
 +   * @param ssString
 +   * @return ssstring
     */
 -  public static String getDssp3state(String ssstring)
 +  public static String getDssp3state(String ssString)
    {
 -    if (ssstring == null)
 +    if (ssString == null)
      {
        return null;
      }
 -    StringBuffer ss = new StringBuffer();
 -    for (int i = 0; i < ssstring.length(); i++)
 +    int lookupSize = toDssp3State.length;
 +    int len = ssString.length();
 +    char[] trans = new char[len];
 +    for (int i = 0; i < len; i++)
      {
 -      String ssc = ssstring.substring(i, i + 1);
 -      if (toDssp3State.containsKey(ssc))
 +      char c = ssString.charAt(i);
 +      int index = c - 'A';
 +      if (index < 0 || index >= lookupSize)
        {
 -        ss.append(toDssp3State.get(ssc));
 +        trans[i] = ' ';
        }
        else
        {
 -        ss.append(" ");
 +        trans[i] = toDssp3State[index];
        }
      }
 -    return ss.toString();
 +    return new String(trans);
    }
  
    static