package jalview.gui;
import jalview.api.FeatureSettingsModelI;
+import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
+import jalview.fts.service.pdb.PDBFTSPanel;
+import jalview.fts.service.uniprot.UniprotFTSPanel;
+import jalview.io.gff.SequenceOntologyI;
import jalview.util.DBRefUtils;
import jalview.util.MessageManager;
import jalview.ws.dbsources.das.api.DasSourceRegistryI;
int debounceTrap = 0;
+ public JTextArea getTextArea()
+ {
+ return textArea;
+ }
+
/**
* Blocking method that initialises and returns the shared instance of the
* SequenceFetcher client
}
}
if (sfetch == null
- || dasRegistry != jalview.bin.Cache.getDasSourceRegistry()
- || lastDasSourceRegistry != (jalview.bin.Cache
- .getDasSourceRegistry().getDasRegistryURL() + jalview.bin.Cache
+ || dasRegistry != Cache.getDasSourceRegistry()
+ || lastDasSourceRegistry != (Cache.getDasSourceRegistry()
+ .getDasRegistryURL() + Cache
.getDasSourceRegistry().getLocalSourceString())
.hashCode())
{
.getString("status.init_sequence_database_fetchers"),
Thread.currentThread().hashCode());
}
- dasRegistry = jalview.bin.Cache.getDasSourceRegistry();
+ dasRegistry = Cache.getDasSourceRegistry();
dasRegistry.refreshSources();
jalview.ws.SequenceFetcher sf = new jalview.ws.SequenceFetcher();
{
debounceTrap++;
String currentSelection = database.getSelectedItem();
- if (!currentSelection.equalsIgnoreCase("pdb"))
- {
- otherSourceAction();
- }
+
if (currentSelection.equalsIgnoreCase("pdb")
&& (database.action == KeyEvent.VK_ENTER || ((debounceTrap % 2) == 0)))
{
pdbSourceAction();
}
+ else if (currentSelection.equalsIgnoreCase("uniprot")
+ && (database.action == KeyEvent.VK_ENTER || ((debounceTrap % 2) == 0)))
+ {
+ uniprotSourceAction();
+ }
+ else
+ {
+ otherSourceAction();
+ }
database.action = -1;
}
});
private void pdbSourceAction()
{
databaseButt.setText(database.getSelectedItem());
- new PDBSearchPanel(this);
+ new PDBFTSPanel(this);
frame.dispose();
}
+ private void uniprotSourceAction()
+ {
+ databaseButt.setText(database.getSelectedItem());
+ new UniprotFTSPanel(this);
+ frame.dispose();
+ }
private void otherSourceAction()
{
try
proxy.getDbName() }), Thread.currentThread()
.hashCode());
isAliSource = proxy.isAlignmentSource();
- if (proxy.getAccessionSeparator() == null)
+ if (proxy.getMaximumQueryCount() == 1)
{
while (en.hasNext())
{
}
} catch (Exception e)
{
- jalview.bin.Cache.log.info("Error retrieving " + item
+ Cache.log.info(
+ "Error retrieving " + item
+ " from " + proxy.getDbName(), e);
nextfetch.add(item);
}
if (preferredFeatureColours != null)
{
- af.viewport.applyFeaturesStyle(preferredFeatureColours);
+ af.getViewport().applyFeaturesStyle(preferredFeatureColours);
}
+ if (Cache.getDefault("HIDE_INTRONS", true))
+ {
+ hideIntronsIfPresent(af);
+ }
+
Desktop.addInternalFrame(af, title, AlignFrame.DEFAULT_WIDTH,
AlignFrame.DEFAULT_HEIGHT);
try
{
- af.setMaximum(jalview.bin.Cache.getDefault("SHOW_FULLSCREEN",
+ af.setMaximum(Cache.getDefault("SHOW_FULLSCREEN",
false));
} catch (Exception ex)
{
return al;
}
+ /**
+ * Hide columns not containing 'exon' features, provided there are exon
+ * features on the alignment
+ *
+ * @param af
+ */
+ public void hideIntronsIfPresent(AlignFrame af)
+ {
+ boolean hasExons = af.avc.markColumnsContainingFeatures(false, false,
+ false,
+ SequenceOntologyI.EXON);
+ if (hasExons)
+ {
+ af.avc.markColumnsContainingFeatures(true, false, true,
+ SequenceOntologyI.EXON);
+ af.getViewport().hideSelectedColumns();
+ }
+ }
+
void showErrorMessage(final String error)
{
resetDialog();