import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.AbstractTableModel;
-
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
import jalview.bin.Jalview;
// which FTS engine to use
data = StructureChooserQuerySource.getQuerySourceFor(selectedSeqs);
initDialog();
-
this.ap = ap;
this.selectedSequence = selectedSeq;
this.selectedSequences = selectedSeqs;
this.progressIndicator = (ap == null) ? null : ap.alignFrame;
init();
-
}
/**
// ensure a filter option is in force for search
populateFilterComboBox(true, cachedPDBExists);
-
// looks for any existing structures already loaded
// for the sequences (the cached ones)
// then queries the StructureChooserQuerySource to
*/
private void discoverStructureViews()
{
- if (Desktop.instance != null)
+ if (Desktop.getInstance() != null)
{
targetView.removeAllItems();
if (lastTargetedView != null && !lastTargetedView.isVisible())
lastTargetedView = null;
}
int linkedViewsAt = 0;
- for (StructureViewerBase view : Desktop.instance
+ for (StructureViewerBase view : Desktop.getInstance()
.getStructureViewers(null, null))
{
StructureViewer viewHandler = (lastTargetedView != null
discoveredStructuresSet = new LinkedHashSet<>();
HashSet<String> errors = new HashSet<>();
-
FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
.getSelectedItem());
-
for (SequenceI seq : selectedSequences)
{
-
FTSRestResponse resultList;
try
{
{
getResultTable()
.setModel(data.getTableModel(discoveredStructuresSet));
-
noOfStructuresFound = discoveredStructuresSet.size();
lastDiscoveredStructuresSet = discoveredStructuresSet;
mainFrame.setTitle(MessageManager.formatMessage(
{
Thread filterThread = new Thread(new Runnable()
{
-
@Override
public void run()
{
for (SequenceI seq : selectedSequences)
{
-
FTSRestResponse resultList;
try
{
resultList = data.selectFirstRankedQuery(seq,
discoveredStructuresSet, wantedFields, fieldToFilterBy,
!chk_invertFilter.isSelected());
-
} catch (Exception e)
{
e.printStackTrace();
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)
cmb_filterOption.addItem(filter);
}
}
-
cmb_filterOption.addItem(
new FilterOption(MessageManager.getString("label.enter_pdb_id"),
"-", VIEWS_ENTER_ID, false, null));
cmb_filterOption.setSelectedItem(cachedOption);
}
}
+
if (selSet > -1)
{
cmb_filterOption.setSelectedIndex(selSet);
// otherwise, record selection
// and update the layout and dialog accordingly
lastSelected = selectedFilterOpt;
-
layout_switchableViews.show(pnl_switchableViews,
selectedFilterOpt.getView());
String filterTitle = mainFrame.getTitle();
{
validateSelections();
}
+
private FilterOption lastSelected=null;
/**
* Handles the state change event for the 'filter' combo-box and 'invert'
}
return found;
}
-
/**
* Handles the 'New View' action
*/
{
PDBEntry pdbEntry = ((PDBEntryTableModel) tbl_local_pdb
.getModel()).getPDBEntryAt(row).getPdbEntry();
-
pdbEntriesToView[count++] = pdbEntry;
SequenceI selectedSeq = (SequenceI) tbl_local_pdb
.getValueAt(row, refSeqColIndex);
PDBEntry fileEntry = new AssociatePdbFileWithSeq()
.associatePdbWithSeq(selectedPdbFileName,
DataSourceType.FILE, selectedSequence, true,
- Desktop.instance);
+ Desktop.getInstance());
sViewer = launchStructureViewer(ssm, new PDBEntry[] { fileEntry },
ap, new SequenceI[]
{
fetchStructuresMetaData();
// populateFilterComboBox(true, cachedPDBExists);
-
filterResultSet(
((FilterOption) cmb_filterOption.getSelectedItem())
.getValue());
{
progressBar.setProgressBar(message, id);
}
+
+ @Override
+ public void removeProgressBar(long id)
+ {
+ progressBar.removeProgressBar(id);
+ }
@Override
public void registerHandler(long id, IProgressIndicatorHandler handler)