+
+ AlignFrame newAlignFrame = readAlignment(_file);
+ AlignFrame newAlignFrame2 = readAlignment(_file2);
+ if (newAlignFrame != null)
+ {
+ addToDisplay(newAlignFrame, newAlignFrame2);
+ loadTree(newAlignFrame);
+
+ loadScoreFile(newAlignFrame);
+
+ loadFeatures(newAlignFrame);
+
+ loadAnnotations(newAlignFrame);
+
+ loadJnetFile(newAlignFrame);
+
+ loadPdbFiles(newAlignFrame);
+ }
+ else
+ {
+ fileFound = false;
+ applet.remove(launcher);
+ applet.repaint();
+ }
+ callInitCallback();
+ }
+
+ /**
+ * Add an AlignFrame to the display; or if two are provided, a SplitFrame.
+ *
+ * @param af
+ * @param af2
+ */
+ public void addToDisplay(AlignFrame af, AlignFrame af2)
+ {
+ if (af2 != null)
+ {
+ AlignmentI al1 = af.viewport.getAlignment();
+ AlignmentI al2 = af2.viewport.getAlignment();
+ AlignmentI cdna = al1.isNucleotide() ? al1 : al2;
+ AlignmentI prot = al1.isNucleotide() ? al2 : al1;
+ if (AlignmentUtils.mapProteinAlignmentToCdna(prot, cdna))
+ {
+ al2.alignAs(al1);
+ SplitFrame sf = new SplitFrame(af, af2);
+ sf.addToDisplay(embedded, JalviewLite.this);
+ return;
+ }
+ else
+ {
+ String msg = "Could not map any sequence in " + af2.getTitle()
+ + " as "
+ + (al1.isNucleotide() ? "protein product" : "cDNA")
+ + " for " + af.getTitle();
+ System.err.println(msg);
+ }
+ }
+
+ af.addToDisplay(embedded);
+ }
+
+ /**
+ * Read the alignment file (from URL, text 'paste', or archive by
+ * classloader).
+ *
+ * @return
+ */
+ protected AlignFrame readAlignment(String fileParam)
+ {
+ if (fileParam == null)
+ {
+ return null;
+ }
+ String resolvedFile = resolveFileProtocol(fileParam);
+ AlignmentI al = null;