{
mainFramTabs.addTab("Retrieve IDs", fetcher);
fetcher.setDatabaseChooserVisible(false);
+ fetcher.embedWithFTSPanel(this);
}
mainFrame.setMinimumSize(new Dimension(MIN_WIDTH, MIN_HEIGHT));
final JPanel ftsPanel = this;
}
}
- protected void btn_back_ActionPerformed()
+ public void btn_back_ActionPerformed()
{
closeAction();
new SequenceFetcher(progressIndicator);
btn_cancel.setEnabled(false);
}
- protected void btn_cancel_ActionPerformed()
+ public void btn_cancel_ActionPerformed()
{
closeAction();
}
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
+import jalview.fts.core.GFTSPanel;
import jalview.fts.service.pdb.PDBFTSPanel;
import jalview.fts.service.uniprot.UniprotFTSPanel;
import jalview.io.FileFormatI;
JButton close = new JButton();
+ JButton back = new JButton();
+
JPanel jPanel1 = new JPanel();
JTextArea textArea = new JTextArea();
.getString("label.additional_sequence_fetcher"));
}
+ GFTSPanel parentFTSframe = null;
+ /**
+ * change the buttons so they fit with the FTS panel.
+ */
+ public void embedWithFTSPanel(GFTSPanel toClose)
+ {
+ back.setVisible(true);
+ parentFTSframe = toClose;
+ }
private void jbInit() throws Exception
{
this.setLayout(borderLayout2);
close_actionPerformed(e);
}
});
+ back.setText(MessageManager.getString("action.back"));
+ back.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ parentFTSframe.btn_back_ActionPerformed();
+ }
+ });
+ // back not visible unless embedded
+ back.setVisible(false);
textArea.setFont(JvSwingUtils.getLabelFont());
textArea.setLineWrap(true);
textArea.addKeyListener(new KeyAdapter()
});
jPanel3.setLayout(borderLayout1);
borderLayout1.setVgap(5);
- jPanel1.add(ok);
+ jPanel1.add(back);
jPanel1.add(example);
jPanel1.add(clear);
+ jPanel1.add(ok);
jPanel1.add(close);
jPanel2.setLayout(borderLayout3);
databaseButt = /*database.getDatabaseSelectorButton();
try
{
frame.setClosed(true);
+ if (parentFTSframe!=null)
+ {
+ parentFTSframe.btn_cancel_ActionPerformed();
+ }
} catch (Exception ex)
{
}
textArea.setEnabled(false);
ok.setEnabled(false);
close.setEnabled(false);
-
+ back.setEnabled(false);
Thread worker = new Thread(this);
worker.start();
}
textArea.setEnabled(true);
ok.setEnabled(true);
close.setEnabled(true);
+ back.setEnabled(parentFTSframe != null);
}
@Override