X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fio%2Fvamsas%2FTree.java;h=b5ada2658d5e4cb0e9892bc28c83748b993f3644;hb=42c2e0b486ea69e2ac3e8cbede6750062339e600;hp=5fdd0c9c6cdf6d5448b0df96f5ef4f018783810a;hpb=797df64fa2a0a30773d0f48f5494d4155e5a8be3;p=jalview.git
diff --git a/src/jalview/io/vamsas/Tree.java b/src/jalview/io/vamsas/Tree.java
index 5fdd0c9..b5ada26 100644
--- a/src/jalview/io/vamsas/Tree.java
+++ b/src/jalview/io/vamsas/Tree.java
@@ -1,29 +1,32 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
- * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
* Jalview is free software: you can redistribute it and/or
* modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- *
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
* Jalview is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with Jalview. If not, see .
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.io.vamsas;
import java.io.IOException;
import java.util.Enumeration;
import java.util.Hashtable;
+import java.util.List;
import java.util.Vector;
import jalview.analysis.NJTree;
-import jalview.analysis.SequenceIdMatcher;
import jalview.bin.Cache;
import jalview.datamodel.AlignmentI;
import jalview.datamodel.AlignmentView;
@@ -32,11 +35,10 @@ import jalview.datamodel.SeqCigar;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import jalview.datamodel.SequenceNode;
-import jalview.gui.AlignFrame;
-import jalview.gui.AlignViewport;
import jalview.gui.TreePanel;
import jalview.io.NewickFile;
import jalview.io.VamsasAppDatastore;
+import jalview.viewmodel.AlignmentViewport;
import uk.ac.vamsas.client.Vobject;
import uk.ac.vamsas.objects.core.AlignmentSequence;
import uk.ac.vamsas.objects.core.Entry;
@@ -103,6 +105,7 @@ public class Tree extends DatastoreItem
*
* @see jalview.io.vamsas.DatastoreItem#addFromDocument()
*/
+ @Override
public void addFromDocument()
{
tree = (uk.ac.vamsas.objects.core.Tree) vobj; // vtree;
@@ -133,6 +136,7 @@ public class Tree extends DatastoreItem
*
* @see jalview.io.vamsas.DatastoreItem#conflict()
*/
+ @Override
public void conflict()
{
Cache.log
@@ -144,6 +148,7 @@ public class Tree extends DatastoreItem
*
* @see jalview.io.vamsas.DatastoreItem#update()
*/
+ @Override
public void updateToDoc()
{
if (isModifiable(tree.getModifiable()))
@@ -164,6 +169,7 @@ public class Tree extends DatastoreItem
*
* @see jalview.io.vamsas.DatastoreItem#updateFromDoc()
*/
+ @Override
public void updateFromDoc()
{
// should probably just open a new tree panel in the same place as the old
@@ -264,20 +270,22 @@ public class Tree extends DatastoreItem
SeqCigar[] tseqs = new SeqCigar[sequences.length];
System.arraycopy(sequences, 0, tseqs, 0, sequences.length);
Vector alsq = new Vector();
- Enumeration as = jal.getSequences().elements();
- while (as.hasMoreElements())
+ List jalsqs;
+ synchronized (jalsqs = jal.getSequences())
{
- SequenceI asq = (SequenceI) as.nextElement();
- for (int t = 0; t < sequences.length; t++)
+ for (SequenceI asq : jalsqs)
{
- if (tseqs[t] != null
- && (tseqs[t].getRefSeq() == asq || tseqs[t].getRefSeq() == asq
- .getDatasetSequence()))
- // && tseqs[t].getStart()>=asq.getStart() &&
- // tseqs[t].getEnd()<=asq.getEnd())
+ for (int t = 0; t < sequences.length; t++)
{
- tseqs[t] = null;
- alsq.add(asq);
+ if (tseqs[t] != null
+ && (tseqs[t].getRefSeq() == asq || tseqs[t].getRefSeq() == asq
+ .getDatasetSequence()))
+ // && tseqs[t].getStart()>=asq.getStart() &&
+ // tseqs[t].getEnd()<=asq.getEnd())
+ {
+ tseqs[t] = null;
+ alsq.add(asq);
+ }
}
}
}
@@ -475,6 +483,7 @@ public class Tree extends DatastoreItem
* add jalview object to vamsas document
*
*/
+ @Override
public void addToDocument()
{
tree = new uk.ac.vamsas.objects.core.Tree();
@@ -501,7 +510,7 @@ public class Tree extends DatastoreItem
*/
public Object[] recoverInputData(Provenance tp)
{
- AlignViewport javport = null;
+ AlignmentViewport javport = null;
jalview.datamodel.AlignmentI jal = null;
jalview.datamodel.CigarArray view = null;
for (int pe = 0; pe < tp.getEntryCount(); pe++)
@@ -595,7 +604,7 @@ public class Tree extends DatastoreItem
return null;
}
- private AlignViewport getViewport(Vobject v_parent)
+ private AlignmentViewport getViewport(Vobject v_parent)
{
if (v_parent instanceof uk.ac.vamsas.objects.core.Alignment)
{