JAL-3829 provide both PDBe queries and 3D-Beacons queries in the filter combo box
[jalview.git] / src / jalview / gui / structurechooser / StructureChooserQuerySource.java
index 4faa2de..c18a8a2 100644 (file)
@@ -28,9 +28,6 @@ import jalview.jbgui.FilterOption;
  */
 public abstract class StructureChooserQuerySource
 {
-  protected FTSRestRequest lastPdbRequest;
-
-  protected FTSRestClientI pdbRestClient;
 
   protected FTSDataColumnPreferences docFieldPrefs;
 
@@ -170,6 +167,7 @@ public abstract class StructureChooserQuerySource
    * 
    * @param seq
    *          - seq to generate a query for
+   * @param discoveredStructuresSet - existing set of entries - allows client side selection
    * @param wantedFields
    *          - fields to retrieve
    * @param selectedFilterOpt
@@ -180,7 +178,7 @@ public abstract class StructureChooserQuerySource
    * @throws Exception
    */
   public abstract FTSRestResponse selectFirstRankedQuery(SequenceI seq,
-          Collection<FTSDataColumnI> wantedFields, String fieldToFilterBy,
+          Collection<FTSData> discoveredStructuresSet, Collection<FTSDataColumnI> wantedFields, String fieldToFilterBy,
           boolean b) throws Exception;
 
   /**
@@ -191,10 +189,12 @@ public abstract class StructureChooserQuerySource
   public TableModel getTableModel(
           Collection<FTSData> discoveredStructuresSet)
   {
-    return FTSRestResponse.getTableModel(lastPdbRequest,
+    return FTSRestResponse.getTableModel(getLastFTSRequest(),
             discoveredStructuresSet);
   }
 
+  protected abstract FTSRestRequest getLastFTSRequest();
+
   public abstract PDBEntry[] collectSelectedRows(JTable restable,
           int[] selectedRows, List<SequenceI> selectedSeqsToView);
 
@@ -238,4 +238,11 @@ public abstract class StructureChooserQuerySource
     return new PDBStructureChooserQuerySource();
   }
 
+  /**
+   * some filter options may mean the original query needs to be executed again. 
+   * @param selectedFilterOpt
+   * @return true if the fetchStructuresMetadata method needs to be called again
+   */
+  public abstract boolean needsRefetch(FilterOption selectedFilterOpt);
+
 }
\ No newline at end of file