- this.add(jLabel1, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0
- , GridBagConstraints.WEST,
- GridBagConstraints.NONE,
- new Insets(7, 4, 0, 6), 77, 6));
- this.add(jPanel1, new GridBagConstraints(0, 2, 2, 1, 1.0, 1.0
- , GridBagConstraints.WEST,
- GridBagConstraints.BOTH,
- new Insets(7, -2, 7, 12), 241, -2));
- this.add(database, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0
- , GridBagConstraints.WEST,
- GridBagConstraints.NONE,
- new Insets(0, 4, 0, 0), 1, 0));
- this.add(textfield, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0
- , GridBagConstraints.CENTER,
- GridBagConstraints.NONE,
- new Insets(0, 0, 0, 6), 211, 1));
+ jPanel3.add(jPanel2, java.awt.BorderLayout.CENTER);
+ jPanel2.setLayout(borderLayout3);
+ databaseButt = database.getDatabaseSelectorButton();
+ 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("Example query: " + 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();
+ }
+ });
+ dbeg.setText("");
+ jPanel2.add(databaseButt, java.awt.BorderLayout.NORTH);
+ jPanel2.add(dbeg, java.awt.BorderLayout.CENTER);
+ JPanel jPanel2a = new JPanel(new BorderLayout());
+ jPanel2a.add(jLabel1, java.awt.BorderLayout.NORTH);
+ jPanel2a.add(replacePunctuation, java.awt.BorderLayout.SOUTH);
+ jPanel2.add(jPanel2a, java.awt.BorderLayout.SOUTH);
+ // jPanel2.setPreferredSize(new Dimension())
+ jPanel3.add(jScrollPane1, java.awt.BorderLayout.CENTER);
+ this.add(jPanel1, java.awt.BorderLayout.SOUTH);
+ this.add(jPanel3, java.awt.BorderLayout.CENTER);
+ this.add(jPanel2, java.awt.BorderLayout.NORTH);
+ jScrollPane1.getViewport().add(textArea);
+