From: kiramt Date: Tue, 1 Nov 2016 12:07:06 +0000 (+0000) Subject: JAL-2282 Changed DB accession id token to $DB_ACCESSION$; updated X-Git-Tag: Release_2_10_1^2~18^2~2^2~9 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=55c903147c3642ae7af3b21b9bb274607ca8f496;p=jalview.git JAL-2282 Changed DB accession id token to $DB_ACCESSION$; updated messages --- diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index c3cf90a..bce538c 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -787,9 +787,9 @@ label.hide_columns_containing = Hide columns containing label.hide_columns_not_containing = Hide columns that do not contain option.trim_retrieved_seqs = Trim retrieved sequences label.trim_retrieved_sequences = When the reference sequence is longer than the sequence that you are working with, only keep the relevant subsequences. -label.use_sequence_id_1 = Use $ACCESSION_ID$ or $ACCESSION_ID=//=$ +label.use_sequence_id_1 = Use $DB_ACCESSION$ or $DB_ACCESSION=//=$ label.use_sequence_id_2 = to embed accession id in URL -label.use_sequence_id_3 = Use $SEQUENCE_ID$ similarly to embed sequence name +label.use_sequence_id_3 = Use $SEQUENCE_ID$ similarly to embed sequence id label.use_sequence_id_4 = label.ws_parameters_for = Parameters for {0} label.switch_server = Switch server @@ -1268,3 +1268,7 @@ status.exporting_alignment_as_x_file = Exporting alignment as {0} file label.column = Column label.cant_map_cds = Unable to map CDS to protein\nCDS missing or incomplete label.operation_failed = Operation failed +label.SEQUENCE_ID_no_longer_used = $SEQUENCE_ID$ is no longer used for DB accessions +label.SEQUENCE_ID_for_DB_ACCESSION1 = Please review your URL links in Tools | Preferences | Connections: +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 diff --git a/resources/lang/Messages_es.properties b/resources/lang/Messages_es.properties index e92483f..535abba 100644 --- a/resources/lang/Messages_es.properties +++ b/resources/lang/Messages_es.properties @@ -720,10 +720,10 @@ label.select_columns_containing = Seleccione las columnas que contengan label.select_columns_not_containing = Seleccione las columnas que no contengan option.trim_retrieved_seqs = Ajustar las secuencias recuperadas label.trim_retrieved_sequences = Cuando la secuencia de referencia es más larga que la secuencia con la que está trabajando, sólo se mantienen las subsecuencias relevantes. -label.use_sequence_id_1 = Utilice $ACCESSION_ID$ o $ACCESSION_ID=//=$ +label.use_sequence_id_1 = Utilice $DB_ACCESSION$ o $DB_ACCESSION=//=$ label.use_sequence_id_2 = para embeber el accession id en una URL label.use_sequence_id_3 = Utilice $SEQUENCE_ID$ de manera similar para embeber -label.use_sequence_id_4 = el nombre de la secuencia +label.use_sequence_id_4 = el ID de la secuencia label.ws_parameters_for = Parámetros para {0} label.switch_server = Cambiar servidor label.open_jabaws_web_page = Abra el página principal del servidor JABAWS en un navegador web @@ -1269,3 +1269,7 @@ status.exporting_alignment_as_x_file = Exportando alineamiento como fichero tipo label.column = Columna label.cant_map_cds = No se pudo mapear CDS a proteína\nDatos CDS faltantes o incompletos label.operation_failed = Operación fallada +label.SEQUENCE_ID_no_longer_used = $SEQUENCE_ID$ no se utiliza más para los DB accessions +label.SEQUENCE_ID_for_DB_ACCESSION1 = Por favor, revise sus URL links en Tools | Preferences | Connections: +label.SEQUENCE_ID_for_DB_ACCESSION2 = URL links using '$SEQUENCE_ID$' for DB accessions now use '$DB_ACCESSION$'. +label.do_not_display_again = No mostrar este mensaje de nuevo \ No newline at end of file diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 3f457ea..b1b913b 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -82,9 +82,12 @@ import java.util.concurrent.Executors; import java.util.concurrent.Semaphore; import javax.swing.AbstractAction; +import javax.swing.Box; +import javax.swing.BoxLayout; import javax.swing.DefaultDesktopManager; import javax.swing.DesktopManager; import javax.swing.JButton; +import javax.swing.JCheckBox; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JDesktopPane; @@ -382,6 +385,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements showNews.setVisible(false); + checkURLLinks(); + this.addWindowListener(new WindowAdapter() { @Override @@ -2256,6 +2261,55 @@ public class Desktop extends jalview.jbgui.GDesktop implements new Thread(jvq).start(); } + public void checkURLLinks() + { + // Thread off the URL link checker + addDialogThread(new Runnable() + { + @Override + public void run() + { + if (Cache.getDefault("CHECKURLLINKS", true)) + { + // check in case URL links use old style tokens ($SEQUENCE_ID$ for + // sequence id _or_ accession id) + JPanel msgPanel = new JPanel(); + msgPanel.setLayout(new BoxLayout(msgPanel, BoxLayout.PAGE_AXIS)); + msgPanel.add(Box.createVerticalGlue()); + JLabel msg = new JLabel( + MessageManager + .getString("label.SEQUENCE_ID_for_DB_ACCESSION1")); + JLabel msg2 = new JLabel( + MessageManager + .getString("label.SEQUENCE_ID_for_DB_ACCESSION2")); + msgPanel.add(msg); + msgPanel.add(msg2); + + final JCheckBox jcb = new JCheckBox( + MessageManager.getString("label.do_not_display_again")); + jcb.addActionListener(new ActionListener() + { + + @Override + public void actionPerformed(ActionEvent e) + { + // update Cache settings if checkbox is selected + if (jcb.isSelected()) + { + Cache.setProperty("CHECKURLLINKS", "false"); + } + } + }); + msgPanel.add(jcb); + + JOptionPane.showMessageDialog(null, msgPanel, MessageManager + .getString("label.SEQUENCE_ID_no_longer_used"), + JOptionPane.WARNING_MESSAGE); + } + } + }); + } + /** * Proxy class for JDesktopPane which optionally displays the current memory * usage and highlights the desktop area with a red bar if free memory runs diff --git a/src/jalview/util/UrlConstants.java b/src/jalview/util/UrlConstants.java index b511b8c..b70edf5 100644 --- a/src/jalview/util/UrlConstants.java +++ b/src/jalview/util/UrlConstants.java @@ -29,7 +29,7 @@ public class UrlConstants /* * Sequence ID string */ - public static final String SEQUENCE_ID = "ACCESSION_ID"; + public static final String SEQUENCE_ID = "DB_ACCESSION"; /* * Sequence Name string