{
private static final String AUTOSUPERIMPOSE = "AUTOSUPERIMPOSE";
- /**
- * transient combo box choice for initiating 3db fetch
- */
- private static final String VIEWS_QUERYING_TDB = "QUERY_3DB";
-
private SequenceI selectedSequence;
private SequenceI[] selectedSequences;
canQueryTDB = true;
if (needCanonical)
{
- notQueriedTDBYet = false;
+ // triggers display of the 'Query TDB' button
+ notQueriedTDBYet = true;
}
}
};
}
chk_superpose.setSelected(Cache.getDefault(AUTOSUPERIMPOSE, true));
+ btn_queryTDB.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ promptForTDBFetch();
+ }
+ });
Executors.defaultThreadFactory().newThread(new Runnable()
{
@Override
public void run()
{
+ mainFrame.setEnabled(false);
+ cmb_filterOption.setEnabled(false);
+ progressBar.setProgressBar(MessageManager.getString("status.searching_3d_beacons"), progressId);
// TODO: warn if no accessions discovered
populateSeqsWithoutSourceDBRef();
// redo initial discovery - this time with 3d beacons
// Executors.
previousWantedFields=null;
-
initialStructureDiscovery();
+ if (!isStructuresDiscovered())
+ {
+ progressBar.setProgressBar(MessageManager.getString("status.no_structures_discovered_from_3d_beacons"), progressId);
+ btn_queryTDB.setToolTipText(MessageManager.getString("status.no_structures_discovered_from_3d_beacons"));
+ btn_queryTDB.setEnabled(false);
+ } else {
+ btn_queryTDB.setVisible(false);
+ progressBar.setProgressBar(null, progressId);
+ }
+ mainFrame.setEnabled(true);
+ cmb_filterOption.setEnabled(true);
}
};
"-", VIEWS_FROM_FILE, false, null));
if (canQueryTDB && notQueriedTDBYet)
{
- FilterOption queryTDBOption = new FilterOption(
- MessageManager.getString("label.search_3dbeacons"), "-",
- VIEWS_QUERYING_TDB, false, null);
- cmb_filterOption.addItem(queryTDBOption);
+ btn_queryTDB.setVisible(true);
}
if (cachedPDBExist)
FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
.getSelectedItem());
- // first check if we need to rebuild dialog
- if (selectedFilterOpt.getView() == VIEWS_QUERYING_TDB)
- {
- promptForTDBFetch();
- return;
- }
if (lastSelected == selectedFilterOpt)
{
// don't need to do anything, probably
&& mainFrame.isVisible()
&& cmb_filterOption.getSelectedItem() != null;
}
+ /**
+ *
+ * @return true if the 3D-Beacons query button will/has been displayed
+ */
+ public boolean isCanQueryTDB() {
+ return canQueryTDB;
+ }
+
+ public boolean isNotQueriedTDBYet()
+ {
+ return notQueriedTDBYet;
+ }
}