@Override
public void run()
{
+ btn_queryTDB.setEnabled(false);
populateSeqsWithoutSourceDBRef();
final int y = seqsWithoutSourceDBRef.size();
{ new jalview.ws.dbsources.Uniprot() }, null, false);
dbRefFetcher.addListener(afterDbRefFetch);
// ideally this would also gracefully run with callbacks
+
dbRefFetcher.fetchDBRefs(true);
}
else
int threshold = Cache.getDefault("UNIPROT_AUTOFETCH_THRESHOLD",
THRESHOLD_WARN_UNIPROT_FETCH_NEEDED);
Console.debug("Using Uniprot fetch threshold of " + threshold);
- boolean runThread = false;
if (ignoreGui || seqsWithoutSourceDBRef.size() < threshold)
{
- runThread = true;
- }
- // need cancel and no to result in the discoverPDB action - mocked is
- // 'cancel' TODO: mock should be OK
- if (!runThread)
- {
- int answer = JvOptionPane.showConfirmDialog(this,
- MessageManager.formatMessage(
- "label.fetch_references_for_3dbeacons",
- seqsWithoutSourceDBRef.size()),
- MessageManager.getString("label.3dbeacons"),
- JvOptionPane.YES_NO_OPTION, JvOptionPane.PLAIN_MESSAGE);
- runThread = (answer == JvOptionPane.OK_OPTION);
- }
- if (runThread)
- {
Executors.defaultThreadFactory().newThread(discoverCanonicalDBrefs)
.start();
return;
}
- else
- {
- revertview.run();
- }
+ // need cancel and no to result in the discoverPDB action - mocked is
+ // 'cancel' TODO: mock should be OK
+
+ StructureChooser thisSC = this;
+ JvOptionPane.newOptionDialog(thisSC.getFrame())
+ .setResponseHandler(JvOptionPane.OK_OPTION,
+ discoverCanonicalDBrefs)
+ .setResponseHandler(JvOptionPane.CANCEL_OPTION, revertview)
+ .setResponseHandler(JvOptionPane.NO_OPTION, revertview)
+ .showDialog(
+ MessageManager.formatMessage(
+ "label.fetch_references_for_3dbeacons",
+ seqsWithoutSourceDBRef.size()),
+ MessageManager.getString("label.3dbeacons"),
+ JvOptionPane.YES_NO_OPTION, JvOptionPane.PLAIN_MESSAGE,
+ null, new Object[]
+ { MessageManager.getString("action.ok"),
+ MessageManager.getString("action.cancel") },
+ MessageManager.getString("action.ok"), false);
}
/**
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.GridLayout;
+import java.awt.Insets;
import java.awt.Point;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.ListCellRenderer;
+import javax.swing.SwingConstants;
import javax.swing.Timer;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
chk_invertFilter.addItemListener(this);
btn_queryTDB = new JButton(
MessageManager.getString("label.search_3dbeacons"));
+ btn_queryTDB.setIconTextGap(12);
+ btn_queryTDB.setIcon(tdbImage);
+ btn_queryTDB.setVerticalTextPosition(SwingConstants.CENTER);
+ btn_queryTDB.setHorizontalTextPosition(SwingConstants.TRAILING);
btn_queryTDB.setFont(VERDANA_12);
btn_queryTDB.setToolTipText(
MessageManager.getString("label.find_models_from_3dbeacons"));
- btn_queryTDB.setPreferredSize(new Dimension(300, 24));
+ btn_queryTDB.setMargin(new Insets(2, 16, 2, 20));
+ // btn_queryTDB.setPreferredSize(new Dimension(200, 32));
btn_queryTDB.setVisible(false);
targetView.setVisible(false);
JPanel pnl_main = new JPanel(new BorderLayout());
JPanel pnl_controls = new JPanel();
- pnl_queryTDB = new JPanel(new FlowLayout());
+ pnl_queryTDB = new JPanel();
+ pnl_queryTDB.setLayout(new FlowLayout(FlowLayout.CENTER, 4, 4));
pnl_queryTDB.setBackground(getBackground());
- pnl_queryTDB.add(new JLabel(tdbImage));
pnl_queryTDB.add(btn_queryTDB);
+
pnl_queryTDB.setVisible(false);
pnl_main.add(pnl_queryTDB, BorderLayout.NORTH);
pnl_controls.add(cmb_filterOption);
protected abstract void tabRefresh();
protected abstract void validateSelections();
+
+ public JInternalFrame getFrame()
+ {
+ return mainFrame;
+ }
}
\ No newline at end of file