"UTF-8"));\r
\r
Vector shortNames = new Vector();\r
+ int treeCount=1;\r
\r
//REVERSE ORDER\r
for (int i = frames.length - 1; i > -1; i--)\r
}\r
}\r
\r
+\r
// USE THIS METHOD TO SAVE A SINGLE ALIGNMENT WINDOW\r
- public static void SaveState(AlignFrame af, String jarFile, String fileName)\r
+ public static void SaveAlignment(AlignFrame af, String jarFile, String fileName)\r
{\r
try\r
{\r
object.setVamsasModel(new VamsasModel());\r
\r
object.setCreationDate(new java.util.Date(timeStamp));\r
+ object.setVersion(jalview.bin.Cache.VERSION);\r
\r
jalview.datamodel.AlignmentI jal = af.viewport.alignment;\r
\r
}\r
\r
//SAVE TREES\r
+ ///////////////////////////////////\r
if (af.viewport.currentTree != null)\r
{\r
- object.getVamsasModel().addTree(af.viewport.currentTree.toString());\r
+ // FIND ANY ASSOCIATED TREES\r
+ JInternalFrame[] frames = Desktop.desktop.getAllFrames();\r
+ for(int t=0; t<frames.length; t++)\r
+ {\r
+ if (frames[t] instanceof TreePanel)\r
+ {\r
+ TreePanel tp = (TreePanel) frames[t];\r
+ if(tp.treeCanvas.av.alignment==jal)\r
+ {\r
+ Tree tree = new Tree();\r
+ tree.setTitle(tp.getTitle());\r
+ tree.setCurrentTree((af.viewport.currentTree == tp.getTree()));\r
+ tree.setNewick(tp.getTree().toString());\r
+ tree.setThreshold(tp.treeCanvas.threshold);\r
+\r
+ tree.setFitToWindow(tp.fitToWindow.getState());\r
+ tree.setFontSize(tp.treeCanvas.fontSize);\r
+ tree.setMarkUnlinked( tp.placeholdersMenu.getState() );\r
+ tree.setShowBootstrap( tp.bootstrapMenu.getState() );\r
+ tree.setShowDistances( tp.distanceMenu.getState() );\r
+\r
+ tree.setHeight(tp.getHeight());\r
+ tree.setWidth(tp.getWidth());\r
+ tree.setXpos(tp.getX());\r
+ tree.setYpos(tp.getY());\r
+\r
+ jms.addTree(tree);\r
+ }\r
+ }\r
+ }\r
}\r
\r
//SAVE ANNOTATIONS\r
}\r
}\r
\r
+ Vector seqs = new Vector();\r
+ int[] ids = groups[i].getSeq();\r
+\r
+ for (int s = 0; s < ids.length; s++)\r
+ {\r
+ seqs.addElement( (jalview.datamodel.SequenceI) seqids.elementAt(\r
+ ids[s]));\r
+ }\r
+\r
jalview.datamodel.SequenceGroup sg = new jalview.datamodel.\r
- SequenceGroup(groups[i].getName(),\r
+ SequenceGroup(seqs, groups[i].getName(),\r
cs, groups[i].getDisplayBoxes(),\r
groups[i].getDisplayText(), groups[i].getColourText(),\r
groups[i].getStart(), groups[i].getEnd());\r
+\r
sg.setOutlineColour(new java.awt.Color(\r
groups[i].getOutlineColour()));\r
\r
- int[] ids = groups[i].getSeq();\r
-\r
- for (int s = 0; s < ids.length; s++)\r
- {\r
- sg.addSequence( (jalview.datamodel.SequenceI) seqids.elementAt(\r
- ids[s]));\r
- }\r
\r
if (groups[i].getConsThreshold() != 0)\r
{\r
af.viewport.showQuality = view.getShowQuality();\r
af.viewport.showIdentity = view.getShowIdentity();\r
af.viewport.setAbovePIDThreshold(view.getPidSelected());\r
+ af.abovePIDThreshold.setSelected(view.getPidSelected());\r
af.viewport.setColourText(view.getShowColourText());\r
+ af.colourTextMenuItem.setSelected(view.getShowColourText());\r
af.viewport.setConservationSelected(view.getConservationSelected());\r
+ af.conservationMenuItem.setSelected(view.getConservationSelected());\r
+\r
af.viewport.setShowFullId(view.getShowFullId());\r
+ af.fullSeqId.setSelected(view.getShowFullId());\r
+\r
af.viewport.setFont(new java.awt.Font(view.getFontName(),\r
view.getFontStyle(), view.getFontSize()));\r
af.alignPanel.fontChanged();\r
\r
- af.sequenceFeatures_actionPerformed(null);\r
af.viewport.setRenderGaps(view.getRenderGaps());\r
+ af.renderGapsMenuItem.setSelected(view.getRenderGaps());\r
\r
af.viewport.setWrapAlignment(view.getWrapAlignment());\r
+ af.wrapMenuItem.setSelected(view.getWrapAlignment());\r
\r
if (view.getWrapAlignment())\r
{\r
}\r
else\r
{\r
+ af.annotationPanelMenuItem.setState(view.getShowAnnotation());\r
af.viewport.setShowAnnotation(view.getShowAnnotation());\r
af.alignPanel.setAnnotationVisible(view.getShowAnnotation());\r
}\r
\r
af.viewport.setShowBoxes(view.getShowBoxes());\r
+ af.viewBoxesMenuItem.setSelected(view.getShowBoxes());\r
af.viewport.setShowText(view.getShowText());\r
+ af.viewTextMenuItem.setSelected(view.getShowText());\r
\r
ColourSchemeI cs = null;\r
\r
af.changeColour(af.viewport.getGlobalColourScheme());\r
af.viewport.setColourAppliesToAllGroups(true);\r
\r
- System.out.println(view.getShowSequenceFeatures());\r
-\r
if (view.getShowSequenceFeatures())\r
{\r
- ;\r
+ af.viewport.showSequenceFeatures = true;\r
+ af.sequenceFeatures.setSelected(true);\r
+ new SequenceFeatureFetcher(al, af.alignPanel);\r
+ al.featuresAdded = true;\r
}\r
\r
- {\r
- SequenceFeatureFetcher sft = new SequenceFeatureFetcher(al,\r
- af.alignPanel);\r
- }\r
-\r
- //LOAD TREES - THIS RELEASE ONLY ALLOWS 1 TREE\r
- if (object.getVamsasModel().getTreeCount() > 0)\r
+ //LOAD TREES\r
+ ///////////////////////////////////////\r
+ if (jms.getTreeCount() > 0)\r
{\r
try\r
{\r
- af.ShowNewickTree(new jalview.io.NewickFile(\r
- (String) object.getVamsasModel().getTree(0)), "Tree");\r
+ for(int t = 0; t<jms.getTreeCount(); t++)\r
+ {\r
+ Tree tree = jms.getTree(t);\r
+\r
+ TreePanel tp = af.ShowNewickTree(new jalview.io.NewickFile(\r
+ tree.getNewick()), tree.getTitle());\r
+\r
+ tp.setBounds( tree.getXpos(),\r
+ tree.getYpos(),\r
+ tree.getWidth(),\r
+ tree.getHeight());\r
+\r
+ tp.fitToWindow.setState(tree.getFitToWindow());\r
+ tp.fitToWindow_actionPerformed(null);\r
+ tp.treeCanvas.fontSize = tree.getFontSize();\r
+ tp.fontSize.setText("Font Size - "+tree.getFontSize());\r
+ tp.placeholdersMenu.setState(tree.getMarkUnlinked());\r
+ tp.placeholdersMenu_actionPerformed(null);\r
+ tp.bootstrapMenu.setState(tree.getShowBootstrap());\r
+ tp.bootstrapMenu_actionPerformed(null);\r
+ tp.distanceMenu.setState(tree.getShowDistances());\r
+ tp.distanceMenu_actionPerformed(null);\r
+ tp.treeCanvas.threshold = tree.getThreshold();\r
+ if(tree.getCurrentTree());\r
+ af.viewport.setCurrentTree(tp.getTree());\r
+ }\r
}\r
catch (Exception ex)\r
{\r