X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FVamsasAppDatastore.java;h=34c61d94f234a15f6011d5bdcd11f99adc327387;hb=865a855a4ca87eadb3e5ff284ed32ed307d9c34b;hp=a2bf424957d83d3b137e22017f0152d049e33db4;hpb=f52f7b378972cc884b5d3e5cc250f89667f558f7;p=jalview.git
diff --git a/src/jalview/io/VamsasAppDatastore.java b/src/jalview/io/VamsasAppDatastore.java
index a2bf424..34c61d9 100644
--- a/src/jalview/io/VamsasAppDatastore.java
+++ b/src/jalview/io/VamsasAppDatastore.java
@@ -1,19 +1,20 @@
/*
- * 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 2.8.0b1)
+ * Copyright (C) 2014 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
+ * 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.
- *
- * 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
+ *
+ * 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 .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.io;
@@ -178,7 +179,7 @@ public class VamsasAppDatastore
}
/**
- *
+ *
* @param vobj
* @return Jalview datamodel object bound to the vamsas document object
*/
@@ -245,7 +246,7 @@ public class VamsasAppDatastore
/**
* put the alignment viewed by AlignViewport into cdoc.
- *
+ *
* @param av
* alignViewport to be stored
* @param aFtitle
@@ -486,14 +487,14 @@ public class VamsasAppDatastore
/*
* We do not put local Alignment Sequence Features into the vamsas
* document yet.
- *
- *
+ *
+ *
* jalview.datamodel.SequenceFeature[] features = alseq
* .getSequenceFeatures(); for (int f = 0; f < features.length; f++) {
* if (features[f] != null) { AlignmentSequenceAnnotation valseqf = (
* AlignmentSequenceAnnotation) getjv2vObj(features[i]); if (valseqf
* == null) {
- *
+ *
* valseqf = (AlignmentSequenceAnnotation) getDSAnnotationFromJalview(
* new AlignmentSequenceAnnotation(), features[i]);
* valseqf.setGraph(false);
@@ -541,7 +542,8 @@ public class VamsasAppDatastore
else
{
// first find the alignment sequence to associate this with.
- for (SequenceI jvalsq:av.getAlignment().getSequences()) {
+ for (SequenceI jvalsq : av.getAlignment().getSequences())
+ {
// saveDatasetSequenceAnnotation(AlSeqMaps,(uk.ac.vamsas.objects.core.Sequence)
// sref, aa[i]);
if (jvalsq.getDatasetSequence() == aa[i].sequenceRef)
@@ -719,7 +721,7 @@ public class VamsasAppDatastore
* very quick test to see if the viewport would be stored in the vamsas
* document. Reasons for not storing include the unaligned flag being false
* (for all sequences, including the hidden ones!)
- *
+ *
* @param av
* @return true if alignment associated with this view will be stored in
* document.
@@ -741,7 +743,7 @@ public class VamsasAppDatastore
/**
* remove docseqs from the given alignment marking provenance appropriately
* and removing any references to the sequences.
- *
+ *
* @param alignment
* @param docseqs
*/
@@ -809,7 +811,7 @@ public class VamsasAppDatastore
* vamsas alignment sequence for jvalsq and adds it to the alignment if
* necessary. unbounddocseq is a duplicate of the vamsas alignment sequences
* and these are removed after being processed w.r.t a bound jvalsq
- *
+ *
*/
private boolean syncToAlignmentSequence(SequenceI jvalsq,
Alignment alignment, Vector unbounddocseq)
@@ -1158,7 +1160,7 @@ public class VamsasAppDatastore
/**
* set vamsas annotation object type from jalview annotation
- *
+ *
* @param an
* @param alan
*/
@@ -1206,7 +1208,7 @@ public class VamsasAppDatastore
/**
* get start 0)
{
jalview.structure.StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance).addMappings(mappings);
+ .getStructureSelectionManager(Desktop.instance)
+ .addMappings(mappings);
}
}
}
@@ -1456,7 +1459,7 @@ public class VamsasAppDatastore
/**
* replaces oldjvobject with newjvobject in the Jalview Object <> VorbaID
* binding tables
- *
+ *
* @param oldjvobject
* @param newjvobject
* (may be null)
@@ -1466,6 +1469,8 @@ public class VamsasAppDatastore
Object vobject = jv2vobj.remove(oldjvobject);
if (vobject == null)
{
+ // NOTE: this happens if user deletes object in one session then updates
+ // from another client
throw new Error(
"IMPLEMENTATION ERROR: old jalview object is not bound ! ("
+ oldjvobject + ")");
@@ -1514,7 +1519,7 @@ public class VamsasAppDatastore
/**
* translate the Vobject keys to strings for use in Jalview2XML
- *
+ *
* @param jv2vobj2
* @return
*/
@@ -1532,7 +1537,7 @@ public class VamsasAppDatastore
/**
* translate the Vobject values to strings for use in Jalview2XML
- *
+ *
* @param vobj2jv2
* @return hashtable with string values
*/
@@ -1550,7 +1555,7 @@ public class VamsasAppDatastore
/**
* synchronize Jalview from the vamsas document
- *
+ *
* @return number of new views from document
*/
public int updateToJalview()
@@ -1777,7 +1782,7 @@ public class VamsasAppDatastore
for (i = 0, iSize = dsseqs.size(); i < iSize; i++)
{
seqs[i] = dsseqs.get(i);
- dsseqs.set(i,null);
+ dsseqs.set(i, null);
}
jal = new jalview.datamodel.Alignment(seqs);
Cache.log.debug("New vamsas alignment imported into jalview "
@@ -1981,7 +1986,7 @@ public class VamsasAppDatastore
* jalview.datamodel.Annotation[] rows Two annotation rows are made if there
* are distinct annotation for both at 'pos' and 'after pos' at any particular
* site.
- *
+ *
* @param annotation
* @return { boolean[static int constants ], int[ae.length] - map to annotated
* object frame, jalview.datamodel.Annotation[],
@@ -2399,7 +2404,7 @@ public class VamsasAppDatastore
* get real bounds of a RangeType's specification. start and end are an
* inclusive range within which all segments and positions lie. TODO: refactor
* to vamsas utils
- *
+ *
* @param dseta
* @return int[] { start, end}
*/
@@ -2457,7 +2462,7 @@ public class VamsasAppDatastore
/**
* map from a rangeType's internal frame to the referenced object's coordinate
* frame.
- *
+ *
* @param dseta
* @return int [] { ref(pos)...} for all pos in rangeType's frame.
*/
@@ -2509,7 +2514,7 @@ public class VamsasAppDatastore
}
/**
- *
+ *
* @param maprange
* where the from range is the local mapped range, and the to range
* is the 'mapped' range in the MapRangeType
@@ -2534,7 +2539,7 @@ public class VamsasAppDatastore
/**
* initialise a range type object from a set of start/end inclusive intervals
- *
+ *
* @param mrt
* @param range
*/
@@ -2551,7 +2556,7 @@ public class VamsasAppDatastore
/**
* initialise a MapType object from a MapList object.
- *
+ *
* @param maprange
* @param ml
* @param setUnits
@@ -2576,12 +2581,12 @@ public class VamsasAppDatastore
* App and Action here. Provenance prov = new Provenance();
* org.exolab.castor.types.Date date = new org.exolab.castor.types.Date( new
* java.util.Date()); Entry provEntry;
- *
+ *
* if (jprov != null) { entries = jprov.getEntries(); for (int i = 0; i <
* entries.length; i++) { provEntry = new Entry(); try { date = new
* org.exolab.castor.types.Date(entries[i].getDate()); } catch (Exception ex)
* { ex.printStackTrace();
- *
+ *
* date = new org.exolab.castor.types.Date(entries[i].getDate()); }
* provEntry.setDate(date); provEntry.setUser(entries[i].getUser());
* provEntry.setAction(entries[i].getAction()); prov.addEntry(provEntry); } }
@@ -2589,7 +2594,7 @@ public class VamsasAppDatastore
* provEntry.setUser(System.getProperty("user.name")); // TODO: ext string
* provEntry.setApp("JVAPP"); // TODO: ext string provEntry.setAction(action);
* prov.addEntry(provEntry); }
- *
+ *
* return prov; }
*/
jalview.datamodel.Provenance getJalviewProvenance(Provenance prov)
@@ -2607,7 +2612,7 @@ public class VamsasAppDatastore
}
/**
- *
+ *
* @return default initial provenance list for a Jalview created vamsas
* object.
*/