/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*/
package jalview.gui;
-import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.DBRefSource;
private static Thread initingThread = null;
- int x = 0;
+ int debounceTrap = 0;
/**
* Blocking method that initialises and returns the shared instance of the
* SequenceFetcher client
jalview.ws.SequenceFetcher sf = new jalview.ws.SequenceFetcher();
if (guiWindow != null)
{
- guiWindow.setProgressBar(MessageManager.getString("status.init_sequence_database_fetchers"),
- Thread.currentThread().hashCode());
+ guiWindow.setProgressBar(null, Thread.currentThread().hashCode());
}
lastDasSourceRegistry = (dasRegistry.getDasRegistryURL() + dasRegistry
.getLocalSourceString()).hashCode();
return sfetch;
}
+ private IProgressIndicator progressIndicator;
public SequenceFetcher(IProgressIndicator guiIndic)
{
- final IProgressIndicator guiWindow = guiIndic;
+ this.progressIndicator = guiIndic;
final SequenceFetcher us = this;
// launch initialiser thread
Thread sf = new Thread(new Runnable()
@Override
public void run()
{
- if (getSequenceFetcherSingleton(guiWindow) != null)
+ if (getSequenceFetcherSingleton(progressIndicator) != null)
{
- us.initGui(guiWindow);
+ us.initGui(progressIndicator);
}
else
{
@Override
public void actionPerformed(ActionEvent e)
{
- x++;
+ debounceTrap++;
String currentSelection = database.getSelectedItem();
if (!currentSelection.equalsIgnoreCase("pdb"))
{
otherSourceAction();
}
- if (currentSelection.equalsIgnoreCase("pdb") && ((x % 2) == 0))
+ if (currentSelection.equalsIgnoreCase("pdb") && ((debounceTrap % 2) == 0))
{
- frame.dispose();
- new EBIFetchPanel();
+ pdbSourceAction();
}
}
}
- private void hideX()
+ private void pdbSourceAction()
{
- this.setVisible(false);
+ databaseButt.setText(database.getSelectedItem());
+ new PDBSearchPanel(this);
+ frame.dispose();
}
+
private void otherSourceAction()
{
try
AlignmentI parseResult(String result, String title)
{
String format = new IdentifyFile().Identify(result, "Paste");
- Alignment sequences = null;
+ AlignmentI sequences = null;
if (FormatAdapter.isValidFormat(format))
{
sequences = null;
if (al != null && al.getHeight() > 0)
{
+ if (title == null)
+ {
+ title = getDefaultRetrievalTitle();
+ }
if (alignFrame == null)
{
AlignFrame af = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
// Alignments?
}
- if (title == null)
- {
- title = getDefaultRetrievalTitle();
- }
SequenceFeature[] sfs = null;
List<SequenceI> alsqs;
synchronized (alsqs = al.getSequences())
}
else
{
- for (int i = 0; i < al.getHeight(); i++)
- {
- alignFrame.viewport.getAlignment().addSequence(
- al.getSequenceAt(i)); // this
- // also
- // creates
- // dataset
- // sequence
- // entries
- }
- alignFrame.viewport.setEndSeq(alignFrame.viewport.getAlignment()
- .getHeight());
- alignFrame.viewport.getAlignment().getWidth();
- alignFrame.viewport.firePropertyChange("alignment", null,
- alignFrame.viewport.getAlignment().getSequences());
+ alignFrame.viewport.addAlignment(al, title);
}
}
return al;
}
});
}
+
+ public IProgressIndicator getProgressIndicator()
+ {
+ return progressIndicator;
+ }
+
+ public void setProgressIndicator(IProgressIndicator progressIndicator)
+ {
+ this.progressIndicator = progressIndicator;
+ }
}