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;
import jalview.util.DBRefUtils;
import jalview.util.MessageManager;
import jalview.util.Platform;
-import jalview.ws.dbsources.das.api.DasSourceRegistryI;
import jalview.ws.seqfetcher.DbSourceProxy;
import java.awt.BorderLayout;
JButton close = new JButton();
+ JButton back = new JButton();
+
JPanel jPanel1 = new JPanel();
JTextArea textArea = new JTextArea();
private static jalview.ws.SequenceFetcher sfetch = null;
- private static long lastDasSourceRegistry = -3;
-
- private static DasSourceRegistryI dasRegistry = null;
-
private static boolean _initingFetcher = false;
private static Thread initingThread = null;
Thread.currentThread().hashCode());
}
}
- if (sfetch == null || dasRegistry != Cache.getDasSourceRegistry()
- || lastDasSourceRegistry != (Cache.getDasSourceRegistry()
- .getDasRegistryURL()
- + Cache.getDasSourceRegistry().getLocalSourceString())
- .hashCode())
+ if (sfetch == null)
{
_initingFetcher = true;
initingThread = Thread.currentThread();
"status.init_sequence_database_fetchers"),
Thread.currentThread().hashCode());
}
- dasRegistry = Cache.getDasSourceRegistry();
- dasRegistry.refreshSources();
jalview.ws.SequenceFetcher sf = new jalview.ws.SequenceFetcher();
if (guiWindow != null)
{
guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
}
- lastDasSourceRegistry = (dasRegistry.getDasRegistryURL()
- + dasRegistry.getLocalSourceString()).hashCode();
sfetch = sf;
_initingFetcher = false;
initingThread = null;
return Collections.emptyList();
}
}
- sf.newAlframes = new ArrayList<AlignFrame>();
+ sf.newAlframes = new ArrayList<>();
sf.run();
return sf.newAlframes;
}
.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);
example_actionPerformed();
}
});
- close.setText(MessageManager.getString("action.close"));
+ close.setText(MessageManager.getString("action.cancel"));
close.addActionListener(new ActionListener()
{
@Override
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();
dbeg.setText(MessageManager.formatMessage("label.example_query_param",
new String[]
{ eq }));
+ // TODO this should be a property of the SequenceFetcher whether commas are and
+ // colons are allowed in the IDs...
+
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)
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
// TODO: Refactor to GUI independent code and write tests.
// indicate if successive sources should be merged into one alignment.
boolean addToLast = false;
- List<String> aresultq = new ArrayList<String>();
- List<String> presultTitle = new ArrayList<String>();
- List<AlignmentI> presult = new ArrayList<AlignmentI>();
- List<AlignmentI> aresult = new ArrayList<AlignmentI>();
+ List<String> aresultq = new ArrayList<>();
+ List<String> presultTitle = new ArrayList<>();
+ List<AlignmentI> presult = new ArrayList<>();
+ List<AlignmentI> aresult = new ArrayList<>();
Iterator<DbSourceProxy> proxies = database.getSelectedSources()
.iterator();
String[] qries;
nqueries = nextFetch.size();
// save the remaining queries in the original array
qries = nextFetch.toArray(new String[nqueries]);
- nextFetch = new ArrayList<String>();
+ nextFetch = new ArrayList<>();
}
DbSourceProxy proxy = proxies.next();
List<AlignmentI> aresult, List<String> nextFetch) throws Exception
{
StringBuilder multiacc = new StringBuilder();
- List<String> tosend = new ArrayList<String>();
+ List<String> tosend = new ArrayList<>();
while (accessions.hasNext())
{
String nel = accessions.next();
}
}
- if (preferredFeatureColours != null)
- {
- af.getViewport().applyFeaturesStyle(preferredFeatureColours);
- }
+ af.getViewport().applyFeaturesStyle(preferredFeatureColours);
if (Cache.getDefault("HIDE_INTRONS", true))
{
af.hideFeatureColumns(SequenceOntologyI.EXON, false);
Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT);
- af.statusBar.setText(MessageManager
+ af.setStatus(MessageManager
.getString("label.successfully_pasted_alignment_file"));
try
{
frame.setVisible(false);
}
+
+ public void setDatabaseChooserVisible(boolean b)
+ {
+ databaseButt.setVisible(b);
+ }
}