X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fgui%2Fstructurechooser%2FPDBStructureChooserQuerySource.java;h=8555a78b862c26f41c04a9982ff620807e60609b;hb=a5928e2c1b9e2cea8d9c43f3d03f9cce2604f3b2;hp=727d8e08437a2a3a9250723b65511e69b2ab9b8a;hpb=9d2408483e451285fd555c3cd6e0273977acbaa7;p=jalview.git diff --git a/src/jalview/gui/structurechooser/PDBStructureChooserQuerySource.java b/src/jalview/gui/structurechooser/PDBStructureChooserQuerySource.java index 727d8e0..8555a78 100644 --- a/src/jalview/gui/structurechooser/PDBStructureChooserQuerySource.java +++ b/src/jalview/gui/structurechooser/PDBStructureChooserQuerySource.java @@ -1,3 +1,23 @@ +/* + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors + * + * This file is part of Jalview. + * + * Jalview is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. + * + * Jalview is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. + */ package jalview.gui.structurechooser; import java.util.Locale; @@ -52,7 +72,6 @@ public class PDBStructureChooserQuerySource } - /** * Builds a query string for a given sequences using its DBRef entries * @@ -237,25 +256,28 @@ public class PDBStructureChooserQuerySource lastPdbRequest = pdbRequest; return resultList; } + public List getAvailableFilterOptions(String VIEWS_FILTER) { List filters = new ArrayList(); - filters.add(new FilterOption("PDBe "+ - MessageManager.getString("label.best_quality"), - "overall_quality", VIEWS_FILTER, false,this)); - filters.add(new FilterOption("PDBe "+ - MessageManager.getString("label.best_resolution"), - "resolution", VIEWS_FILTER, false,this)); - filters.add(new FilterOption("PDBe "+ - MessageManager.getString("label.most_protein_chain"), - "number_of_protein_chains", VIEWS_FILTER, false,this)); - filters.add(new FilterOption("PDBe "+ - MessageManager.getString("label.most_bound_molecules"), - "number_of_bound_molecules", VIEWS_FILTER, false,this)); - filters.add(new FilterOption("PDBe "+ - MessageManager.getString("label.most_polymer_residues"), - "number_of_polymer_residues", VIEWS_FILTER, true,this)); - + filters.add(new FilterOption( + "PDBe " + MessageManager.getString("label.best_quality"), + "overall_quality", VIEWS_FILTER, false, this)); + filters.add(new FilterOption( + "PDBe " + MessageManager.getString("label.best_resolution"), + "resolution", VIEWS_FILTER, false, this)); + filters.add(new FilterOption( + "PDBe " + MessageManager.getString("label.most_protein_chain"), + "number_of_protein_chains", VIEWS_FILTER, false, this)); + filters.add(new FilterOption( + "PDBe " + MessageManager + .getString("label.most_bound_molecules"), + "number_of_bound_molecules", VIEWS_FILTER, false, this)); + filters.add(new FilterOption( + "PDBe " + MessageManager + .getString("label.most_polymer_residues"), + "number_of_polymer_residues", VIEWS_FILTER, true, this)); + return filters; } @@ -281,7 +303,8 @@ public class PDBStructureChooserQuerySource * @return * @throws Exception */ - public FTSRestResponse selectFirstRankedQuery(SequenceI seq, Collection collectedResults, + public FTSRestResponse selectFirstRankedQuery(SequenceI seq, + Collection collectedResults, Collection wantedFields, String fieldToFilterBy, boolean b) throws Exception { @@ -316,33 +339,29 @@ public class PDBStructureChooserQuerySource return resultList; } - @Override public PDBEntry[] collectSelectedRows(JTable restable, int[] selectedRows, List selectedSeqsToView) { - int refSeqColIndex = restable.getColumn("Ref Sequence") - .getModelIndex(); + int refSeqColIndex = restable.getColumn("Ref Sequence").getModelIndex(); - PDBEntry[] pdbEntriesToView=new PDBEntry[selectedRows.length]; + PDBEntry[] pdbEntriesToView = new PDBEntry[selectedRows.length]; int count = 0; - int idColumnIndex=-1; - boolean fromTDB=true; + int idColumnIndex = -1; + boolean fromTDB = true; idColumnIndex = restable.getColumn("PDB Id").getModelIndex(); - + for (int row : selectedRows) { - - String pdbIdStr = restable.getValueAt(row,idColumnIndex) - .toString(); + + String pdbIdStr = restable.getValueAt(row, idColumnIndex).toString(); SequenceI selectedSeq = (SequenceI) restable.getValueAt(row, refSeqColIndex); selectedSeqsToView.add(selectedSeq); PDBEntry pdbEntry = selectedSeq.getPDBEntry(pdbIdStr); if (pdbEntry == null) { - pdbEntry = getFindEntry(pdbIdStr, - selectedSeq.getAllPDBEntries()); + pdbEntry = getFindEntry(pdbIdStr, selectedSeq.getAllPDBEntries()); } if (pdbEntry == null) @@ -357,15 +376,14 @@ public class PDBStructureChooserQuerySource return pdbEntriesToView; } - @Override protected FTSRestRequest getLastFTSRequest() { return lastPdbRequest; } - - public FTSRestResponse executePDBFTSRestRequest(FTSRestRequest pdbRequest) throws Exception + public FTSRestResponse executePDBFTSRestRequest(FTSRestRequest pdbRequest) + throws Exception { return pdbRestClient.executeRequest(pdbRequest); }