public class SequenceFetcher extends JPanel implements Runnable
{
- // ASequenceFetcher sfetch;
+ JLabel dbeg = new JLabel();
+
+ JDatabaseTree database;
+
+ JButton databaseButt;
+
+ JLabel jLabel1 = new JLabel();
+
+ JCheckBox replacePunctuation = new JCheckBox();
+
+ JButton ok = new JButton();
+
+ JButton clear = new JButton();
+
+ JButton example = new JButton();
+
+ JButton close = new JButton();
+
+ JPanel jPanel1 = new JPanel();
+
+ JTextArea textArea = new JTextArea();
+
+ JScrollPane jScrollPane1 = new JScrollPane();
+
+ JPanel jPanel2 = new JPanel();
+
+ JPanel jPanel3 = new JPanel();
+
+ JPanel jPanel4 = new JPanel();
+
+ BorderLayout borderLayout1 = new BorderLayout();
+
+ BorderLayout borderLayout2 = new BorderLayout();
+
+ BorderLayout borderLayout3 = new BorderLayout();
+
JInternalFrame frame;
IProgressIndicator guiWindow;
private static Thread initingThread = null;
+ int x = 0;
/**
* Blocking method that initialises and returns the shared instance of the
* SequenceFetcher client
databaseButt.setFont(JvSwingUtils.getLabelFont());
database.addActionListener(new ActionListener()
{
-
@Override
public void actionPerformed(ActionEvent e)
{
- try
- {
- databaseButt.setText(database.getSelectedItem()
- + (database.getSelectedSources().size() > 1 ? " (and "
- + database.getSelectedSources().size()
- + " others)" : ""));
- String eq = database.getExampleQueries();
- dbeg.setText(MessageManager.formatMessage(
- "label.example_query_param", new String[]
- { eq }));
- boolean enablePunct = !(eq != null && eq.indexOf(",") > -1);
- for (DbSourceProxy dbs : database.getSelectedSources())
- {
- if (dbs instanceof jalview.ws.dbsources.das.datamodel.DasSequenceSource)
- {
- enablePunct = false;
- break;
- }
- }
- replacePunctuation.setEnabled(enablePunct);
+ x++;
+ String currentSelection = database.getSelectedItem();
- } catch (Exception ex)
+ if (!currentSelection.equalsIgnoreCase("pdb"))
+ {
+ otherSourceAction();
+ }
+ if (currentSelection.equalsIgnoreCase("pdb") && ((x % 2) == 0))
{
- dbeg.setText("");
- replacePunctuation.setEnabled(true);
+ frame.dispose();
+ new EBIFetchPanel();
}
- jPanel2.repaint();
+
}
});
dbeg.setText("");
}
+ private void hideX()
+ {
+ this.setVisible(false);
+ }
+ private void otherSourceAction()
+ {
+ try
+ {
+ databaseButt.setText(database.getSelectedItem()
+ + (database.getSelectedSources().size() > 1 ? " (and "
+ + database.getSelectedSources().size() + " others)"
+ : ""));
+ String eq = database.getExampleQueries();
+ dbeg.setText(MessageManager.formatMessage(
+ "label.example_query_param", new String[]
+ { eq }));
+ boolean enablePunct = !(eq != null && eq.indexOf(",") > -1);
+ for (DbSourceProxy dbs : database.getSelectedSources())
+ {
+ if (dbs instanceof jalview.ws.dbsources.das.datamodel.DasSequenceSource)
+ {
+ enablePunct = false;
+ break;
+ }
+ }
+ replacePunctuation.setEnabled(enablePunct);
+
+ } catch (Exception ex)
+ {
+ dbeg.setText("");
+ replacePunctuation.setEnabled(true);
+ }
+ jPanel2.repaint();
+ }
+
protected void example_actionPerformed()
{
DbSourceProxy db = null;
jPanel3.repaint();
}
- JLabel dbeg = new JLabel();
-
- JDatabaseTree database;
-
- JButton databaseButt;
-
- JLabel jLabel1 = new JLabel();
-
- JCheckBox replacePunctuation = new JCheckBox();
-
- JButton ok = new JButton();
-
- JButton clear = new JButton();
-
- JButton example = new JButton();
-
- JButton close = new JButton();
-
- JPanel jPanel1 = new JPanel();
-
- JTextArea textArea = new JTextArea();
-
- JScrollPane jScrollPane1 = new JScrollPane();
-
- JPanel jPanel2 = new JPanel();
-
- JPanel jPanel3 = new JPanel();
-
- JPanel jPanel4 = new JPanel();
-
- BorderLayout borderLayout1 = new BorderLayout();
- BorderLayout borderLayout2 = new BorderLayout();
-
- BorderLayout borderLayout3 = new BorderLayout();
public void close_actionPerformed(ActionEvent e)
{