X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FStructureChooser.java;h=c83f264e0924c8071b6803889f7f860d8117fe9f;hb=0ac97c219bf88278f77306a5695e8bd9d9ca9179;hp=2972c6971ac712efcdf80d6281592a11ad073ff6;hpb=4316d20b437d529be1d9ddafc0118fadd1b6a4ce;p=jalview.git diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index 2972c69..c83f264 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -148,8 +148,8 @@ public class StructureChooser extends GStructureChooser implements { long startTime = System.currentTimeMillis(); pdbRestCleint = PDBFTSRestClient.getInstance(); - Collection wantedFields = pdbRestCleint - .getAllDefaulDisplayedDataColumns(); + Collection wantedFields = pdbDocFieldPrefs + .getStructureSummaryFields(); discoveredStructuresSet = new LinkedHashSet(); HashSet errors = new HashSet(); @@ -186,7 +186,8 @@ public class StructureChooser extends GStructureChooser implements if (discoveredStructuresSet != null && !discoveredStructuresSet.isEmpty()) { - tbl_summary.setModel(FTSRestResponse.getTableModel(lastPdbRequest, + getResultTable().setModel( + FTSRestResponse.getTableModel(lastPdbRequest, discoveredStructuresSet)); structuresDiscovered = true; noOfStructuresFound = discoveredStructuresSet.size(); @@ -337,7 +338,7 @@ public class StructureChooser extends GStructureChooser implements * @param seqName * @return */ - private static String sanitizeSeqName(String seqName) + static String sanitizeSeqName(String seqName) { Objects.requireNonNull(seqName); return seqName.replaceAll("\\[\\d*\\]", "") @@ -397,8 +398,8 @@ public class StructureChooser extends GStructureChooser implements long startTime = System.currentTimeMillis(); pdbRestCleint = PDBFTSRestClient.getInstance(); lbl_loading.setVisible(true); - Collection wantedFields = pdbRestCleint - .getAllDefaulDisplayedDataColumns(); + Collection wantedFields = pdbDocFieldPrefs + .getStructureSummaryFields(); Collection filteredResponse = new HashSet(); HashSet errors = new HashSet(); @@ -454,15 +455,18 @@ public class StructureChooser extends GStructureChooser implements Collection reorderedStructuresSet = new LinkedHashSet(); reorderedStructuresSet.addAll(filteredResponse); reorderedStructuresSet.addAll(discoveredStructuresSet); - tbl_summary.setModel(FTSRestResponse.getTableModel( + getResultTable().setModel( + FTSRestResponse.getTableModel( lastPdbRequest, reorderedStructuresSet)); - FTSRestResponse.configureTableColumn(tbl_summary, wantedFields); - tbl_summary.getColumn("Ref Sequence").setPreferredWidth(120); - tbl_summary.getColumn("Ref Sequence").setMinWidth(100); - tbl_summary.getColumn("Ref Sequence").setMaxWidth(200); + FTSRestResponse.configureTableColumn(getResultTable(), + wantedFields); + getResultTable().getColumn("Ref Sequence").setPreferredWidth(120); + getResultTable().getColumn("Ref Sequence").setMinWidth(100); + getResultTable().getColumn("Ref Sequence").setMaxWidth(200); // Update table selection model here - tbl_summary.addRowSelectionInterval(0, filterResponseCount - 1); + getResultTable().addRowSelectionInterval(0, + filterResponseCount - 1); mainFrame.setTitle(MessageManager.formatMessage( "label.structure_chooser_filter_time", totalTime)); } @@ -529,8 +533,6 @@ public class StructureChooser extends GStructureChooser implements { cmb_filterOption.addItem(new FilterOption("Best Quality", "overall_quality", VIEWS_FILTER)); - cmb_filterOption.addItem(new FilterOption("Most UniProt Coverage", - "uniprot_coverage", VIEWS_FILTER)); cmb_filterOption.addItem(new FilterOption("Best Resolution", "resolution", VIEWS_FILTER)); cmb_filterOption.addItem(new FilterOption("Most Protein Chain", @@ -591,7 +593,7 @@ public class StructureChooser extends GStructureChooser implements String currentView = selectedFilterOpt.getView(); if (currentView == VIEWS_FILTER) { - if (tbl_summary.getSelectedRows().length > 0) + if (getResultTable().getSelectedRows().length > 0) { btn_view.setEnabled(true); } @@ -729,19 +731,21 @@ public class StructureChooser extends GStructureChooser implements String currentView = selectedFilterOpt.getView(); if (currentView == VIEWS_FILTER) { - int pdbIdColIndex = tbl_summary.getColumn("PDB Id") + int pdbIdColIndex = getResultTable().getColumn("PDB Id") .getModelIndex(); - int refSeqColIndex = tbl_summary.getColumn("Ref Sequence") + int refSeqColIndex = getResultTable().getColumn("Ref Sequence") .getModelIndex(); - int[] selectedRows = tbl_summary.getSelectedRows(); + int[] selectedRows = getResultTable().getSelectedRows(); PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length]; int count = 0; ArrayList selectedSeqsToView = new ArrayList(); for (int row : selectedRows) { - String pdbIdStr = tbl_summary.getValueAt(row, pdbIdColIndex) + String pdbIdStr = getResultTable().getValueAt(row, + pdbIdColIndex) .toString(); - SequenceI selectedSeq = (SequenceI) tbl_summary.getValueAt(row, + SequenceI selectedSeq = (SequenceI) getResultTable() + .getValueAt(row, refSeqColIndex); selectedSeqsToView.add(selectedSeq); PDBEntry pdbEntry = selectedSeq.getPDBEntry(pdbIdStr); @@ -802,9 +806,13 @@ public class StructureChooser extends GStructureChooser implements pdbEntry = new PDBEntry(); if (pdbIdStr.split(":").length > 1) { - pdbEntry.setChainCode(pdbIdStr.split(":")[1]); + pdbEntry.setId(pdbIdStr.split(":")[0]); + pdbEntry.setChainCode(pdbIdStr.split(":")[1].toUpperCase()); + } + else + { + pdbEntry.setId(pdbIdStr); } - pdbEntry.setId(pdbIdStr); pdbEntry.setType(PDBEntry.Type.PDB); selectedSequence.getDatasetSequence().addPDBId(pdbEntry); } @@ -853,7 +861,8 @@ public class StructureChooser extends GStructureChooser implements final PDBEntry[] pdbEntriesToView, final AlignmentPanel alignPanel, SequenceI[] sequences) { - ssm.setProgressBar("Launching PDB structure viewer.."); + ssm.setProgressBar(MessageManager + .getString("status.launching_3d_structure_viewer")); final StructureViewer sViewer = new StructureViewer(ssm); if (SiftsSettings.isMapWithSifts()) @@ -871,9 +880,9 @@ public class StructureChooser extends GStructureChooser implements { int y = seqsWithoutSourceDBRef.size(); ssm.setProgressBar(null); - ssm.setProgressBar("Fetching db refs for " + y - + " sequence" + (y > 1 ? "s" : "") - + " without valid db ref required for SIFTS mapping"); + ssm.setProgressBar(MessageManager.formatMessage( + "status.fetching_dbrefs_for_sequences_without_valid_refs", + y)); SequenceI[] seqWithoutSrcDBRef = new SequenceI[y]; int x = 0; for (SequenceI fSeq : seqsWithoutSourceDBRef) @@ -892,14 +901,16 @@ public class StructureChooser extends GStructureChooser implements } SequenceI[][] collatedSeqs = seqsMap.toArray(new SequenceI[0][0]); ssm.setProgressBar(null); - ssm.setProgressBar("Fetching PDB Structures for selected entries.."); + ssm.setProgressBar(MessageManager + .getString("status.fetching_3d_structures_for_selected_entries")); sViewer.viewStructures(pdbEntriesToView, collatedSeqs, alignPanel); } else { ssm.setProgressBar(null); - ssm.setProgressBar("Fetching PDB Structure for " - + pdbEntriesToView[0].getId()); + ssm.setProgressBar(MessageManager.formatMessage( + "status.fetching_3d_structures_for", + pdbEntriesToView[0].getId())); sViewer.viewStructures(pdbEntriesToView[0], sequences, alignPanel); } } @@ -962,7 +973,7 @@ public class StructureChooser extends GStructureChooser implements { String searchTerm = txt_search.getText().toLowerCase(); searchTerm = searchTerm.split(":")[0]; - System.out.println(">>>>> search term : " + searchTerm); + // System.out.println(">>>>> search term : " + searchTerm); List wantedFields = new ArrayList(); FTSRestRequest pdbRequest = new FTSRestRequest(); pdbRequest.setAllowEmptySeq(false);