From d3ac600aefbd927a1c6dafb8eca069b966a99c52 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Fri, 24 Feb 2023 15:54:38 +0000 Subject: [PATCH] JAL-629 add widgets to StructureChooser for tempfac choice and pae matrix file --- resources/lang/Messages.properties | 6 ++++ resources/lang/Messages_es.properties | 4 +++ src/jalview/jbgui/GStructureChooser.java | 35 +++++++++++++++++++- src/jalview/structure/StructureImportSettings.java | 8 +++++ 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index 57b0634..ec96b59 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -1442,3 +1442,9 @@ label.memory_example_tooltip = The memory allocated to Jalview is the smaller of warning.wrong_jvm_version_title = Wrong Java Version warning.wrong_jvm_version_message = The Java version being used (Java {0}) may lead to problems.\nThis installation of Jalview should be used with Java {1}. label.alphafold_reliability = Alphafold Reliability +label.tftype_default = Default +label.tftype_plddt = pLDDT +label.tftype_dose = Dose +label.optional = (optional) +label.choose_tempfac_type = Choose Temperature Factor type +label.add_pae_matrix_file = Add PAE matrix file diff --git a/resources/lang/Messages_es.properties b/resources/lang/Messages_es.properties index 061c241..b846eb8 100644 --- a/resources/lang/Messages_es.properties +++ b/resources/lang/Messages_es.properties @@ -1427,3 +1427,7 @@ label.memory_example_tooltip = La memoria asignada a Jalview es el menor entre e warning.wrong_jvm_version_title = Versión incorrecta de Java warning.wrong_jvm_version_message = La versión de Java que se está utilizando (Java {0}) puede generar problemas.\nEsta instalación de Jalview debe usarse con Java {1}. label.alphafold_reliability = Fiabilidad Alphafold +label.optional = (opcional) +label.tftype_default = Default +label.tftype_plddt = pLDDT +label.tftype_dose = Dose diff --git a/src/jalview/jbgui/GStructureChooser.java b/src/jalview/jbgui/GStructureChooser.java index 834e873..5af9cec 100644 --- a/src/jalview/jbgui/GStructureChooser.java +++ b/src/jalview/jbgui/GStructureChooser.java @@ -42,6 +42,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Map; +import javax.swing.BoxLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JCheckBox; @@ -73,6 +74,8 @@ import jalview.gui.AlignmentPanel; import jalview.gui.Desktop; import jalview.gui.JvSwingUtils; import jalview.gui.StructureViewer; +import jalview.structure.StructureImportSettings; +import jalview.structure.StructureImportSettings.TFType; import jalview.util.MessageManager; import jalview.util.Platform; import net.miginfocom.swing.MigLayout; @@ -121,6 +124,10 @@ public abstract class GStructureChooser extends JPanel protected JButton btn_pdbFromFile = new JButton(); + protected JComboBox combo_tempFacAs = new JComboBox<>(); + + protected JButton btn_paeMatrixFile = new JButton(); + // holder for icon and button protected JPanel pnl_queryTDB; @@ -547,6 +554,23 @@ public abstract class GStructureChooser extends JPanel } }); + JLabel lbl_chooseTempFacType = new JLabel(new StringBuilder() + .append(MessageManager.getString("label.choose_tempfac_type")) + .append(" ").append("label.optional").toString()); + + for (TFType t : TFType.values()) + { + combo_tempFacAs.addItem(t); + } + // add changelistener + + btn_paeMatrixFile.setText(new StringBuilder() + .append(MessageManager.getString("label.add_pae_matrix_file")) + .append(" ").append(MessageManager.getString("label.optional")) + .toString()); + ; + // add actionlistener + JScrollPane scrl_foundStructures = new JScrollPane(tbl_summary); scrl_foundStructures.setPreferredSize(new Dimension(width, height)); @@ -642,9 +666,18 @@ public abstract class GStructureChooser extends JPanel JPanel pnl_fileChooser = new JPanel(new FlowLayout()); pnl_fileChooser.add(btn_pdbFromFile); pnl_fileChooser.add(lbl_fromFileStatus); + + JPanel pnl_pdbOptions = new JPanel(); + pnl_pdbOptions + .setLayout(new BoxLayout(pnl_pdbOptions, BoxLayout.PAGE_AXIS)); + pnl_pdbOptions.add(lbl_chooseTempFacType); + pnl_pdbOptions.add(combo_tempFacAs); + pnl_pdbOptions.add(btn_paeMatrixFile); + JPanel pnl_fileChooserBL = new JPanel(new BorderLayout()); - pnl_fileChooserBL.add(fileChooserAssSeqPanel, BorderLayout.NORTH); + pnl_fileChooserBL.add(fileChooserAssSeqPanel, BorderLayout.PAGE_START); pnl_fileChooserBL.add(pnl_fileChooser, BorderLayout.CENTER); + // pnl_fileChooserBL.add(pnl_pdbOptions, BorderLayout.PAGE_END); JPanel pnl_idInput = new JPanel(new FlowLayout()); pnl_idInput.add(txt_search); diff --git a/src/jalview/structure/StructureImportSettings.java b/src/jalview/structure/StructureImportSettings.java index 597338e..a50101a 100644 --- a/src/jalview/structure/StructureImportSettings.java +++ b/src/jalview/structure/StructureImportSettings.java @@ -24,6 +24,7 @@ import java.util.Locale; import jalview.datamodel.PDBEntry; import jalview.datamodel.PDBEntry.Type; +import jalview.util.MessageManager; /** * bean holding settings for structure IO. TODO: tests for validation of values @@ -62,6 +63,13 @@ public class StructureImportSettings public static enum TFType { DEFAULT, PLDDT, DOSE; + + @Override + public String toString() + { + return MessageManager.getString( + "label.tftype_" + this.name().toLowerCase(Locale.ROOT)); + } } /** -- 1.7.10.2