private boolean cachedPDBExists;
+ private Collection<FTSData> lastDiscoveredStructuresSet;
+
private static StructureViewer lastTargetedView = null;
public StructureChooser(SequenceI[] selectedSeqs, SequenceI selectedSeq,
{
getResultTable()
.setModel(data.getTableModel(discoveredStructuresSet));
+
noOfStructuresFound = discoveredStructuresSet.size();
+ lastDiscoveredStructuresSet=discoveredStructuresSet;
mainFrame.setTitle(MessageManager.formatMessage(
"label.structure_chooser_no_of_structures",
noOfStructuresFound, totalTime));
{
Thread filterThread = new Thread(new Runnable()
{
+
@Override
public void run()
{
reorderedStructuresSet.addAll(discoveredStructuresSet);
getResultTable()
.setModel(data.getTableModel(reorderedStructuresSet));
-
+
FTSRestResponse.configureTableColumn(getResultTable(),
wantedFields, tempUserPrefs);
getResultTable().getColumn("Ref Sequence").setPreferredWidth(120);
protected void populateFilterComboBox(boolean haveData,
boolean cachedPDBExist)
{
+ populateFilterComboBox(haveData, cachedPDBExist, null);
+ }
+ /**
+ * Populates the filter combo-box options dynamically depending on discovered
+ * structures
+ */
+ protected void populateFilterComboBox(boolean haveData,
+ boolean cachedPDBExist, FilterOption lastSel)
+ {
+
/*
* temporarily suspend the change listener behaviour
*/
cmb_filterOption.removeItemListener(this);
-
+ int selSet=-1;
cmb_filterOption.removeAllItems();
if (haveData)
{
List<FilterOption> filters = data.getAvailableFilterOptions(VIEWS_FILTER);
+ data.updateAvailableFilterOptions(VIEWS_FILTER, filters, lastDiscoveredStructuresSet);
+ int p=0;
for (FilterOption filter:filters)
{
+ if (lastSel!=null && filter.equals(lastSel)) {
+ selSet=p;
+ }
+ p++;
cmb_filterOption.addItem(filter);
}
}
MessageManager.getString("label.cached_structures"), "-",
VIEWS_LOCAL_PDB, false,null);
cmb_filterOption.addItem(cachedOption);
- cmb_filterOption.setSelectedItem(cachedOption);
+ if (selSet==-1) {
+ cmb_filterOption.setSelectedItem(cachedOption);
+ }
+ }
+ if (selSet>-1)
+ {
+ cmb_filterOption.setSelectedIndex(selSet);
}
-
cmb_filterOption.addItemListener(this);
}
if (selectedFilterOpt.getView() == VIEWS_FILTER)
{
mainFrame.setTitle(filterTitle);
- chk_invertFilter.setVisible(true);
+ // TDB Query has no invert as yet
+ chk_invertFilter.setVisible(selectedFilterOpt.getQuerySource() instanceof PDBStructureChooserQuerySource);
if (data!=selectedFilterOpt.getQuerySource() || data.needsRefetch(selectedFilterOpt))
{
public void run()
{
fetchStructuresMetaData();
+ //populateFilterComboBox(true, cachedPDBExists);
+
filterResultSet(
((FilterOption) cmb_filterOption.getSelectedItem())
.getValue());