+ }\r
+ } catch (Exception ex)\r
+ {\r
+ ex.printStackTrace();\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ public static String getBuildDate()\r
+ {\r
+ initBuildDetails();\r
+ return builddate;\r
+ }\r
+\r
+ public static String getVersion()\r
+ {\r
+ initBuildDetails();\r
+ return version;\r
+ }\r
+\r
+ // public JSObject scriptObject = null;\r
+\r
+ /**\r
+ * init method for Jalview Applet\r
+ */\r
+ public void init()\r
+ {\r
+ // remove any handlers that might be hanging around from an earlier instance\r
+ try\r
+ {\r
+ if (debug)\r
+ {\r
+ System.err.println("Applet context is '"\r
+ + getAppletContext().getClass().toString() + "'");\r
+ }\r
+ JSObject scriptObject = JSObject.getWindow(this);\r
+ if (debug && scriptObject != null)\r
+ {\r
+ System.err.println("Applet has Javascript callback support.");\r
+ }\r
+\r
+ } catch (Exception ex)\r
+ {\r
+ System.err\r
+ .println("Warning: No JalviewLite javascript callbacks available.");\r
+ if (debug)\r
+ {\r
+ ex.printStackTrace();\r
+ }\r
+ }\r
+ /**\r
+ * turn on extra applet debugging\r
+ */\r
+ String dbg = getParameter("debug");\r
+ if (dbg != null)\r
+ {\r
+ debug = dbg.toLowerCase().equals("true");\r
+ }\r
+ if (debug)\r
+ {\r
+\r
+ System.err.println("JalviewLite Version " + getVersion());\r
+ System.err.println("Build Date : " + getBuildDate());\r
+\r
+ }\r
+ String externalsviewer = getParameter("externalstructureviewer");\r
+ if (externalsviewer != null)\r
+ {\r
+ useXtrnalSviewer = externalsviewer.trim().toLowerCase()\r
+ .equals("true");\r
+ }\r
+ /**\r
+ * if true disable the check for jmol\r
+ */\r
+ String chkforJmol = getParameter("nojmol");\r
+ if (chkforJmol != null)\r
+ {\r
+ checkForJmol = !chkforJmol.equals("true");\r
+ }\r
+ /**\r
+ * get the separator parameter if present\r
+ */\r
+ String sep = getParameter("separator");\r
+ if (sep != null)\r
+ {\r
+ if (sep.length() > 0)\r
+ {\r
+ separator = sep;\r
+ if (debug)\r
+ {\r
+ System.err.println("Separator set to '" + separator + "'");\r
+ }\r
+ }\r
+ else\r
+ {\r
+ throw new Error(\r
+ "Invalid separator parameter - must be non-zero length");\r
+ }\r
+ }\r
+ int r = 255;\r
+ int g = 255;\r
+ int b = 255;\r
+ String param = getParameter("RGB");\r
+\r
+ if (param != null)\r
+ {\r
+ try\r
+ {\r
+ r = Integer.parseInt(param.substring(0, 2), 16);\r
+ g = Integer.parseInt(param.substring(2, 4), 16);\r
+ b = Integer.parseInt(param.substring(4, 6), 16);\r
+ } catch (Exception ex)\r
+ {\r
+ r = 255;\r
+ g = 255;\r
+ b = 255;\r
+ }\r
+ }\r
+ param = getParameter("label");\r
+ if (param != null)\r
+ {\r
+ launcher.setLabel(param);\r
+ }\r
+\r
+ setBackground(new Color(r, g, b));\r
+\r
+ file = getParameter("file");\r
+\r
+ if (file == null)\r
+ {\r
+ // Maybe the sequences are added as parameters\r
+ StringBuffer data = new StringBuffer("PASTE");\r
+ int i = 1;\r
+ while ((file = getParameter("sequence" + i)) != null)\r
+ {\r
+ data.append(file.toString() + "\n");\r
+ i++;\r
+ }\r
+ if (data.length() > 5)\r
+ {\r
+ file = data.toString();\r
+ }\r
+ }\r
+\r
+ final JalviewLite jvapplet = this;\r
+ if (getParameter("embedded") != null\r
+ && getParameter("embedded").equalsIgnoreCase("true"))\r
+ {\r
+ // Launch as embedded applet in page\r
+ embedded = true;\r
+ LoadingThread loader = new LoadingThread(file, jvapplet);\r
+ loader.start();\r
+ }\r
+ else if (file != null)\r
+ {\r
+ if (getParameter("showbutton") == null\r
+ || !getParameter("showbutton").equalsIgnoreCase("false"))\r
+ {\r
+ // Add the JalviewLite 'Button' to the page\r
+ add(launcher);\r
+ launcher.addActionListener(new java.awt.event.ActionListener()\r
+ {\r
+ public void actionPerformed(ActionEvent e)\r
+ {\r
+ LoadingThread loader = new LoadingThread(file, jvapplet);\r
+ loader.start();\r
+ }\r
+ });\r
+ }\r
+ else\r
+ {\r
+ // Open jalviewLite immediately.\r
+ LoadingThread loader = new LoadingThread(file, jvapplet);\r
+ loader.start();\r
+ }\r
+ }\r
+ else\r
+ {\r
+ // jalview initialisation with no alignment. loadAlignment() method can\r
+ // still be called to open new alignments.\r
+ file = "NO FILE";\r
+ fileFound = false;\r
+ // callInitCallback();\r
+ }\r
+ }\r
+\r
+ private void callInitCallback()\r
+ {\r
+ String initjscallback = getParameter("oninit");\r
+ if (initjscallback == null)\r
+ {\r
+ return;\r
+ }\r
+ initjscallback = initjscallback.trim();\r
+ if (initjscallback.length() > 0)\r
+ {\r
+ JSObject scriptObject = null;\r
+ try\r
+ {\r
+ scriptObject = JSObject.getWindow(this);\r
+ } catch (Exception ex)\r
+ {\r
+ }\r
+ ;\r
+ if (scriptObject != null)\r
+ {\r
+ try\r
+ {\r
+ // do onInit with the JS executor thread\r
+ new JSFunctionExec(this).executeJavascriptFunction(true,\r
+ initjscallback, null, "Calling oninit callback '"\r
+ + initjscallback + "'.");\r
+ } catch (Exception e)\r
+ {\r
+ System.err.println("Exception when executing _oninit callback '"\r
+ + initjscallback + "'.");\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ else\r
+ {\r
+ System.err.println("Not executing _oninit callback '"\r
+ + initjscallback + "' - no scripting allowed.");\r
+ }\r
+ }\r
+ }\r
+\r
+ /**\r
+ * Initialises and displays a new java.awt.Frame\r
+ * \r
+ * @param frame\r
+ * java.awt.Frame to be displayed\r
+ * @param title\r
+ * title of new frame\r
+ * @param width\r
+ * width if new frame\r
+ * @param height\r
+ * height of new frame\r
+ */\r
+ public static void addFrame(final Frame frame, String title, int width,\r
+ int height)\r
+ {\r
+ frame.setLocation(lastFrameX, lastFrameY);\r
+ lastFrameX += 40;\r
+ lastFrameY += 40;\r
+ frame.setSize(width, height);\r
+ frame.setTitle(title);\r
+ frame.addWindowListener(new WindowAdapter()\r
+ {\r
+ public void windowClosing(WindowEvent e)\r
+ {\r
+ if (frame instanceof AlignFrame)\r
+ {\r
+ AlignViewport vp = ((AlignFrame) frame).viewport;\r
+ ((AlignFrame) frame).closeMenuItem_actionPerformed();\r
+ if (vp.applet.currentAlignFrame == frame)\r
+ {\r
+ vp.applet.currentAlignFrame = null;\r
+ }\r
+ vp.applet = null;\r
+ vp = null;\r
+\r
+ }\r
+ lastFrameX -= 40;\r
+ lastFrameY -= 40;\r
+ if (frame instanceof EmbmenuFrame)\r
+ {\r
+ ((EmbmenuFrame) frame).destroyMenus();\r
+ }\r
+ frame.setMenuBar(null);\r
+ frame.dispose();\r
+ }\r
+\r
+ public void windowActivated(WindowEvent e)\r
+ {\r
+ if (frame instanceof AlignFrame)\r
+ {\r
+ ((AlignFrame) frame).viewport.applet.currentAlignFrame = (AlignFrame) frame;\r
+ if (debug)\r
+ {\r
+ System.err.println("Activated window " + frame);\r
+ }\r
+ }\r
+ // be good.\r
+ super.windowActivated(e);\r
+ }\r
+ /*\r
+ * Probably not necessary to do this - see TODO above. (non-Javadoc)\r
+ * \r
+ * @see\r
+ * java.awt.event.WindowAdapter#windowDeactivated(java.awt.event.WindowEvent\r
+ * )\r
+ * \r
+ * public void windowDeactivated(WindowEvent e) { if (currentAlignFrame ==\r
+ * frame) { currentAlignFrame = null; if (debug) {\r
+ * System.err.println("Deactivated window "+frame); } }\r
+ * super.windowDeactivated(e); }\r
+ */\r
+ });\r
+ frame.setVisible(true);\r
+ }\r
+\r
+ /**\r
+ * This paints the background surrounding the "Launch Jalview button" <br>\r
+ * <br>\r
+ * If file given in parameter not found, displays error message\r
+ * \r
+ * @param g\r
+ * graphics context\r
+ */\r
+ public void paint(Graphics g)\r
+ {\r
+ if (!fileFound)\r
+ {\r
+ g.setColor(new Color(200, 200, 200));\r
+ g.setColor(Color.cyan);\r
+ g.fillRect(0, 0, getSize().width, getSize().height);\r
+ g.setColor(Color.red);\r
+ g.drawString("Jalview can't open file", 5, 15);\r
+ g.drawString("\"" + file + "\"", 5, 30);\r
+ }\r
+ else if (embedded)\r
+ {\r
+ g.setColor(Color.black);\r
+ g.setFont(new Font("Arial", Font.BOLD, 24));\r
+ g.drawString("Jalview Applet", 50, getSize().height / 2 - 30);\r
+ g.drawString("Loading Data...", 50, getSize().height / 2);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * get all components associated with the applet of the given type\r
+ * \r
+ * @param class1\r
+ * @return\r
+ */\r
+ public Vector getAppletWindow(Class class1)\r
+ {\r
+ Vector wnds = new Vector();\r
+ Component[] cmp = getComponents();\r
+ if (cmp != null)\r
+ {\r
+ for (int i = 0; i < cmp.length; i++)\r
+ {\r
+ if (class1.isAssignableFrom(cmp[i].getClass()))\r
+ {\r
+ wnds.addElement(cmp);\r
+ }\r
+ }\r
+ }\r
+ return wnds;\r
+ }\r
+\r
+ class LoadJmolThread extends Thread\r
+ {\r
+ private boolean running = false;\r
+\r
+ public void run()\r
+ {\r
+ if (running || checkedForJmol)\r
+ {\r
+ return;\r
+ }\r
+ running = true;\r
+ if (checkForJmol)\r
+ {\r
+ try\r
+ {\r
+ if (!System.getProperty("java.version").startsWith("1.1"))\r
+ {\r
+ Class.forName("org.jmol.adapter.smarter.SmarterJmolAdapter");\r
+ jmolAvailable = true;\r
+ }\r
+ if (!jmolAvailable)\r
+ {\r
+ System.out\r
+ .println("Jmol not available - Using MCview for structures");\r
+ }\r
+ } catch (java.lang.ClassNotFoundException ex)\r
+ {\r
+ }\r
+ }\r
+ else\r
+ {\r
+ jmolAvailable = false;\r
+ if (debug)\r
+ {\r
+ System.err\r
+ .println("Skipping Jmol check. Will use MCView (probably)");\r
+ }\r
+ }\r
+ checkedForJmol = true;\r
+ running = false;\r
+ }\r
+\r
+ public boolean notFinished()\r
+ {\r
+ return running || !checkedForJmol;\r
+ }\r
+ }\r
+\r
+ class LoadingThread extends Thread\r
+ {\r
+ /**\r
+ * State variable: File source\r
+ */\r
+ String file;\r
+\r
+ /**\r
+ * State variable: protocol for access to file source\r
+ */\r
+ String protocol;\r
+\r
+ /**\r
+ * State variable: format of file source\r
+ */\r
+ String format;\r
+\r
+ String _file;\r
+\r
+ JalviewLite applet;\r
+\r
+ private void dbgMsg(String msg)\r
+ {\r
+ if (applet.debug)\r
+ {\r
+ System.err.println(msg);\r
+ }\r
+ }\r
+\r
+ /**\r
+ * update the protocol state variable for accessing the datasource located\r
+ * by file.\r
+ * \r
+ * @param file\r
+ * @return possibly updated datasource string\r
+ */\r
+ public String setProtocolState(String file)\r
+ {\r
+ if (file.startsWith("PASTE"))\r
+ {\r
+ file = file.substring(5);\r
+ protocol = AppletFormatAdapter.PASTE;\r
+ }\r
+ else if (inArchive(file))\r
+ {\r
+ protocol = AppletFormatAdapter.CLASSLOADER;\r
+ }\r
+ else\r
+ {\r
+ file = addProtocol(file);\r
+ protocol = AppletFormatAdapter.URL;\r
+ }\r
+ dbgMsg("Protocol identified as '" + protocol + "'");\r
+ return file;\r
+ }\r
+\r
+ public LoadingThread(String _file, JalviewLite _applet)\r
+ {\r
+ this._file = _file;\r
+ applet = _applet;\r
+ }\r
+\r
+ public void run()\r
+ {\r
+ LoadJmolThread jmolchecker = new LoadJmolThread();\r
+ jmolchecker.start();\r
+ while (jmolchecker.notFinished())\r
+ {\r
+ // wait around until the Jmol check is complete.\r
+ try\r
+ {\r
+ Thread.sleep(2);\r
+ } catch (Exception e)\r
+ {\r
+ }\r
+ ;\r
+ }\r
+ startLoading();\r
+ // applet.callInitCallback();\r
+ }\r
+\r
+ private void startLoading()\r
+ {\r
+ AlignFrame newAlignFrame;\r
+ dbgMsg("Loading thread started with:\n>>file\n" + _file + ">>endfile");\r
+ file = setProtocolState(_file);\r
+\r
+ format = new jalview.io.IdentifyFile().Identify(file, protocol);\r
+ dbgMsg("File identified as '" + format + "'");\r
+ dbgMsg("Loading started.");\r
+ Alignment al = null;\r
+ try\r
+ {\r
+ al = new AppletFormatAdapter().readFile(file, protocol, format);\r
+ } catch (java.io.IOException ex)\r
+ {\r
+ dbgMsg("File load exception.");\r
+ ex.printStackTrace();\r
+ if (debug)\r
+ {\r
+ try\r
+ {\r
+ FileParse fp = new FileParse(file, protocol);\r
+ String ln = null;\r
+ dbgMsg(">>>Dumping contents of '" + file + "' " + "("\r
+ + protocol + ")");\r
+ while ((ln = fp.nextLine()) != null)\r
+ {\r
+ dbgMsg(ln);\r
+ }\r
+ dbgMsg(">>>Dump finished.");\r
+ } catch (Exception e)\r
+ {\r
+ System.err\r
+ .println("Exception when trying to dump the content of the file parameter.");\r
+ e.printStackTrace();\r
+ }\r
+ }\r
+ }\r
+ if ((al != null) && (al.getHeight() > 0))\r
+ {\r
+ dbgMsg("Successfully loaded file.");\r
+ newAlignFrame = new AlignFrame(al, applet, file, embedded);\r
+ if (initialAlignFrame == null)\r
+ {\r
+ initialAlignFrame = newAlignFrame;\r
+ }\r
+ // update the focus.\r
+ currentAlignFrame = newAlignFrame;\r
+\r
+ if (protocol == jalview.io.AppletFormatAdapter.PASTE)\r
+ {\r
+ newAlignFrame.setTitle("Sequences from "\r
+ + applet.getDocumentBase());\r
+ }\r
+\r
+ newAlignFrame.statusBar.setText("Successfully loaded file " + file);\r
+\r
+ String treeFile = applet.getParameter("tree");\r
+ if (treeFile == null)\r
+ {\r
+ treeFile = applet.getParameter("treeFile");\r
+ }\r
+\r
+ if (treeFile != null)\r
+ {\r
+ try\r
+ {\r
+ treeFile = setProtocolState(treeFile);\r
+ /*\r
+ * if (inArchive(treeFile)) { protocol =\r
+ * AppletFormatAdapter.CLASSLOADER; } else { protocol =\r
+ * AppletFormatAdapter.URL; treeFile = addProtocol(treeFile); }\r
+ */\r
+ jalview.io.NewickFile fin = new jalview.io.NewickFile(treeFile,\r
+ protocol);\r
+\r
+ fin.parse();\r
+\r
+ if (fin.getTree() != null)\r
+ {\r
+ newAlignFrame.loadTree(fin, treeFile);\r
+ dbgMsg("Successfuly imported tree.");\r
+ }\r
+ else\r
+ {\r
+ dbgMsg("Tree parameter did not resolve to a valid tree.");\r
+ }\r
+ } catch (Exception ex)\r
+ {\r
+ ex.printStackTrace();\r
+ }\r
+ }\r
+\r
+ // ///////////////////////////\r
+ // modify display of features\r
+ // we do this before any features have been loaded, ensuring any hidden groups are hidden when features first displayed\r
+ //\r
+ // hide specific groups\r
+ // \r
+ String param = applet.getParameter("hidefeaturegroups");\r
+ if (param != null)\r
+ {\r
+ newAlignFrame.setFeatureGroupState(separatorListToArray(param), false); \r
+// applet.setFeatureGroupStateOn(newAlignFrame, param, false);\r
+ }\r
+ // show specific groups\r
+ param = applet.getParameter("showfeaturegroups");\r
+ if (param != null)\r
+ {\r
+ newAlignFrame.setFeatureGroupState(separatorListToArray(param), true); \r
+// applet.setFeatureGroupStateOn(newAlignFrame, param, true);\r
+ }\r
+ // and now load features\r
+ param = applet.getParameter("features");\r
+ if (param != null)\r
+ {\r
+ param = setProtocolState(param);\r
+\r
+ newAlignFrame.parseFeaturesFile(param, protocol);\r
+ }\r
+\r
+ param = applet.getParameter("showFeatureSettings");\r
+ if (param != null && param.equalsIgnoreCase("true"))\r
+ {\r
+ newAlignFrame.viewport.showSequenceFeatures(true);\r
+ new FeatureSettings(newAlignFrame.alignPanel);\r
+ }\r
+\r
+ param = applet.getParameter("annotations");\r
+ if (param != null)\r
+ {\r
+ param = setProtocolState(param);\r
+\r
+ if (new AnnotationFile().readAnnotationFile(\r
+ newAlignFrame.viewport.getAlignment(), param, protocol))\r
+ {\r
+ newAlignFrame.alignPanel.fontChanged();\r
+ newAlignFrame.alignPanel.setScrollValues(0, 0);\r
+ }\r
+ else\r
+ {\r
+ System.err\r
+ .println("Annotations were not added from annotation file '"\r
+ + param + "'");\r
+ }\r
+\r
+ }\r
+\r
+ param = applet.getParameter("jnetfile");\r
+ if (param != null)\r
+ {\r
+ try\r
+ {\r
+ param = setProtocolState(param);\r
+ jalview.io.JPredFile predictions = new jalview.io.JPredFile(\r
+ param, protocol);\r
+ JnetAnnotationMaker.add_annotation(predictions,\r
+ newAlignFrame.viewport.getAlignment(), 0, false); // false==do\r
+ // not\r
+ // add\r
+ // sequence\r
+ // profile\r
+ // from\r
+ // concise\r
+ // output\r
+ newAlignFrame.alignPanel.fontChanged();\r
+ newAlignFrame.alignPanel.setScrollValues(0, 0);\r
+ } catch (Exception ex)\r
+ {\r
+ ex.printStackTrace();\r
+ }\r
+ }\r
+ /*\r
+ * <param name="alignpdbfiles" value="false/true"/> Undocumented for 2.6\r
+ * - related to JAL-434\r
+ */\r
+ applet.setAlignPdbStructures(getDefaultParameter("alignpdbfiles",\r
+ false));\r
+ /*\r
+ * <param name="PDBfile" value="1gaq.txt PDB|1GAQ|1GAQ|A PDB|1GAQ|1GAQ|B\r
+ * PDB|1GAQ|1GAQ|C">\r
+ * \r
+ * <param name="PDBfile2" value="1gaq.txt A=SEQA B=SEQB C=SEQB">\r
+ * \r
+ * <param name="PDBfile3" value="1q0o Q45135_9MICO">\r
+ */\r
+\r
+ int pdbFileCount = 0;\r
+ // Accumulate pdbs here if they are heading for the same view (if\r
+ // alignPdbStructures is true)\r
+ Vector pdbs = new Vector();\r
+ // create a lazy matcher if we're asked to\r
+ jalview.analysis.SequenceIdMatcher matcher = (applet\r
+ .getDefaultParameter("relaxedidmatch", false)) ? new jalview.analysis.SequenceIdMatcher(\r
+ newAlignFrame.getAlignViewport().getAlignment()\r
+ .getSequencesArray()) : null;\r
+\r
+ do\r
+ {\r
+ if (pdbFileCount > 0)\r
+ {\r
+ param = applet.getParameter("PDBFILE" + pdbFileCount);\r
+ }\r
+ else\r
+ {\r
+ param = applet.getParameter("PDBFILE");\r
+ }\r
+\r
+ if (param != null)\r
+ {\r
+ PDBEntry pdb = new PDBEntry();\r
+\r
+ String seqstring;\r
+ SequenceI[] seqs = null;\r
+ String[] chains = null;\r
+\r
+ StringTokenizer st = new StringTokenizer(param, " ");\r
+\r
+ if (st.countTokens() < 2)\r
+ {\r
+ String sequence = applet.getParameter("PDBSEQ");\r
+ if (sequence != null)\r
+ seqs = new SequenceI[]\r
+ { matcher == null ? (Sequence) newAlignFrame\r
+ .getAlignViewport().getAlignment()\r
+ .findName(sequence) : matcher.findIdMatch(sequence) };\r
+\r
+ }\r
+ else\r
+ {\r
+ param = st.nextToken();\r
+ Vector tmp = new Vector();\r
+ Vector tmp2 = new Vector();\r
+\r
+ while (st.hasMoreTokens())\r
+ {\r
+ seqstring = st.nextToken();\r
+ StringTokenizer st2 = new StringTokenizer(seqstring, "=");\r
+ if (st2.countTokens() > 1)\r
+ {\r
+ // This is the chain\r
+ tmp2.addElement(st2.nextToken());\r
+ seqstring = st2.nextToken();\r
+ }\r
+ tmp.addElement(matcher == null ? (Sequence) newAlignFrame\r
+ .getAlignViewport().getAlignment()\r
+ .findName(seqstring) : matcher\r
+ .findIdMatch(seqstring));\r
+ }\r
+\r
+ seqs = new SequenceI[tmp.size()];\r
+ tmp.copyInto(seqs);\r
+ if (tmp2.size() == tmp.size())\r
+ {\r
+ chains = new String[tmp2.size()];\r
+ tmp2.copyInto(chains);\r
+ }\r
+ }\r
+ param = setProtocolState(param);\r
+\r
+ if (// !jmolAvailable\r
+ // &&\r
+ protocol == AppletFormatAdapter.CLASSLOADER\r
+ && !useXtrnalSviewer)\r
+ {\r
+ // Re: JAL-357 : the bug isn't a problem if we are using an\r
+ // external viewer!\r
+ // TODO: verify this Re:\r
+ // https://mantis.lifesci.dundee.ac.uk/view.php?id=36605\r
+ // This exception preserves the current behaviour where, even if\r
+ // the local pdb file was identified in the class loader\r
+ protocol = AppletFormatAdapter.URL; // this is probably NOT\r
+ // CORRECT!\r
+ param = addProtocol(param); //\r
+ }\r
+\r
+ pdb.setFile(param);\r
+\r
+ if (seqs != null)\r
+ {\r
+ for (int i = 0; i < seqs.length; i++)\r
+ {\r
+ if (seqs[i] != null)\r
+ {\r
+ ((Sequence) seqs[i]).addPDBId(pdb);\r
+ }\r
+ else\r
+ {\r
+ if (JalviewLite.debug)\r
+ {\r
+ // this may not really be a problem but we give a warning\r
+ // anyway\r
+ System.err\r
+ .println("Warning: Possible input parsing error: Null sequence for attachment of PDB (sequence "\r
+ + i + ")");\r
+ }\r
+ }\r
+ }\r
+\r
+ if (!alignPdbStructures)\r
+ {\r
+ newAlignFrame.newStructureView(applet, pdb, seqs, chains,\r
+ protocol);\r
+ }\r
+ else\r
+ {\r
+ pdbs.addElement(new Object[]\r
+ { pdb, seqs, chains, new String(protocol) });\r
+ }\r
+ }\r
+ }\r
+\r
+ pdbFileCount++;\r
+ } while (param != null || pdbFileCount < 10);\r
+ if (pdbs.size() > 0)\r
+ {\r
+ SequenceI[][] seqs = new SequenceI[pdbs.size()][];\r
+ PDBEntry[] pdb = new PDBEntry[pdbs.size()];\r
+ String[][] chains = new String[pdbs.size()][];\r
+ String[] protocols = new String[pdbs.size()];\r
+ for (int pdbsi = 0, pdbsiSize = pdbs.size(); pdbsi < pdbsiSize; pdbsi++)\r
+ {\r
+ Object[] o = (Object[]) pdbs.elementAt(pdbsi);\r
+ pdb[pdbsi] = (PDBEntry) o[0];\r
+ seqs[pdbsi] = (SequenceI[]) o[1];\r
+ chains[pdbsi] = (String[]) o[2];\r
+ protocols[pdbsi] = (String) o[3];\r
+ }\r
+ newAlignFrame.alignedStructureView(applet, pdb, seqs, chains,\r
+ protocols);\r
+\r