2 * Jalview - A Sequence Alignment Editor and Viewer
\r
3 * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
\r
5 * This program is free software; you can redistribute it and/or
\r
6 * modify it under the terms of the GNU General Public License
\r
7 * as published by the Free Software Foundation; either version 2
\r
8 * of the License, or (at your option) any later version.
\r
10 * This program is distributed in the hope that it will be useful,
\r
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
13 * GNU General Public License for more details.
\r
15 * You should have received a copy of the GNU General Public License
\r
16 * along with this program; if not, write to the Free Software
\r
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
\r
19 package jalview.gui;
\r
21 import jalview.binding.*;
\r
23 import jalview.io.*;
\r
25 import jalview.schemes.*;
\r
32 import java.util.jar.*;
\r
34 import javax.swing.*;
\r
41 * @version $Revision$
\r
43 public class Jalview2XML
\r
45 // SAVES SEVERAL ALIGNEMENT WINDOWS TO SAME JARFILE
\r
46 public static void SaveState(File statefile)
\r
48 long creation = System.currentTimeMillis();
\r
49 JInternalFrame[] frames = Desktop.desktop.getAllFrames();
\r
58 FileOutputStream fos = new FileOutputStream(statefile);
\r
59 JarOutputStream jout = new JarOutputStream(fos);
\r
61 //NOTE UTF-8 MUST BE USED FOR WRITING UNICODE CHARS
\r
62 ////////////////////////////////////////////////////
\r
63 PrintWriter out = new PrintWriter(new OutputStreamWriter(jout,
\r
66 Vector shortNames = new Vector();
\r
69 for (int i = frames.length - 1; i > -1; i--)
\r
71 if (frames[i] instanceof AlignFrame)
\r
73 AlignFrame af = (AlignFrame) frames[i];
\r
75 String shortName = af.getTitle();
\r
77 if (shortName.indexOf(File.separatorChar) > -1)
\r
79 shortName = shortName.substring(shortName.lastIndexOf(
\r
80 File.separatorChar) + 1);
\r
85 while (shortNames.contains(shortName))
\r
87 if (shortName.endsWith("_" + (count - 1)))
\r
89 shortName = shortName.substring(0,
\r
90 shortName.lastIndexOf("_"));
\r
93 shortName = shortName.concat("_" + count);
\r
97 shortNames.addElement(shortName);
\r
99 if (!shortName.endsWith(".xml"))
\r
101 shortName = shortName + ".xml";
\r
104 SaveState(af, creation, shortName, jout, out);
\r
111 catch (Exception ex)
\r
113 ex.printStackTrace();
\r
117 // USE THIS METHOD TO SAVE A SINGLE ALIGNMENT WINDOW
\r
118 public static void SaveAlignment(AlignFrame af, String jarFile,
\r
123 FileOutputStream fos = new FileOutputStream(jarFile);
\r
124 JarOutputStream jout = new JarOutputStream(fos);
\r
126 //NOTE UTF-8 MUST BE USED FOR WRITING UNICODE CHARS
\r
127 ////////////////////////////////////////////////////
\r
128 PrintWriter out = new PrintWriter(new OutputStreamWriter(jout,
\r
131 SaveState(af, System.currentTimeMillis(), fileName, jout, out);
\r
135 catch (Exception ex)
\r
143 * @param af DOCUMENT ME!
\r
144 * @param timeStamp DOCUMENT ME!
\r
145 * @param fileName DOCUMENT ME!
\r
146 * @param jout DOCUMENT ME!
\r
147 * @param out DOCUMENT ME!
\r
149 public static void SaveState(AlignFrame af, long timeStamp,
\r
150 String fileName, JarOutputStream jout, PrintWriter out)
\r
152 Vector seqids = new Vector();
\r
153 Vector userColours = new Vector();
\r
155 AlignViewport av = af.viewport;
\r
157 JalviewModel object = new JalviewModel();
\r
158 object.setVamsasModel(new VamsasModel());
\r
160 object.setCreationDate(new java.util.Date(timeStamp));
\r
161 object.setVersion(jalview.bin.Cache.getProperty("VERSION"));
\r
163 jalview.datamodel.AlignmentI jal = af.viewport.alignment;
\r
165 SequenceSet vamsasSet = new SequenceSet();
\r
166 Sequence vamsasSeq;
\r
167 JalviewModelSequence jms = new JalviewModelSequence();
\r
169 vamsasSet.setGapChar(jal.getGapCharacter() + "");
\r
176 for (int i = 0; i < jal.getHeight(); i++)
\r
178 seqids.add(jal.getSequenceAt(i));
\r
180 vamsasSeq = new Sequence();
\r
181 vamsasSeq.setId(id + "");
\r
182 vamsasSeq.setName(jal.getSequenceAt(i).getName());
\r
183 vamsasSeq.setSequence(jal.getSequenceAt(i).getSequence());
\r
186 jseq.setStart(jal.getSequenceAt(i).getStart());
\r
187 jseq.setEnd(jal.getSequenceAt(i).getEnd());
\r
189 jseq.setColour(jal.getSequenceAt(i).getColor().getRGB());
\r
194 vamsasSet.addSequence(vamsasSeq);
\r
199 ///////////////////////////////////
\r
200 if (af.viewport.currentTree != null)
\r
202 // FIND ANY ASSOCIATED TREES
\r
203 JInternalFrame[] frames = Desktop.desktop.getAllFrames();
\r
205 for (int t = 0; t < frames.length; t++)
\r
207 if (frames[t] instanceof TreePanel)
\r
209 TreePanel tp = (TreePanel) frames[t];
\r
211 if (tp.treeCanvas.av.alignment == jal)
\r
213 Tree tree = new Tree();
\r
214 tree.setTitle(tp.getTitle());
\r
215 tree.setCurrentTree((af.viewport.currentTree == tp.getTree()));
\r
216 tree.setNewick(tp.getTree().toString());
\r
217 tree.setThreshold(tp.treeCanvas.threshold);
\r
219 tree.setFitToWindow(tp.fitToWindow.getState());
\r
220 tree.setFontSize(tp.treeCanvas.fontSize);
\r
221 tree.setMarkUnlinked(tp.placeholdersMenu.getState());
\r
222 tree.setShowBootstrap(tp.bootstrapMenu.getState());
\r
223 tree.setShowDistances(tp.distanceMenu.getState());
\r
225 tree.setHeight(tp.getHeight());
\r
226 tree.setWidth(tp.getWidth());
\r
227 tree.setXpos(tp.getX());
\r
228 tree.setYpos(tp.getY());
\r
237 if (jal.getAlignmentAnnotation() != null)
\r
239 jalview.datamodel.AlignmentAnnotation[] aa = jal.getAlignmentAnnotation();
\r
241 for (int i = 0; i < aa.length; i++)
\r
243 if (aa[i].label.equals("Quality") ||
\r
244 aa[i].label.equals("Conservation") ||
\r
245 aa[i].label.equals("Consensus"))
\r
250 Annotation an = new Annotation();
\r
251 an.setDescription(aa[i].description);
\r
252 an.setGraph(aa[i].isGraph);
\r
253 an.setLabel(aa[i].label);
\r
255 AnnotationElement ae;
\r
257 for (int a = 0; a < aa[i].annotations.length; a++)
\r
259 if ((aa[i] == null) || (aa[i].annotations[a] == null))
\r
264 ae = new AnnotationElement();
\r
265 ae.setDescription(aa[i].annotations[a].description);
\r
266 ae.setDisplayCharacter(aa[i].annotations[a].displayCharacter);
\r
267 ae.setValue(aa[i].annotations[a].value);
\r
269 ae.setSecondaryStructure(aa[i].annotations[a].secondaryStructure +
\r
271 an.addAnnotationElement(ae);
\r
274 vamsasSet.addAnnotation(an);
\r
279 if (jal.getGroups() != null)
\r
281 JGroup[] groups = new JGroup[jal.getGroups().size()];
\r
283 for (int i = 0; i < groups.length; i++)
\r
285 groups[i] = new JGroup();
\r
287 jalview.datamodel.SequenceGroup sg = (jalview.datamodel.SequenceGroup) jal.getGroups()
\r
289 groups[i].setStart(sg.getStartRes());
\r
290 groups[i].setEnd(sg.getEndRes());
\r
291 groups[i].setName(sg.getName());
\r
293 if (sg.cs instanceof ConservationColourScheme)
\r
295 groups[i].setConsThreshold(((ConservationColourScheme) sg.cs).inc);
\r
298 if (sg.cs instanceof ResidueColourScheme)
\r
300 groups[i].setPidThreshold(((ResidueColourScheme) sg.cs).getThreshold());
\r
302 else if (sg.cs instanceof ScoreColourScheme)
\r
304 groups[i].setPidThreshold(((ScoreColourScheme) sg.cs).getThreshold());
\r
307 if (sg.cs instanceof jalview.schemes.UserColourScheme)
\r
309 groups[i].setColour(SetUserColourScheme(sg.cs, userColours,
\r
314 groups[i].setColour(ColourSchemeProperty.getColourName(
\r
318 groups[i].setOutlineColour(sg.getOutlineColour().getRGB());
\r
319 groups[i].setDisplayBoxes(sg.getDisplayBoxes());
\r
320 groups[i].setDisplayText(sg.getDisplayText());
\r
321 groups[i].setColourText(sg.getColourText());
\r
323 for (int s = 0; s < sg.getSize(); s++)
\r
325 jalview.datamodel.Sequence seq = (jalview.datamodel.Sequence) sg.getSequenceAt(s);
\r
326 int index = seqids.indexOf(seq);
\r
327 groups[i].addSeq(index);
\r
331 jms.setJGroup(groups);
\r
334 ///////////SAVE VIEWPORT
\r
335 Viewport view = new Viewport();
\r
336 view.setTitle(af.getTitle());
\r
337 view.setXpos(af.getX());
\r
338 view.setYpos(af.getY());
\r
339 view.setWidth(af.getWidth());
\r
340 view.setHeight(af.getHeight());
\r
341 view.setStartRes(av.startRes);
\r
342 view.setStartSeq(av.startSeq);
\r
344 if (av.getGlobalColourScheme() instanceof jalview.schemes.UserColourScheme)
\r
346 view.setBgColour(SetUserColourScheme(av.getGlobalColourScheme(),
\r
347 userColours, jms));
\r
351 view.setBgColour(ColourSchemeProperty.getColourName(
\r
352 av.getGlobalColourScheme()));
\r
355 ColourSchemeI cs = av.getGlobalColourScheme();
\r
357 if (cs instanceof ConservationColourScheme)
\r
359 view.setConsThreshold(((ConservationColourScheme) cs).inc);
\r
362 if (cs instanceof ResidueColourScheme)
\r
364 view.setPidThreshold(((ResidueColourScheme) cs).getThreshold());
\r
366 else if (cs instanceof ScoreColourScheme)
\r
368 view.setPidThreshold(((ScoreColourScheme) cs).getThreshold());
\r
371 view.setConservationSelected(av.getConservationSelected());
\r
372 view.setPidSelected(av.getAbovePIDThreshold());
\r
373 view.setFontName(av.font.getFontName());
\r
374 view.setFontSize(av.font.getSize());
\r
375 view.setFontStyle(av.font.getStyle());
\r
376 view.setRenderGaps(av.renderGaps);
\r
377 view.setShowAnnotation(av.getShowAnnotation());
\r
378 view.setShowBoxes(av.getShowBoxes());
\r
379 view.setShowColourText(av.getColourText());
\r
380 view.setShowConservation(av.showConservation);
\r
381 view.setShowFullId(av.getShowFullId());
\r
382 view.setShowIdentity(av.showIdentity);
\r
383 view.setShowQuality(av.showQuality);
\r
384 view.setShowSequenceFeatures(av.showSequenceFeatures);
\r
385 view.setShowText(av.getShowText());
\r
386 view.setWrapAlignment(av.getWrapAlignment());
\r
388 jms.addViewport(view);
\r
390 object.setJalviewModelSequence(jms);
\r
391 object.getVamsasModel().addSequenceSet(vamsasSet);
\r
395 if (!fileName.endsWith(".xml"))
\r
397 fileName = fileName + ".xml";
\r
400 JarEntry entry = new JarEntry(fileName);
\r
401 jout.putNextEntry(entry);
\r
403 object.marshal(out);
\r
405 catch (Exception ex)
\r
407 ex.printStackTrace();
\r
411 static String SetUserColourScheme(jalview.schemes.ColourSchemeI cs,
\r
412 Vector userColours, JalviewModelSequence jms)
\r
415 jalview.schemes.UserColourScheme ucs = (jalview.schemes.UserColourScheme) cs;
\r
417 if (!userColours.contains(ucs))
\r
419 userColours.add(ucs);
\r
421 java.awt.Color[] colours = ucs.getColours();
\r
422 jalview.binding.UserColours uc = new jalview.binding.UserColours();
\r
423 jalview.binding.UserColourScheme jbucs = new jalview.binding.UserColourScheme();
\r
425 for (int i = 0; i < colours.length; i++)
\r
427 jalview.binding.Colour col = new jalview.binding.Colour();
\r
428 col.setRGB(jalview.util.Format.getHexString(colours[i]));
\r
429 jbucs.addColour(col);
\r
432 id = "ucs" + userColours.indexOf(ucs);
\r
434 uc.setUserColourScheme(jbucs);
\r
435 jms.addUserColours(uc);
\r
441 static jalview.schemes.UserColourScheme GetUserColourScheme(
\r
442 JalviewModelSequence jms, String id)
\r
444 UserColours[] uc = jms.getUserColours();
\r
445 UserColours colours = null;
\r
447 for (int i = 0; i < uc.length; i++)
\r
449 if (uc[i].getId().equals(id))
\r
457 int csize = colours.getUserColourScheme().getColourCount();
\r
458 java.awt.Color[] newColours = new java.awt.Color[csize];
\r
460 for (int i = 0; i < csize; i++)
\r
462 newColours[i] = new java.awt.Color(Integer.parseInt(
\r
463 colours.getUserColourScheme().getColour(i).getRGB(), 16));
\r
466 return new jalview.schemes.UserColourScheme(newColours);
\r
472 * @param file DOCUMENT ME!
\r
474 public static AlignFrame LoadJalviewAlign(String file)
\r
476 JalviewModel object = new JalviewModel();
\r
477 jalview.gui.AlignFrame af = null;
\r
481 //UNMARSHALLER SEEMS TO CLOSE JARINPUTSTREAM, MOST ANNOYING
\r
484 if (file.startsWith("http://"))
\r
486 url = new URL(file);
\r
489 JarInputStream jin = null;
\r
490 JarEntry jarentry = null;
\r
491 int entryCount = 1;
\r
497 jin = new JarInputStream(url.openStream());
\r
501 jin = new JarInputStream(new FileInputStream(file));
\r
504 for (int i = 0; i < entryCount; i++)
\r
506 jarentry = jin.getNextJarEntry();
\r
509 if (jarentry != null)
\r
511 InputStreamReader in = new InputStreamReader(jin, "UTF-8");
\r
512 object = (JalviewModel) object.unmarshal(in);
\r
513 af = LoadFromObject(object);
\r
517 while (jarentry != null);
\r
519 catch (Exception ex)
\r
521 System.err.println("Exception whilst loading jalview XML file : " +
\r
523 JOptionPane.showInternalMessageDialog(Desktop.desktop,
\r
524 "Couldn't locate " + file,
\r
526 JOptionPane.WARNING_MESSAGE);
\r
533 static AlignFrame LoadFromObject(JalviewModel object)
\r
535 Vector seqids = new Vector();
\r
536 SequenceSet vamsasSet = object.getVamsasModel().getSequenceSet(0);
\r
537 Sequence[] vamsasSeq = vamsasSet.getSequence();
\r
539 JalviewModelSequence jms = object.getJalviewModelSequence();
\r
541 //////////////////////////////////
\r
543 jalview.datamodel.Sequence[] jseqs = new jalview.datamodel.Sequence[vamsasSeq.length];
\r
544 JSeq[] JSEQ = object.getJalviewModelSequence().getJSeq();
\r
546 for (int i = 0; i < vamsasSeq.length; i++)
\r
548 jseqs[i] = new jalview.datamodel.Sequence(vamsasSeq[i].getName(),
\r
549 vamsasSeq[i].getSequence());
\r
551 jseqs[i].setStart(JSEQ[i].getStart());
\r
552 jseqs[i].setEnd(JSEQ[i].getEnd());
\r
553 jseqs[i].setColor(new java.awt.Color(JSEQ[i].getColour()));
\r
554 seqids.add(jseqs[i]);
\r
557 /////////////////////////////////
\r
558 jalview.datamodel.Alignment al = new jalview.datamodel.Alignment(jseqs);
\r
560 /////////////////////////////////
\r
561 //////////////////////////////////
\r
563 if (vamsasSet.getAnnotation() != null)
\r
565 Annotation[] an = vamsasSet.getAnnotation();
\r
567 for (int i = 0; i < an.length; i++)
\r
569 AnnotationElement[] ae = an[i].getAnnotationElement();
\r
570 jalview.datamodel.Annotation[] anot = new jalview.datamodel.Annotation[al.getWidth()];
\r
572 for (int aa = 0; aa < ae.length; aa++)
\r
574 anot[ae[aa].getPosition()] = new jalview.datamodel.Annotation(ae[aa].getDisplayCharacter(),
\r
575 ae[aa].getDescription(),
\r
576 ae[aa].getSecondaryStructure().charAt(0),
\r
577 ae[aa].getValue());
\r
580 jalview.datamodel.AlignmentAnnotation jaa = null;
\r
582 if (an[i].getGraph())
\r
584 jaa = new jalview.datamodel.AlignmentAnnotation(an[i].getLabel(),
\r
585 an[i].getDescription(), anot, 0, 0, 1);
\r
589 jaa = new jalview.datamodel.AlignmentAnnotation(an[i].getLabel(),
\r
590 an[i].getDescription(), anot);
\r
593 al.addAnnotation(jaa);
\r
597 /////////////////////////////////
\r
599 Viewport[] views = jms.getViewport();
\r
600 Viewport view = views[0]; // DEAL WITH MULTIPLE VIEWPORTS LATER
\r
602 AlignFrame af = new AlignFrame(al);
\r
604 // af.changeColour() );
\r
605 /////////////////////////
\r
607 if (jms.getJGroupCount() > 0)
\r
609 JGroup[] groups = jms.getJGroup();
\r
611 for (int i = 0; i < groups.length; i++)
\r
613 ColourSchemeI cs = null;
\r
615 if (groups[i].getColour() != null)
\r
617 if (groups[i].getColour().startsWith("ucs"))
\r
619 cs = GetUserColourScheme(jms, groups[i].getColour());
\r
623 cs = ColourSchemeProperty.getColour(al,
\r
624 groups[i].getColour());
\r
627 if (cs instanceof ResidueColourScheme)
\r
629 ((ResidueColourScheme) cs).setThreshold(groups[i].getPidThreshold());
\r
631 else if (cs instanceof ScoreColourScheme)
\r
633 ((ScoreColourScheme) cs).setThreshold(groups[i].getPidThreshold());
\r
637 Vector seqs = new Vector();
\r
638 int[] ids = groups[i].getSeq();
\r
640 for (int s = 0; s < ids.length; s++)
\r
642 seqs.addElement((jalview.datamodel.SequenceI) seqids.elementAt(
\r
646 jalview.datamodel.SequenceGroup sg = new jalview.datamodel.SequenceGroup(seqs,
\r
647 groups[i].getName(), cs, groups[i].getDisplayBoxes(),
\r
648 groups[i].getDisplayText(), groups[i].getColourText(),
\r
649 groups[i].getStart(), groups[i].getEnd());
\r
651 sg.setOutlineColour(new java.awt.Color(
\r
652 groups[i].getOutlineColour()));
\r
654 if (groups[i].getConsThreshold() != 0)
\r
656 jalview.analysis.Conservation c = new jalview.analysis.Conservation("All",
\r
657 ResidueProperties.propHash, 3, sg.sequences, 0,
\r
658 sg.getWidth() - 1);
\r
660 c.verdict(false, 25);
\r
661 cs = new ConservationColourScheme(c, cs);
\r
669 Desktop.addInternalFrame(af, view.getTitle(),
\r
670 AlignFrame.NEW_WINDOW_WIDTH, AlignFrame.NEW_WINDOW_HEIGHT);
\r
671 af.setBounds(view.getXpos(), view.getYpos(), view.getWidth(),
\r
673 af.viewport.setStartRes(view.getStartRes());
\r
674 af.viewport.setStartSeq(view.getStartSeq());
\r
675 af.viewport.showConservation = view.getShowConservation();
\r
676 af.viewport.showQuality = view.getShowQuality();
\r
677 af.viewport.showIdentity = view.getShowIdentity();
\r
678 af.viewport.setAbovePIDThreshold(view.getPidSelected());
\r
679 af.abovePIDThreshold.setSelected(view.getPidSelected());
\r
680 af.viewport.setColourText(view.getShowColourText());
\r
681 af.colourTextMenuItem.setSelected(view.getShowColourText());
\r
682 af.viewport.setConservationSelected(view.getConservationSelected());
\r
683 af.conservationMenuItem.setSelected(view.getConservationSelected());
\r
685 af.viewport.setShowFullId(view.getShowFullId());
\r
686 af.fullSeqId.setSelected(view.getShowFullId());
\r
688 af.viewport.setFont(new java.awt.Font(view.getFontName(),
\r
689 view.getFontStyle(), view.getFontSize()));
\r
690 af.alignPanel.fontChanged();
\r
692 af.viewport.setRenderGaps(view.getRenderGaps());
\r
693 af.renderGapsMenuItem.setSelected(view.getRenderGaps());
\r
695 af.viewport.setWrapAlignment(view.getWrapAlignment());
\r
696 af.wrapMenuItem.setSelected(view.getWrapAlignment());
\r
698 if (view.getWrapAlignment())
\r
700 af.alignPanel.setWrapAlignment(view.getWrapAlignment());
\r
704 af.annotationPanelMenuItem.setState(view.getShowAnnotation());
\r
705 af.viewport.setShowAnnotation(view.getShowAnnotation());
\r
706 af.alignPanel.setAnnotationVisible(view.getShowAnnotation());
\r
709 af.viewport.setShowBoxes(view.getShowBoxes());
\r
710 af.viewBoxesMenuItem.setSelected(view.getShowBoxes());
\r
711 af.viewport.setShowText(view.getShowText());
\r
712 af.viewTextMenuItem.setSelected(view.getShowText());
\r
714 ColourSchemeI cs = null;
\r
716 if (view.getBgColour() != null)
\r
718 if (view.getBgColour().startsWith("ucs"))
\r
720 cs = GetUserColourScheme(jms, view.getBgColour());
\r
724 cs = ColourSchemeProperty.getColour(al, view.getBgColour());
\r
727 if (cs instanceof ConservationColourScheme)
\r
729 ((ConservationColourScheme) cs).inc = view.getConsThreshold();
\r
732 if (cs instanceof ResidueColourScheme)
\r
734 ((ResidueColourScheme) cs).setThreshold(view.getPidThreshold());
\r
736 else if (cs instanceof ScoreColourScheme)
\r
738 ((ScoreColourScheme) cs).setThreshold(view.getPidThreshold());
\r
742 af.viewport.setGlobalColourScheme(cs);
\r
744 af.viewport.setColourAppliesToAllGroups(false);
\r
745 af.changeColour(af.viewport.getGlobalColourScheme());
\r
746 af.viewport.setColourAppliesToAllGroups(true);
\r
748 if (view.getShowSequenceFeatures())
\r
750 af.viewport.showSequenceFeatures = true;
\r
751 af.sequenceFeatures.setSelected(true);
\r
752 new SequenceFeatureFetcher(al, af.alignPanel);
\r
753 al.featuresAdded = true;
\r
757 ///////////////////////////////////////
\r
758 if (jms.getTreeCount() > 0)
\r
762 for (int t = 0; t < jms.getTreeCount(); t++)
\r
764 Tree tree = jms.getTree(t);
\r
766 TreePanel tp = af.ShowNewickTree(new jalview.io.NewickFile(
\r
767 tree.getNewick()), tree.getTitle());
\r
769 tp.setBounds(tree.getXpos(), tree.getYpos(),
\r
770 tree.getWidth(), tree.getHeight());
\r
772 tp.fitToWindow.setState(tree.getFitToWindow());
\r
773 tp.fitToWindow_actionPerformed(null);
\r
774 tp.treeCanvas.fontSize = tree.getFontSize();
\r
775 tp.fontSize.setText("Font Size - " + tree.getFontSize());
\r
776 tp.placeholdersMenu.setState(tree.getMarkUnlinked());
\r
777 tp.placeholdersMenu_actionPerformed(null);
\r
778 tp.bootstrapMenu.setState(tree.getShowBootstrap());
\r
779 tp.bootstrapMenu_actionPerformed(null);
\r
780 tp.distanceMenu.setState(tree.getShowDistances());
\r
781 tp.distanceMenu_actionPerformed(null);
\r
782 tp.treeCanvas.threshold = tree.getThreshold();
\r
784 if (tree.getCurrentTree())
\r
785 af.viewport.setCurrentTree(tp.getTree());
\r
788 catch (Exception ex)
\r
790 ex.printStackTrace();
\r