import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.table.AbstractTableModel;
{
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;
}
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
}
@Override
- protected boolean showPopupFor(int selectedRow)
+ protected boolean showPopupFor(int selectedRow, int x, int y)
{
FilterOption selectedFilterOpt = ((FilterOption) cmb_filterOption
.getSelectedItem());
String currentView = selectedFilterOpt.getView();
+
if (currentView == VIEWS_FILTER && data instanceof ThreeDBStructureChooserQuerySource)
{
- TDB_FTSData row=null;
- int i=1;
- for (FTSData el:discoveredStructuresSet) {
- if (i==selectedRow) {
- row = (TDB_FTSData) el;
- break;
- }
- i++;
- }
+ TDB_FTSData row=((ThreeDBStructureChooserQuerySource)data).getFTSDataFor(getResultTable(), selectedRow, discoveredStructuresSet);
String pageUrl = row.getModelViewUrl();
- JMenu popup = new JMenu("3D Beacons");
+ JPopupMenu popup = new JPopupMenu("3D Beacons");
JMenuItem viewUrl = new JMenuItem("View model web page");
viewUrl.addActionListener(
new ActionListener() {
);
popup.add(viewUrl);
SwingUtilities.invokeLater(new Runnable() {
- public void run() { popup.setVisible(true); }
+ public void run() { popup.show(getResultTable(), x, y); }
});
return true;
}