import jalview.commands.RemoveGapsCommand;
import jalview.commands.SlideSequencesCommand;
import jalview.commands.TrimRegionCommand;
+import jalview.controller.AlignViewController;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.gui.ViewSelectionMenu.ViewSetProvider;
import jalview.io.AlignmentProperties;
import jalview.io.AnnotationFile;
+import jalview.io.AppletFormatAdapter;
import jalview.io.BioJsHTMLOutput;
import jalview.io.FileLoader;
import jalview.io.FormatAdapter;
import jalview.io.HtmlSvgOutput;
import jalview.io.IdentifyFile;
+import jalview.io.JPredFile;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
import jalview.io.JnetAnnotationMaker;
import jalview.schemes.NucleotideColourScheme;
import jalview.schemes.PIDColourScheme;
import jalview.schemes.PurinePyrimidineColourScheme;
+import jalview.schemes.RNAHelicesColour;
import jalview.schemes.RNAHelicesColourChooser;
import jalview.schemes.ResidueProperties;
import jalview.schemes.StrandColourScheme;
import jalview.schemes.ZappoColourScheme;
import jalview.structure.StructureSelectionManager;
import jalview.util.MessageManager;
+import jalview.util.Platform;
import jalview.viewmodel.AlignmentViewport;
+import jalview.ws.DBRefFetcher;
+import jalview.ws.WSMenuEntryProviderI;
import jalview.ws.jws1.Discoverer;
import jalview.ws.jws2.Jws2Discoverer;
import jalview.ws.jws2.jabaws2.Jws2Instance;
+import jalview.ws.rest.RestClient;
import jalview.ws.seqfetcher.DbSourceProxy;
import java.awt.BorderLayout;
import javax.swing.JScrollPane;
import javax.swing.SwingUtilities;
+import ext.vamsas.ServiceHandle;
+
/**
* DOCUMENT ME!
*
progressBar = new ProgressBar(this.statusPanel, this.statusBar);
}
- avc = new jalview.controller.AlignViewController(this, viewport,
+ avc = new AlignViewController(this, viewport,
alignPanel);
if (viewport.getAlignmentConservationAnnotation() == null)
{
// modifyPID.setEnabled(false);
}
- String sortby = jalview.bin.Cache.getDefault("SORT_ALIGNMENT",
+ String sortby = Cache.getDefault("SORT_ALIGNMENT",
"No sort");
if (sortby.equals("Id"))
wrapMenuItem_actionPerformed(null);
}
- if (jalview.bin.Cache.getDefault("SHOW_OVERVIEW", false))
+ if (Cache.getDefault("SHOW_OVERVIEW", false))
{
this.overviewMenuItem_actionPerformed(null);
}
public void addAlignmentPanel(final AlignmentPanel ap, boolean newPanel)
{
ap.alignFrame = this;
- avc = new jalview.controller.AlignViewController(this, viewport,
- alignPanel);
+ avc = new AlignViewController(this, viewport, alignPanel);
alignPanels.add(ap);
purinePyrimidineColour.setEnabled(nucleotide);
showComplementMenuItem.setText(MessageManager
.getString(nucleotide ? "label.protein" : "label.nucleotide"));
- setColourSelected(jalview.bin.Cache.getDefault(
+ setColourSelected(Cache.getDefault(
nucleotide ? Preferences.DEFAULT_COLOUR_NUC
: Preferences.DEFAULT_COLOUR_PROT, "None"));
}
listenToViewSelections.setSelected(av.followSelection);
rnahelicesColour.setEnabled(av.getAlignment().hasRNAStructure());
rnahelicesColour
- .setSelected(av.getGlobalColourScheme() instanceof jalview.schemes.RNAHelicesColour);
+ .setSelected(av.getGlobalColourScheme() instanceof RNAHelicesColour);
setShowProductsEnabled();
updateEditMenuBar();
}
*/
public String getVersion()
{
- return jalview.bin.Cache.getProperty("VERSION");
+ return Cache.getProperty("VERSION");
}
public FeatureRenderer getFeatureRenderer()
public void save_actionPerformed(ActionEvent e)
{
if (fileName == null
- || (currentFileFormat == null || !jalview.io.FormatAdapter
+ || (currentFileFormat == null || !FormatAdapter
.isValidIOFormat(currentFileFormat, true))
|| fileName.startsWith("http"))
{
public void saveAs_actionPerformed(ActionEvent e)
{
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"),
- jalview.io.AppletFormatAdapter.WRITABLE_EXTENSIONS,
- jalview.io.AppletFormatAdapter.WRITABLE_FNAMES,
+ Cache.getProperty("LAST_DIRECTORY"),
+ AppletFormatAdapter.WRITABLE_EXTENSIONS,
+ AppletFormatAdapter.WRITABLE_FNAMES,
currentFileFormat, false);
chooser.setFileView(new JalviewFileView());
fileName = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("DEFAULT_FILE_FORMAT",
+ Cache.setProperty("DEFAULT_FILE_FORMAT",
currentFileFormat);
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", fileName);
+ Cache.setProperty("LAST_DIRECTORY", fileName);
if (currentFileFormat.indexOf(" ") > -1)
{
currentFileFormat = currentFileFormat.substring(0,
}
else
{
- if (!jalview.io.AppletFormatAdapter.isValidFormat(format, true))
+ if (!AppletFormatAdapter.isValidFormat(format, true))
{
warningMessage("Cannot save file " + fileName + " using format "
+ format, "Alignment output format not supported");
private void warningMessage(String warning, String title)
{
- if (new jalview.util.Platform().isHeadless())
+ if (Platform.isHeadless())
{
System.err.println("Warning: " + title + "\nWarning: " + warning);
{
// Pick the tree file
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager
.getString("label.load_jalview_annotations"));
if (value == JalviewFileChooser.APPROVE_OPTION)
{
String choice = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
+ Cache.setProperty("LAST_DIRECTORY", choice);
loadJalviewDataFile(choice, null, null, null);
}
try
{
- jalview.gui.Desktop.internalCopy = true;
+ Desktop.internalCopy = true;
// Its really worth setting the clipboard contents
// to empty before setting the large StringSelection!!
Toolkit.getDefaultToolkit().getSystemClipboard()
iSize--;
}
}
- if (jalview.gui.UserDefinedColours.getUserColourSchemes() != null)
+ if (UserDefinedColours.getUserColourSchemes() != null)
{
- java.util.Enumeration userColours = jalview.gui.UserDefinedColours
+ Enumeration userColours = UserDefinedColours
.getUserColourSchemes().keys();
while (userColours.hasMoreElements())
radioItem.removeActionListener(radioItem.getActionListeners()[0]);
int option = JOptionPane.showInternalConfirmDialog(
- jalview.gui.Desktop.desktop,
+ Desktop.desktop,
MessageManager
.getString("label.remove_from_default_list"),
MessageManager
JOptionPane.YES_NO_OPTION);
if (option == JOptionPane.YES_OPTION)
{
- jalview.gui.UserDefinedColours
- .removeColourFromDefaults(radioItem.getText());
+ UserDefinedColours.removeColourFromDefaults(radioItem
+ .getText());
colourMenu.remove(radioItem);
}
else
* be submitted for multiple alignment.
*
*/
- public jalview.datamodel.AlignmentView gatherSequencesForAlignment()
+ public AlignmentView gatherSequencesForAlignment()
{
// Now, check we have enough sequences
AlignmentView msa = null;
{
// Pick the tree file
JalviewFileChooser chooser = new JalviewFileChooser(
- jalview.bin.Cache.getProperty("LAST_DIRECTORY"));
+ Cache.getProperty("LAST_DIRECTORY"));
chooser.setFileView(new JalviewFileView());
chooser.setDialogTitle(MessageManager
.getString("label.select_newick_like_tree_file"));
if (value == JalviewFileChooser.APPROVE_OPTION)
{
String choice = chooser.getSelectedFile().getPath();
- jalview.bin.Cache.setProperty("LAST_DIRECTORY", choice);
- jalview.io.NewickFile fin = null;
+ Cache.setProperty("LAST_DIRECTORY", choice);
+ NewickFile fin = null;
try
{
- fin = new jalview.io.NewickFile(choice, "File");
+ fin = new NewickFile(choice, "File");
viewport.setCurrentTree(ShowNewickTree(fin, choice).getTree());
} catch (Exception ex)
{
// Add any secondary structure prediction services
for (int i = 0, j = secstrpr.size(); i < j; i++)
{
- final ext.vamsas.ServiceHandle sh = (ext.vamsas.ServiceHandle) secstrpr
- .get(i);
- jalview.ws.WSMenuEntryProviderI impl = jalview.ws.jws1.Discoverer
- .getServiceClient(sh);
+ final ServiceHandle sh = (ServiceHandle) secstrpr.get(i);
+ WSMenuEntryProviderI impl = Discoverer.getServiceClient(sh);
int p = secstrmenu.getItemCount();
impl.attachWSMenuEntry(secstrmenu, me);
int q = secstrmenu.getItemCount();
// SHmmr test client - still being implemented.
// DEBUG - alignmentView
- for (jalview.ws.rest.RestClient client : jalview.ws.rest.RestClient
- .getRestClients())
+ for (RestClient client : RestClient.getRestClients())
{
client.attachWSMenuEntry(
JvSwingUtils.findOrCreateMenu(webService, client.getAction()),
/*
* public void vamsasStore_actionPerformed(ActionEvent e) { JalviewFileChooser
- * chooser = new JalviewFileChooser(jalview.bin.Cache.
+ * chooser = new JalviewFileChooser(Cache.
* getProperty("LAST_DIRECTORY"));
*
* chooser.setFileView(new JalviewFileView()); chooser.setDialogTitle("Export
showProducts.setEnabled(showp);
} catch (Exception e)
{
- jalview.bin.Cache.log
+ Cache.log
.warn("canTranslate threw an exception - please report to help@jalview.org",
e);
return false;
}
} catch (Exception e)
{
- jalview.bin.Cache.log.error(
+ Cache.log.error(
"Exception when finding crossreferences", e);
} catch (OutOfMemoryError e)
{
new OOMWarning("whilst fetching crossreferences", e);
} catch (Error e)
{
- jalview.bin.Cache.log.error("Error when finding crossreferences",
+ Cache.log.error("Error when finding crossreferences",
e);
}
AlignFrame.this.setProgressBar(MessageManager.formatMessage(
// old way
try
{
- return (jalview.analysis.Dna.canTranslate(selection,
+ return (Dna.canTranslate(selection,
viewport.getViewAsVisibleContigs(true)));
} catch (Exception e)
{
- jalview.bin.Cache.log
+ Cache.log
.warn("canTranslate threw an exception - please report to help@jalview.org",
e);
return false;
al = dna.translateCdna();
} catch (Exception ex)
{
- jalview.bin.Cache.log.error(
+ Cache.log.error(
"Exception during translation. Please report this !", ex);
final String msg = MessageManager
.getString("label.error_when_translating_sequences_submit_bug_report");
public boolean parseFeaturesFile(String file, String type)
{
return avc.parseFeaturesFile(file, type,
- jalview.bin.Cache.getDefault("RELAXEDSEQIDMATCHING", false));
+ Cache.getDefault("RELAXEDSEQIDMATCHING", false));
}
String file = files.get(i).toString();
String pdbfn = "";
String protocol = FormatAdapter.checkProtocol(file);
- if (protocol == jalview.io.FormatAdapter.FILE)
+ if (protocol == FormatAdapter.FILE)
{
File fl = new File(file);
pdbfn = fl.getName();
}
- else if (protocol == jalview.io.FormatAdapter.URL)
+ else if (protocol == FormatAdapter.URL)
{
URL url = new URL(file);
pdbfn = url.getFile();
{
if (protocol == null)
{
- protocol = jalview.io.FormatAdapter.checkProtocol(file);
+ protocol = FormatAdapter.checkProtocol(file);
}
// if the file isn't identified, or not positively identified as some
// other filetype (PFAM is default unidentified alignment file type) then
}
if (format.equalsIgnoreCase("JnetFile"))
{
- jalview.io.JPredFile predictions = new jalview.io.JPredFile(
- file, protocol);
+ JPredFile predictions = new JPredFile(file, protocol);
new JnetAnnotationMaker();
JnetAnnotationMaker.add_annotation(predictions,
viewport.getAlignment(), 0, false);
* if (format.equalsIgnoreCase("PDB")) {
*
* String pdbfn = ""; // try to match up filename with sequence id
- * try { if (protocol == jalview.io.FormatAdapter.FILE) { File fl =
+ * try { if (protocol == FormatAdapter.FILE) { File fl =
* new File(file); pdbfn = fl.getName(); } else if (protocol ==
- * jalview.io.FormatAdapter.URL) { URL url = new URL(file); pdbfn =
+ * FormatAdapter.URL) { URL url = new URL(file); pdbfn =
* url.getFile(); } } catch (Exception e) { } ; if (assocSeq ==
* null) { SequenceIdMatcher idm = new SequenceIdMatcher(viewport
* .getAlignment().getSequencesArray()); if (pdbfn.length() > 0) {
@Override
protected void extractScores_actionPerformed(ActionEvent e)
{
- ParseProperties pp = new jalview.analysis.ParseProperties(
- viewport.getAlignment());
+ ParseProperties pp = new ParseProperties(viewport.getAlignment());
// TODO: verify regex and introduce GUI dialog for version 2.5
// if (pp.getScoresFromDescription("col", "score column ",
// "\\W*([-+]?\\d*\\.?\\d*e?-?\\d*)\\W+([-+]?\\d*\\.?\\d*e?-?\\d*)",
@Override
public void run()
{
- new jalview.ws.DBRefFetcher(alignPanel.av
+ new DBRefFetcher(alignPanel.av
.getSequenceSelection(), alignPanel.alignFrame)
.fetchDBRefs(false);
}
{
final jalview.ws.SequenceFetcher sf = SequenceFetcher
.getSequenceFetcherSingleton(me);
- javax.swing.SwingUtilities.invokeLater(new Runnable()
+ SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
@Override
public void run()
{
- new jalview.ws.DBRefFetcher(alignPanel.av
+ new DBRefFetcher(alignPanel.av
.getSequenceSelection(),
alignPanel.alignFrame, dassource)
.fetchDBRefs(false);
@Override
public void run()
{
- new jalview.ws.DBRefFetcher(alignPanel.av
+ new DBRefFetcher(alignPanel.av
.getSequenceSelection(),
alignPanel.alignFrame, dassource)
.fetchDBRefs(false);
@Override
public void run()
{
- new jalview.ws.DBRefFetcher(alignPanel.av
+ new DBRefFetcher(alignPanel.av
.getSequenceSelection(),
alignPanel.alignFrame, dassrc)
.fetchDBRefs(false);