X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fio%2FVamsasAppDatastore.java;h=adf44477c8cddd71fceb91740456c88d40bf4b0a;hb=afffa24481a7d3cb65ae41e0948c16a5f490f302;hp=82e9fbabad07e34b57dc342c0a3d5e67cf1245be;hpb=8edb7ea4228bb1c112dbaa4743af9f55755557a4;p=jalview.git
diff --git a/src/jalview/io/VamsasAppDatastore.java b/src/jalview/io/VamsasAppDatastore.java
index 82e9fba..adf4447 100644
--- a/src/jalview/io/VamsasAppDatastore.java
+++ b/src/jalview/io/VamsasAppDatastore.java
@@ -1,56 +1,89 @@
/*
- * Jalview - A Sequence Alignment Editor and Viewer
- * Copyright (C) 2005 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
- *
- * This program 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 2
+ * 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.
- *
- * This program 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.
- *
+ *
+ * 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 this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ * along with Jalview. If not, see .
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
*/
-
package jalview.io;
import jalview.bin.Cache;
+import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.AlignmentView;
-import jalview.datamodel.DBRefEntry;
import jalview.datamodel.GraphLine;
-import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.gui.AlignFrame;
import jalview.gui.AlignViewport;
import jalview.gui.Desktop;
import jalview.gui.TreePanel;
+import jalview.io.vamsas.Datasetsequence;
import jalview.io.vamsas.DatastoreItem;
+import jalview.io.vamsas.DatastoreRegistry;
import jalview.io.vamsas.Rangetype;
+import jalview.project.Jalview2XML;
+import jalview.util.MessageManager;
+import jalview.viewmodel.AlignmentViewport;
+import java.io.IOException;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.IdentityHashMap;
+import java.util.Iterator;
+import java.util.List;
import java.util.Vector;
-
-import uk.ac.vamsas.client.*;
-import uk.ac.vamsas.objects.core.*;
+import java.util.jar.JarInputStream;
+import java.util.jar.JarOutputStream;
+
+import uk.ac.vamsas.client.IClientAppdata;
+import uk.ac.vamsas.client.IClientDocument;
+import uk.ac.vamsas.client.Vobject;
+import uk.ac.vamsas.client.VorbaId;
+import uk.ac.vamsas.objects.core.Alignment;
+import uk.ac.vamsas.objects.core.AlignmentSequence;
+import uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation;
+import uk.ac.vamsas.objects.core.AnnotationElement;
+import uk.ac.vamsas.objects.core.DataSet;
+import uk.ac.vamsas.objects.core.DataSetAnnotations;
+import uk.ac.vamsas.objects.core.DbRef;
+import uk.ac.vamsas.objects.core.Entry;
+import uk.ac.vamsas.objects.core.Glyph;
+import uk.ac.vamsas.objects.core.Local;
+import uk.ac.vamsas.objects.core.MapType;
+import uk.ac.vamsas.objects.core.Mapped;
+import uk.ac.vamsas.objects.core.Property;
+import uk.ac.vamsas.objects.core.Provenance;
+import uk.ac.vamsas.objects.core.RangeAnnotation;
+import uk.ac.vamsas.objects.core.RangeType;
+import uk.ac.vamsas.objects.core.Seg;
+import uk.ac.vamsas.objects.core.Sequence;
+import uk.ac.vamsas.objects.core.SequenceType;
+import uk.ac.vamsas.objects.core.VAMSAS;
+import uk.ac.vamsas.objects.utils.Properties;
/*
- *
+ *
* static {
* org.exolab.castor.util.LocalConfiguration.getInstance().getProperties().setProperty(
* "org.exolab.castor.serializer", "org.apache.xml.serialize.XMLSerilazizer"); }
- *
+ *
+ */
+/*
+ * TODO: check/verify consistency for vamsas sync with group associated alignment annotation
*/
-
public class VamsasAppDatastore
{
/**
@@ -72,14 +105,30 @@ public class VamsasAppDatastore
private static final String THRESHOLD = "threshold";
+ /**
+ * template for provenance entries written to vamsas session document
+ */
Entry provEntry = null;
+ /**
+ * Instance of the session document being synchronized with
+ */
IClientDocument cdoc;
+ /**
+ * map Vorba (vamsas object xml ref) IDs to live jalview object references
+ */
Hashtable vobj2jv;
+ /**
+ * map live jalview object references to Vorba IDs
+ */
IdentityHashMap jv2vobj;
+ /**
+ * map jalview sequence set ID (which is vorba ID for alignment) to last
+ * recorded hash value for the alignment viewport (the undo/redo hash value)
+ */
Hashtable alignRDHash;
public VamsasAppDatastore(IClientDocument cdoc, Hashtable vobj2jv,
@@ -90,6 +139,23 @@ public class VamsasAppDatastore
this.jv2vobj = jv2vobj;
this.provEntry = provEntry;
this.alignRDHash = alignRDHash;
+ buildSkipList();
+ }
+
+ /**
+ * the skipList used to skip over views from Jalview Appdata's that we've
+ * already syncrhonized
+ */
+ Hashtable skipList;
+
+ private void buildSkipList()
+ {
+ skipList = new Hashtable();
+ AlignFrame[] al = Desktop.getAlignFrames();
+ for (int f = 0; al != null && f < al.length; f++)
+ {
+ skipList.put(al[f].getViewport().getSequenceSetId(), al[f]);
+ }
}
/**
@@ -101,10 +167,41 @@ public class VamsasAppDatastore
{
return cdoc.getObject((VorbaId) jv2vobj.get(jvobj));
}
+ // check if we're working with a string - then workaround
+ // the use of IdentityHashTable because different strings
+ // have different object IDs.
+ if (jvobj instanceof String)
+ {
+ Object seqsetidobj = null;
+ seqsetidobj = getVamsasObjectBinding().get(jvobj);
+ if (seqsetidobj != null)
+ {
+ if (seqsetidobj instanceof String)
+ {
+ // what is expected. object returned by av.getSequenceSetId() -
+ // reverse lookup to get the 'registered' instance of this string
+ Vobject obj = getjv2vObj(seqsetidobj);
+ if (obj != null && !(obj instanceof Alignment))
+ {
+ Cache.log.warn(
+ "IMPLEMENTATION ERROR?: Unexpected mapping for unmapped jalview string object content:"
+ + seqsetidobj + " to object " + obj);
+ }
+ return obj;
+ }
+ else
+ {
+ Cache.log.warn("Unexpected mapping for Jalview String Object ID "
+ + seqsetidobj + " to another jalview dataset object "
+ + seqsetidobj);
+ }
+ }
+ }
+
if (Cache.log.isDebugEnabled())
{
- Cache.log.debug("Returning null VorbaID binding for jalview object "
- + jvobj);
+ Cache.log.debug(
+ "Returning null VorbaID binding for jalview object " + jvobj);
}
return null;
}
@@ -120,8 +217,8 @@ public class VamsasAppDatastore
if (id == null)
{
id = cdoc.registerObject(vobj);
- Cache.log
- .debug("Registering new object and returning null for getvObj2jv");
+ Cache.log.debug(
+ "Registering new object and returning null for getvObj2jv");
return null;
}
if (vobj2jv.containsKey(vobj.getVorbaId()))
@@ -142,7 +239,8 @@ public class VamsasAppDatastore
{
Cache.log.error("Failed to get id for "
+ (vobj.isRegisterable() ? "registerable"
- : "unregisterable") + " object " + vobj);
+ : "unregisterable")
+ + " object " + vobj);
}
}
@@ -151,16 +249,17 @@ public class VamsasAppDatastore
{
Cache.log.debug(
"Warning? Overwriting existing vamsas id binding for "
- + vobj.getVorbaId(), new Exception(
- "Overwriting vamsas id binding."));
+ + vobj.getVorbaId(),
+ new Exception(MessageManager.getString(
+ "exception.overwriting_vamsas_id_binding")));
}
else if (jv2vobj.containsKey(jvobj)
&& !((VorbaId) jv2vobj.get(jvobj)).equals(vobj.getVorbaId()))
{
Cache.log.debug(
"Warning? Overwriting existing jalview object binding for "
- + jvobj, new Exception(
- "Overwriting jalview object binding."));
+ + jvobj,
+ new Exception("Overwriting jalview object binding."));
}
/*
* Cache.log.error("Attempt to make conflicting object binding! "+vobj+" id "
@@ -179,32 +278,50 @@ public class VamsasAppDatastore
* put the alignment viewed by AlignViewport into cdoc.
*
* @param av
- * alignViewport to be stored
+ * alignViewport to be stored
* @param aFtitle
- * title for alignment
+ * title for alignment
+ * @return true if alignment associated with viewport was stored/synchronized
+ * to document
*/
- public void storeVAMSAS(AlignViewport av, String aFtitle)
+ public boolean storeVAMSAS(AlignViewport av, String aFtitle)
{
try
{
jalview.datamodel.AlignmentI jal = av.getAlignment();
+ jalview.datamodel.AlignmentI jds = jal.getDataset();
boolean nw = false;
VAMSAS root = null; // will be resolved based on Dataset Parent.
// /////////////////////////////////////////
// SAVE THE DATASET
DataSet dataset = null;
- if (jal.getDataset() == null)
+ if (jds == null)
{
Cache.log.warn("Creating new dataset for an alignment.");
jal.setDataset(null);
+ jds = jal.getDataset();
+ }
+
+ // try and get alignment and association for sequence set id
+
+ Alignment alignment = (Alignment) getjv2vObj(av.getSequenceSetId());
+ if (alignment != null)
+ {
+ dataset = (DataSet) alignment.getV_parent();
+ }
+ else
+ {
+ // is the dataset already registered
+ dataset = (DataSet) getjv2vObj(jds);
}
- dataset = (DataSet) getjv2vObj(jal.getDataset());
+
if (dataset == null)
{
// it might be that one of the dataset sequences does actually have a
- // binding, so search for it indirectly.
- jalview.datamodel.SequenceI[] jdatset = jal.getDataset()
- .getSequencesArray();
+ // binding, so search for it indirectly. If it does, then the local
+ // jalview dataset
+ // must be merged with the existing vamsas dataset.
+ jalview.datamodel.SequenceI[] jdatset = jds.getSequencesArray();
for (int i = 0; i < jdatset.length; i++)
{
Vobject vbound = getjv2vObj(jdatset[i]);
@@ -218,10 +335,11 @@ public class VamsasAppDatastore
}
else
{
- if (dataset != vbound.getV_parent())
+ if (vbound.getV_parent() != null
+ && dataset != vbound.getV_parent())
{
- throw new Error(
- "IMPLEMENTATION ERROR: Cannot map an alignment of sequences from datasets into the vamsas document.");
+ throw new Error(MessageManager.getString(
+ "error.implementation_error_cannot_map_alignment_sequences"));
// This occurs because the dataset for the alignment we are
// trying to
}
@@ -233,11 +351,13 @@ public class VamsasAppDatastore
if (dataset == null)
{
+ Cache.log.warn("Creating new vamsas dataset for alignment view "
+ + av.getSequenceSetId());
// we create a new dataset on the default vamsas root.
root = cdoc.getVamsasRoots()[0]; // default vamsas root for modifying.
dataset = new DataSet();
root.addDataSet(dataset);
- bindjvvobj(jal.getDataset(), dataset);
+ bindjvvobj(jds, dataset);
dataset.setProvenance(dummyProvenance());
// dataset.getProvenance().addEntry(provEntry);
nw = true;
@@ -248,12 +368,12 @@ public class VamsasAppDatastore
}
// update dataset
Sequence sequence;
- DbRef dbref;
// set new dataset and alignment sequences based on alignment Nucleotide
// flag.
// this *will* break when alignment contains both nucleotide and amino
// acid sequences.
- String dict = jal.isNucleotide() ? uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_NA
+ String dict = jal.isNucleotide()
+ ? uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_NA
: uk.ac.vamsas.objects.utils.SymbolDictionary.STANDARD_AA;
Vector dssmods = new Vector();
for (int i = 0; i < jal.getHeight(); i++)
@@ -262,107 +382,14 @@ public class VamsasAppDatastore
// referenced
// sequences
// to dataset.
- sequence = (Sequence) getjv2vObj(sq);
- if (sequence == null)
+ Datasetsequence dssync = new jalview.io.vamsas.Datasetsequence(this,
+ sq, dict, dataset);
+ sequence = (Sequence) dssync.getVobj();
+ if (dssync.getModified())
{
- sequence = new Sequence();
- bindjvvobj(sq, sequence);
- sq.setVamsasId(sequence.getVorbaId().getId());
- sequence.setSequence(sq.getSequenceAsString());
- sequence.setDictionary(dict);
- sequence.setName(sq.getName());
- sequence.setStart(sq.getStart());
- sequence.setEnd(sq.getEnd());
- sequence.setDescription(sq.getDescription());
- dataset.addSequence(sequence);
- dssmods.addElement(dssmods);
- }
- else
- {
- boolean dsmod = false;
- // verify and update principal attributes.
- if (sq.getDescription() != null
- && (sequence.getDescription() == null || !sequence
- .getDescription().equals(sq.getDescription())))
- {
- sequence.setDescription(sq.getDescription());
- dsmod = true;
- }
- if (sequence.getSequence() == null
- || !sequence.getSequence().equals(
- sq.getSequenceAsString()))
- {
- if (sequence.getStart() != sq.getStart()
- || sequence.getEnd() != sq.getEnd())
- {
- // update modified sequence.
- sequence.setSequence(sq.getSequenceAsString());
- sequence.setStart(sq.getStart());
- sequence.setEnd(sq.getEnd());
- dsmod = true;
- }
- }
- if (!dict.equals(sequence.getDictionary()))
- {
- sequence.setDictionary(dict);
- dsmod = true;
- }
- if (!sequence.getName().equals(sq.getName()))
- {
- sequence.setName(sq.getName());
- dsmod = true;
- }
- if (dsmod)
- {
- dssmods.addElement(sequence);
- }
- }
- // add or update any new features/references on dataset sequence
- if (sq.getSequenceFeatures() != null)
- {
- int sfSize = sq.getSequenceFeatures().length;
-
- for (int sf = 0; sf < sfSize; sf++)
- {
- // TODO: update/modifiable synchronizer
- jalview.datamodel.SequenceFeature feature = (jalview.datamodel.SequenceFeature) sq
- .getSequenceFeatures()[sf];
-
- DataSetAnnotations dsa = (DataSetAnnotations) getjv2vObj(feature);
- if (dsa == null)
- {
- dsa = (DataSetAnnotations) getDSAnnotationFromJalview(
- new DataSetAnnotations(), feature);
- if (dsa.getProvenance() == null)
- {
- dsa.setProvenance(new Provenance());
- }
- addProvenance(dsa.getProvenance(), "created"); // JBPNote - need
- // to update
- dsa.addSeqRef(sequence); // we have just created this annotation
- // - so safe to use this
- bindjvvobj(feature, dsa);
- dataset.addDataSetAnnotations(dsa);
- }
- else
- {
- // todo: verify and update dataset annotations for sequence
- System.out.println("update dataset sequence annotations.");
- }
- }
- }
-
- if (sq.getDBRef() != null)
- {
- DBRefEntry[] entries = sq.getDBRef();
- jalview.datamodel.DBRefEntry dbentry;
- for (int db = 0; db < entries.length; db++)
- {
- Rangetype dbr = new jalview.io.vamsas.Dbref(this,
- dbentry = entries[db], sq, sequence);
- }
-
+ dssmods.addElement(sequence);
}
+ ;
}
if (dssmods.size() > 0)
{
@@ -377,24 +404,13 @@ public class VamsasAppDatastore
}
// dataset.setProvenance(getVamsasProvenance(jal.getDataset().getProvenance()));
// ////////////////////////////////////////////
- if (!av.getAlignment().isAligned())
- return; // TODO: trees could be written - but for the moment we just
- // skip
- // ////////////////////////////////////////////
- // Save the Alignments
-
- Alignment alignment = (Alignment) getjv2vObj(av.getSequenceSetId()); // bind
- // to
- // the
- // value
- // used
- // to
- // associate
- // different
- // views
- // to
- // same
- // alignment
+ if (alignmentWillBeSkipped(av))
+ {
+ // TODO: trees could be written - but for the moment we just
+ addToSkipList(av);
+ // add to the JalviewXML skipList and ..
+ return false;
+ }
if (alignment == null)
{
@@ -425,8 +441,8 @@ public class VamsasAppDatastore
else
{
// always prepare to clone the alignment
- boolean alismod = av.isUndoRedoHashModified((long[]) alignRDHash
- .get(av.getSequenceSetId()));
+ boolean alismod = av.isUndoRedoHashModified(
+ (long[]) alignRDHash.get(av.getSequenceSetId()));
// todo: verify and update mutable alignment props.
// TODO: Use isLocked methods
if (alignment.getModifiable() == null
@@ -435,8 +451,8 @@ public class VamsasAppDatastore
{
boolean modified = false;
// check existing sequences in local and in document.
- Vector docseqs = new Vector(alignment
- .getAlignmentSequenceAsReference());
+ Vector docseqs = new Vector(
+ alignment.getAlignmentSequenceAsReference());
for (int i = 0; i < jal.getHeight(); i++)
{
modified |= syncToAlignmentSequence(jal.getSequenceAt(i),
@@ -446,8 +462,8 @@ public class VamsasAppDatastore
{
// removeValignmentSequences(alignment, docseqs);
docseqs.removeAllElements();
- System.out
- .println("Sequence deletion from alignment is not implemented.");
+ System.out.println(
+ "Sequence deletion from alignment is not implemented.");
}
if (modified)
@@ -456,20 +472,20 @@ public class VamsasAppDatastore
{
// info in the undo
addProvenance(alignment.getProvenance(), "Edited"); // TODO:
- // insert
- // something
- // sensible
- // here again
+ // insert
+ // something
+ // sensible
+ // here again
}
else
{
// info in the undo
addProvenance(alignment.getProvenance(), "Attributes Edited"); // TODO:
- // insert
- // something
- // sensible
- // here
- // again
+ // insert
+ // something
+ // sensible
+ // here
+ // again
}
}
if (alismod)
@@ -486,17 +502,18 @@ public class VamsasAppDatastore
// unbind alignment from view.
// create new binding and new alignment.
// mark trail on new alignment as being derived from old ?
- System.out
- .println("update edited alignment to new alignment in document.");
+ System.out.println(
+ "update edited alignment to new alignment in document.");
}
}
// ////////////////////////////////////////////
// SAVE Alignment Sequence Features
- for (int i = 0, iSize = alignment.getAlignmentSequenceCount(); i < iSize; i++)
+ for (int i = 0, iSize = alignment
+ .getAlignmentSequenceCount(); i < iSize; i++)
{
AlignmentSequence valseq;
- SequenceI alseq = (SequenceI) getvObj2jv(valseq = alignment
- .getAlignmentSequence(i));
+ SequenceI alseq = (SequenceI) getvObj2jv(
+ valseq = alignment.getAlignmentSequence(i));
if (alseq != null && alseq.getSequenceFeatures() != null)
{
/*
@@ -507,16 +524,17 @@ public class VamsasAppDatastore
* 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) {
+ * AlignmentSequenceAnnotation) getjv2vObj(features[i]); if (valseqf
+ * == null) {
*
* valseqf = (AlignmentSequenceAnnotation) getDSAnnotationFromJalview(
* new AlignmentSequenceAnnotation(), features[i]);
* valseqf.setGraph(false);
- * valseqf.addProperty(newProperty("jalview:feature","boolean","true"));
- * if (valseqf.getProvenance() == null) { valseqf.setProvenance(new
- * Provenance()); } addProvenance(valseqf.getProvenance(), "created"); //
- * JBPNote - // need to // update bindjvvobj(features[i], valseqf);
+ * valseqf.addProperty(newProperty("jalview:feature"
+ * ,"boolean","true")); if (valseqf.getProvenance() == null) {
+ * valseqf.setProvenance(new Provenance()); }
+ * addProvenance(valseqf.getProvenance(), "created"); // JBPNote - //
+ * need to // update bindjvvobj(features[i], valseqf);
* valseq.addAlignmentSequenceAnnotation(valseqf); } } }
*/
}
@@ -537,6 +555,13 @@ public class VamsasAppDatastore
{
continue;
}
+ if (aa[i].groupRef != null)
+ {
+ // TODO: store any group associated annotation references
+ Cache.log.warn(
+ "Group associated sequence annotation is not stored in VAMSAS document.");
+ continue;
+ }
if (aa[i].sequenceRef != null)
{
// Deal with sequence associated annotation
@@ -549,12 +574,8 @@ public class VamsasAppDatastore
else
{
// first find the alignment sequence to associate this with.
- SequenceI jvalsq = null;
- Enumeration jval = av.getAlignment().getSequences()
- .elements();
- while (jval.hasMoreElements())
+ for (SequenceI jvalsq : av.getAlignment().getSequences())
{
- jvalsq = (SequenceI) jval.nextElement();
// saveDatasetSequenceAnnotation(AlSeqMaps,(uk.ac.vamsas.objects.core.Sequence)
// sref, aa[i]);
if (jvalsq.getDatasetSequence() == aa[i].sequenceRef)
@@ -571,7 +592,8 @@ public class VamsasAppDatastore
else
{
// add Alignment Annotation
- uk.ac.vamsas.objects.core.AlignmentAnnotation an = (uk.ac.vamsas.objects.core.AlignmentAnnotation) getjv2vObj(aa[i]);
+ uk.ac.vamsas.objects.core.AlignmentAnnotation an = (uk.ac.vamsas.objects.core.AlignmentAnnotation) getjv2vObj(
+ aa[i]);
if (an == null)
{
an = new uk.ac.vamsas.objects.core.AlignmentAnnotation();
@@ -620,24 +642,26 @@ public class VamsasAppDatastore
ae = new AnnotationElement();
ae.setDescription(aa[i].annotations[a].description);
ae.addGlyph(new Glyph());
- ae.getGlyph(0).setContent(
- aa[i].annotations[a].displayCharacter); // assume
+ ae.getGlyph(0)
+ .setContent(aa[i].annotations[a].displayCharacter); // assume
// jax-b
// takes
// care
// of
// utf8
// translation
- ae.addValue(aa[i].annotations[a].value);
+ if (an.isGraph())
+ {
+ ae.addValue(aa[i].annotations[a].value);
+ }
ae.setPosition(a + 1);
if (aa[i].annotations[a].secondaryStructure != ' ')
{
Glyph ss = new Glyph();
- ss
- .setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
- ss
- .setContent(String
- .valueOf(aa[i].annotations[a].secondaryStructure));
+ ss.setDict(
+ uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
+ ss.setContent(String.valueOf(
+ aa[i].annotations[a].secondaryStructure));
ae.addGlyph(ss);
}
an.addAnnotationElement(ae);
@@ -657,12 +681,14 @@ public class VamsasAppDatastore
an.setGroup(Integer.toString(aa[i].graphGroup));
if (aa[i].threshold != null && aa[i].threshold.displayed)
{
- an.addProperty(newProperty(THRESHOLD, "float", ""
- + aa[i].threshold.value));
+ an.addProperty(Properties.newProperty(THRESHOLD,
+ Properties.FLOATTYPE,
+ "" + aa[i].threshold.value));
if (aa[i].threshold.label != null)
{
- an.addProperty(newProperty(THRESHOLD + "Name",
- "string", "" + aa[i].threshold.label));
+ an.addProperty(Properties.newProperty(
+ THRESHOLD + "Name", Properties.STRINGTYPE,
+ "" + aa[i].threshold.label));
}
}
}
@@ -675,14 +701,14 @@ public class VamsasAppDatastore
// LOCK METHODS)
{
// verify annotation - update (perhaps)
- Cache.log
- .info("update alignment sequence annotation. not yet implemented.");
+ Cache.log.info(
+ "update alignment sequence annotation. not yet implemented.");
}
else
{
// verify annotation - update (perhaps)
- Cache.log
- .info("updated alignment sequence annotation added.");
+ Cache.log.info(
+ "updated alignment sequence annotation added.");
}
}
}
@@ -705,7 +731,8 @@ public class VamsasAppDatastore
{
TreePanel tp = (TreePanel) frames[t];
- if (tp.getAlignment() == jal)
+ if (tp.getViewPort().getSequenceSetId()
+ .equals(av.getSequenceSetId()))
{
DatastoreItem vtree = new jalview.io.vamsas.Tree(this, tp,
jal, alignment);
@@ -720,8 +747,32 @@ public class VamsasAppDatastore
catch (Exception ex)
{
ex.printStackTrace();
+ return false;
}
+ return true;
+ }
+ /**
+ * 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.
+ */
+ public boolean alignmentWillBeSkipped(AlignmentViewport av)
+ {
+ return (!av.getAlignment().isAligned());
+ }
+
+ private void addToSkipList(AlignmentViewport av)
+ {
+ if (skipList == null)
+ {
+ skipList = new Hashtable();
+ }
+ skipList.put(av.getSequenceSetId(), av);
}
/**
@@ -731,18 +782,19 @@ public class VamsasAppDatastore
* @param alignment
* @param docseqs
*/
- private void removeValignmentSequences(Alignment alignment, Vector docseqs)
+ private void removeValignmentSequences(Alignment alignment,
+ Vector docseqs)
{
// delete these from document. This really needs to be a generic document
// API function derived by CASTOR.
Enumeration en = docseqs.elements();
while (en.hasMoreElements())
{
- alignment.removeAlignmentSequence((AlignmentSequence) en
- .nextElement());
+ alignment.removeAlignmentSequence(
+ (AlignmentSequence) en.nextElement());
}
- Entry pe = addProvenance(alignment.getProvenance(), "Removed "
- + docseqs.size() + " sequences");
+ Entry pe = addProvenance(alignment.getProvenance(),
+ "Removed " + docseqs.size() + " sequences");
en = alignment.enumerateAlignmentAnnotation();
Vector toremove = new Vector();
while (en.hasMoreElements())
@@ -781,8 +833,8 @@ public class VamsasAppDatastore
en = toremove.elements();
while (en.hasMoreElements())
{
- alignment
- .removeAlignmentAnnotation((uk.ac.vamsas.objects.core.AlignmentAnnotation) en
+ alignment.removeAlignmentAnnotation(
+ (uk.ac.vamsas.objects.core.AlignmentAnnotation) en
.nextElement());
}
// TODO: search through alignment annotations to remove any references to
@@ -831,17 +883,16 @@ public class VamsasAppDatastore
modal = true;
alseq.setName(jvalsq.getName());
}
- if (jvalsq.getDescription() != null
- && (alseq.getDescription() == null || !jvalsq.getDescription()
- .equals(alseq.getDescription())))
+ if (jvalsq.getDescription() != null && (alseq.getDescription() == null
+ || !jvalsq.getDescription().equals(alseq.getDescription())))
{
modal = true;
alseq.setDescription(jvalsq.getDescription());
}
if (getjv2vObj(jvalsq.getDatasetSequence()) == null)
{
- Cache.log
- .warn("Serious Implementation error - Unbound dataset sequence in alignment: "
+ Cache.log.warn(
+ "Serious Implementation error - Unbound dataset sequence in alignment: "
+ jvalsq.getDatasetSequence());
}
alseq.setRefid(getjv2vObj(jvalsq.getDatasetSequence()));
@@ -860,7 +911,7 @@ public class VamsasAppDatastore
* creates/syncs the jvalsq from the alignment sequence
*/
private boolean syncFromAlignmentSequence(AlignmentSequence valseq,
- char valGapchar, char gapChar, Vector dsseqs)
+ char valGapchar, char gapChar, List dsseqs)
{
boolean modal = false;
@@ -881,8 +932,8 @@ public class VamsasAppDatastore
|| !valseq.getSequence().equals(alseq.getSequenceAsString()))
{
// this might go *horribly* wrong
- alseq.setSequence(new String(valseq.getSequence()).replace(
- valGapchar, gapChar));
+ alseq.setSequence(new String(valseq.getSequence())
+ .replace(valGapchar, gapChar));
alseq.setStart((int) valseq.getStart());
alseq.setEnd((int) valseq.getEnd());
modal = true;
@@ -892,29 +943,41 @@ public class VamsasAppDatastore
modal = true;
alseq.setName(valseq.getName());
}
- if (alseq.getDescription() == null
- || (valseq.getDescription() == null || alseq.getDescription()
- .equals(valseq.getDescription())))
+ if (alseq.getDescription() == null || (valseq.getDescription() != null
+ && !alseq.getDescription().equals(valseq.getDescription())))
{
alseq.setDescription(valseq.getDescription());
modal = true;
}
if (modal && Cache.log.isDebugEnabled())
{
- Cache.log.debug("Updating apparently edited sequence "
- + alseq.getName());
+ Cache.log.debug(
+ "Updating apparently edited sequence " + alseq.getName());
}
}
else
{
- alseq = new jalview.datamodel.Sequence(valseq.getName(), valseq
- .getSequence().replace(valGapchar, gapChar), (int) valseq
- .getStart(), (int) valseq.getEnd());
+ alseq = new jalview.datamodel.Sequence(valseq.getName(),
+ valseq.getSequence().replace(valGapchar, gapChar),
+ (int) valseq.getStart(), (int) valseq.getEnd());
Vobject datsetseq = (Vobject) valseq.getRefid();
if (datsetseq != null)
{
alseq.setDatasetSequence((SequenceI) getvObj2jv(datsetseq)); // exceptions
+ if (valseq.getDescription() != null)
+ {
+ alseq.setDescription(valseq.getDescription());
+ }
+ else
+ {
+ // inherit description line from dataset.
+ if (alseq.getDatasetSequence().getDescription() != null)
+ {
+ alseq.setDescription(
+ alseq.getDatasetSequence().getDescription());
+ }
+ }
// if
// AlignemntSequence
// reference
@@ -925,8 +988,8 @@ public class VamsasAppDatastore
}
else
{
- Cache.log
- .error("Invalid dataset sequence id (null) for alignment sequence "
+ Cache.log.error(
+ "Invalid dataset sequence id (null) for alignment sequence "
+ valseq.getVorbaId());
}
bindjvvobj(alseq, valseq);
@@ -996,10 +1059,10 @@ public class VamsasAppDatastore
{
// we only write an annotation where it really exists.
Glyph ss = new Glyph();
- ss
- .setDict(uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
- ss.setContent(String
- .valueOf(alan.annotations[a].secondaryStructure));
+ ss.setDict(
+ uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE);
+ ss.setContent(
+ String.valueOf(alan.annotations[a].secondaryStructure));
ae.addGlyph(ss);
}
an.addAnnotationElement(ae);
@@ -1014,7 +1077,8 @@ public class VamsasAppDatastore
// uk.ac.vamsas.
// objects.core.AlignmentSequence alsref = (uk.ac.vamsas.
// objects.core.AlignmentSequence) sref;
- uk.ac.vamsas.objects.core.DataSetAnnotations an = (uk.ac.vamsas.objects.core.DataSetAnnotations) getjv2vObj(alan);
+ uk.ac.vamsas.objects.core.DataSetAnnotations an = (uk.ac.vamsas.objects.core.DataSetAnnotations) getjv2vObj(
+ alan);
int[] gapMap = getGapMap(AlSeqMaps, alan);
if (an == null)
{
@@ -1035,11 +1099,13 @@ public class VamsasAppDatastore
// bits.
if (alan.getThreshold() != null && alan.getThreshold().displayed)
{
- an.addProperty(newProperty(THRESHOLD, "float", ""
- + alan.getThreshold().value));
+ an.addProperty(Properties.newProperty(THRESHOLD,
+ Properties.FLOATTYPE, "" + alan.getThreshold().value));
if (alan.getThreshold().label != null)
- an.addProperty(newProperty(THRESHOLD + "Name", "string", ""
- + alan.getThreshold().label));
+ {
+ an.addProperty(Properties.newProperty(THRESHOLD + "Name",
+ Properties.STRINGTYPE, "" + alan.getThreshold().label));
+ }
}
((DataSet) sref.getV_parent()).addDataSetAnnotations(an);
bindjvvobj(alan, an);
@@ -1056,8 +1122,8 @@ public class VamsasAppDatastore
else
{
// verify existing alignment sequence annotation is up to date
- System.out
- .println("make new alignment dataset sequence annotation if modification has happened.");
+ System.out.println(
+ "make new alignment dataset sequence annotation if modification has happened.");
}
}
@@ -1090,7 +1156,8 @@ public class VamsasAppDatastore
// uk.ac.vamsas.
// objects.core.AlignmentSequence alsref = (uk.ac.vamsas.
// objects.core.AlignmentSequence) sref;
- uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation an = (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) getjv2vObj(alan);
+ uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation an = (uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation) getjv2vObj(
+ alan);
int[] gapMap = getGapMap(AlSeqMaps, alan);
if (an == null)
{
@@ -1124,8 +1191,8 @@ public class VamsasAppDatastore
else
{
// verify existing alignment sequence annotation is up to date
- System.out
- .println("make new alignment sequence annotation if modification has happened.");
+ System.out.println(
+ "make new alignment sequence annotation if modification has happened.");
}
}
}
@@ -1165,86 +1232,25 @@ public class VamsasAppDatastore
switch (alan.graph)
{
case AlignmentAnnotation.BAR_GRAPH:
- an.addProperty(newProperty(DISCRETE_ANNOTATION, "boolean", "true"));
+ an.addProperty(Properties.newProperty(DISCRETE_ANNOTATION,
+ Properties.BOOLEANTYPE, "true"));
break;
case AlignmentAnnotation.LINE_GRAPH:
- an.addProperty(newProperty(CONTINUOUS_ANNOTATION, "boolean", "true"));
+ an.addProperty(Properties.newProperty(CONTINUOUS_ANNOTATION,
+ Properties.BOOLEANTYPE, "true"));
break;
default:
// don't add any kind of discrete or continous property info.
}
}
- private Property newProperty(String name, String type, String content)
- {
- Property vProperty = new Property();
- vProperty.setName(name);
- if (type != null)
- {
- vProperty.setType(type);
- }
- else
- {
- vProperty.setType("String");
- }
- vProperty.setContent(content);
- return vProperty;
- }
-
- /**
- * correctly create a RangeAnnotation from a jalview sequence feature
- *
- * @param dsa
- * (typically DataSetAnnotations or
- * AlignmentSequenceAnnotation)
- * @param feature
- * (the feature to be mapped from)
- * @return
- */
- private RangeAnnotation getDSAnnotationFromJalview(RangeAnnotation dsa,
- SequenceFeature feature)
- {
- dsa.setType(feature.getType());
- Seg vSeg = new Seg();
- vSeg.setStart(feature.getBegin());
- vSeg.setEnd(feature.getEnd());
- vSeg.setInclusive(true);
- dsa.addSeg(vSeg);
- dsa.setDescription(feature.getDescription());
- dsa.setStatus(feature.getStatus());
- if (feature.links != null && feature.links.size() > 0)
- {
- for (int i = 0, iSize = feature.links.size(); i < iSize; i++)
- {
- String link = (String) feature.links.elementAt(i);
- int sep = link.indexOf('|');
- if (sep > -1)
- {
- Link vLink = new Link();
- if (sep > 0)
- {
- vLink.setContent(link.substring(0, sep - 1));
- }
- else
- {
- vLink.setContent("");
- }
- vLink.setHref(link.substring(sep + 1)); // TODO: validate href.
- dsa.addLink(vLink);
- }
- }
- }
- dsa.setGroup(feature.getFeatureGroup());
- return dsa;
- }
-
/**
* get start 1)
+ {
+ // we need to close the original document view.
+
+ // work out how to do this by seeing if the views are gathered.
+ // pretty clunky but the only way to do this without adding more flags
+ // to the align frames.
+ boolean gathered = false;
+ String newviewid = null;
+ List mappings = av.getAlignment()
+ .getCodonFrames();
+ for (int i = 0; i < views.length; i++)
+ {
+ if (views[i] != av)
+ {
+ AlignFrame viewframe = Desktop.getAlignFrameFor(views[i]);
+ if (viewframe == af)
+ {
+ gathered = true;
+ }
+ newviewid = views[i].getSequenceSetId();
+ }
+ else
+ {
+ // lose the reference to the vamsas document created view
+ views[i] = null;
+ }
+ }
+ // close the view generated by the vamsas document synchronization
+ if (gathered)
+ {
+ af.closeView(av);
+ }
+ else
+ {
+ af.closeMenuItem_actionPerformed(false);
+ }
+ replaceJvObjMapping(seqsetidobj, newviewid);
+ seqsetidobj = newviewid;
+ // not sure if we need to do this:
+
+ if (false) // mappings != null)
+ {
+ // ensure sequence mappings from vamsas document view still
+ // active
+ if (mappings != null)
+ {
+ jalview.structure.StructureSelectionManager
+ .getStructureSelectionManager(Desktop.instance)
+ .registerMappings(mappings);
+ }
+ }
+ }
+ // ensure vamsas object binds to the stored views retrieved from
+ // Jalview appdata
+ // jalview.structure.StructureSelectionManager
+ // .getStructureSelectionManager()
+ // .addStructureViewerListener(viewframe.alignPanel);
+
+ }
+
+ newviews = null;
+ newAlignmentViews.clear();
}
- public void updateToJalview()
+ /**
+ * replaces oldjvobject with newjvobject in the Jalview Object <> VorbaID
+ * binding tables
+ *
+ * @param oldjvobject
+ * @param newjvobject
+ * (may be null)
+ */
+ private void replaceJvObjMapping(Object oldjvobject, Object newjvobject)
+ {
+ 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(MessageManager.formatMessage(
+ "error.implementation_error_old_jalview_object_not_bound",
+ new String[]
+ { oldjvobject.toString() }));
+ }
+ if (newjvobject != null)
+ {
+ jv2vobj.put(newjvobject, vobject);
+ vobj2jv.put(vobject, newjvobject);
+ }
+ }
+
+ /**
+ * Update the jalview client and user appdata from the local jalview settings
+ */
+ public void updateJalviewClientAppdata()
+ {
+ final IClientAppdata cappdata = cdoc.getClientAppdata();
+ if (cappdata != null)
+ {
+ try
+ {
+ Jalview2XML jxml = new Jalview2XML();
+ jxml.setObjectMappingTables(mapKeysToString(vobj2jv),
+ mapValuesToString(jv2vobj));
+ jxml.setSkipList(skipList);
+ if (dojvsync)
+ {
+ jxml.saveState(
+ new JarOutputStream(cappdata.getClientOutputStream()));
+ }
+
+ } catch (Exception e)
+ {
+ // TODO raise GUI warning if user requests it.
+ jalview.bin.Cache.log.error(
+ "Couldn't update jalview client application data. Giving up - local settings probably lost.",
+ e);
+ }
+ }
+ else
+ {
+ jalview.bin.Cache.log.error(
+ "Couldn't access client application data for vamsas session. This is probably a vamsas client bug.");
+ }
+ }
+
+ /**
+ * translate the Vobject keys to strings for use in Jalview2XML
+ *
+ * @param jv2vobj2
+ * @return
+ */
+ private IdentityHashMap mapValuesToString(IdentityHashMap jv2vobj2)
+ {
+ IdentityHashMap mapped = new IdentityHashMap();
+ Iterator keys = jv2vobj2.keySet().iterator();
+ while (keys.hasNext())
+ {
+ Object key = keys.next();
+ mapped.put(key, jv2vobj2.get(key).toString());
+ }
+ return mapped;
+ }
+
+ /**
+ * translate the Vobject values to strings for use in Jalview2XML
+ *
+ * @param vobj2jv2
+ * @return hashtable with string values
+ */
+ private Hashtable mapKeysToString(Hashtable vobj2jv2)
+ {
+ Hashtable mapped = new Hashtable();
+ Iterator keys = vobj2jv2.keySet().iterator();
+ while (keys.hasNext())
+ {
+ Object key = keys.next();
+ mapped.put(key.toString(), vobj2jv2.get(key));
+ }
+ return mapped;
+ }
+
+ /**
+ * synchronize Jalview from the vamsas document
+ *
+ * @return number of new views from document
+ */
+ public int updateToJalview()
{
VAMSAS _roots[] = cdoc.getVamsasRoots();
@@ -1321,8 +1613,9 @@ public class VamsasAppDatastore
// ///LOAD DATASET
DataSet dataset = root.getDataSet(_ds);
int i, iSize = dataset.getSequenceCount();
- Vector dsseqs;
- jalview.datamodel.Alignment jdataset = (jalview.datamodel.Alignment) getvObj2jv(dataset);
+ List dsseqs;
+ jalview.datamodel.Alignment jdataset = (jalview.datamodel.Alignment) getvObj2jv(
+ dataset);
int jremain = 0;
if (jdataset == null)
{
@@ -1343,25 +1636,12 @@ public class VamsasAppDatastore
for (i = 0; i < iSize; i++)
{
Sequence vdseq = dataset.getSequence(i);
- jalview.datamodel.SequenceI dsseq = (SequenceI) getvObj2jv(vdseq);
- if (dsseq != null)
- {
- if (!dsseq.getSequenceAsString().equals(vdseq.getSequence()))
- {
- throw new Error(
- "Broken! - mismatch of dataset sequence: and jalview internal dataset sequence.");
- }
- jremain--;
- }
- else
+ jalview.io.vamsas.Datasetsequence dssync = new Datasetsequence(
+ this, vdseq);
+
+ jalview.datamodel.SequenceI dsseq = (SequenceI) dssync.getJvobj();
+ if (dssync.isAddfromdoc())
{
- dsseq = new jalview.datamodel.Sequence(dataset.getSequence(i)
- .getName(), dataset.getSequence(i).getSequence(),
- (int) dataset.getSequence(i).getStart(), (int) dataset
- .getSequence(i).getEnd());
- dsseq.setDescription(dataset.getSequence(i).getDescription());
- bindjvvobj(dsseq, dataset.getSequence(i));
- dsseq.setVamsasId(dataset.getSequence(i).getVorbaId().getId());
dsseqs.add(dsseq);
}
if (vdseq.getDbRefCount() > 0)
@@ -1381,8 +1661,8 @@ public class VamsasAppDatastore
SequenceI[] seqs = new SequenceI[dsseqs.size()];
for (i = 0, iSize = dsseqs.size(); i < iSize; i++)
{
- seqs[i] = (SequenceI) dsseqs.elementAt(i);
- dsseqs.setElementAt(null, i);
+ seqs[i] = dsseqs.get(i);
+ dsseqs.set(i, null);
}
jdataset = new jalview.datamodel.Alignment(seqs);
Cache.log.debug("New vamsas dataset imported into jalview.");
@@ -1392,34 +1672,32 @@ public class VamsasAppDatastore
// add any new dataset sequence feature annotations
if (dataset.getDataSetAnnotations() != null)
{
- for (int dsa = 0; dsa < dataset.getDataSetAnnotationsCount(); dsa++)
+ for (int dsa = 0; dsa < dataset
+ .getDataSetAnnotationsCount(); dsa++)
{
DataSetAnnotations dseta = dataset.getDataSetAnnotations(dsa);
// TODO: deal with group annotation on datset sequences.
if (dseta.getSeqRefCount() == 1)
{
- SequenceI dsSeq = (SequenceI) getvObj2jv((Vobject) dseta
- .getSeqRef(0)); // TODO: deal with group dataset
+ SequenceI dsSeq = (SequenceI) getvObj2jv(
+ (Vobject) dseta.getSeqRef(0)); // TODO: deal with group
+ // dataset
// annotations
if (dsSeq == null)
{
- jalview.bin.Cache.log
- .warn("Couldn't resolve jalview sequenceI for dataset object reference "
- + ((Vobject) dataset.getDataSetAnnotations(
- dsa).getSeqRef(0)).getVorbaId()
- .getId());
+ jalview.bin.Cache.log.warn(
+ "Couldn't resolve jalview sequenceI for dataset object reference "
+ + ((Vobject) dataset
+ .getDataSetAnnotations(dsa)
+ .getSeqRef(0)).getVorbaId()
+ .getId());
}
else
{
if (dseta.getAnnotationElementCount() == 0)
{
- jalview.datamodel.SequenceFeature sf = (jalview.datamodel.SequenceFeature) getvObj2jv(dseta);
- if (sf == null)
- {
- dsSeq
- .addSequenceFeature(sf = getJalviewSeqFeature(dseta));
- bindjvvobj(sf, dseta);
- }
+ new jalview.io.vamsas.Sequencefeature(this, dseta, dsSeq);
+
}
else
{
@@ -1428,30 +1706,40 @@ public class VamsasAppDatastore
// JBPNote: we could just add them to all alignments but
// that may complicate cross references in the jalview
// datamodel
- Cache.log
- .warn("Ignoring dataset annotation with annotationElements. Not yet supported in jalview.");
+ Cache.log.warn(
+ "Ignoring dataset annotation with annotationElements. Not yet supported in jalview.");
}
}
}
+ else
+ {
+ Cache.log.warn(
+ "Ignoring multiply referenced dataset sequence annotation for binding to datsaet sequence features.");
+ }
}
}
if (dataset.getAlignmentCount() > 0)
{
// LOAD ALIGNMENTS from DATASET
- for (int al = 0, nal = dataset.getAlignmentCount(); al < nal; al++)
+ for (int al = 0, nal = dataset
+ .getAlignmentCount(); al < nal; al++)
{
uk.ac.vamsas.objects.core.Alignment alignment = dataset
.getAlignment(al);
- AlignViewport av = findViewport(alignment);
+ // TODO check this handles multiple views properly
+ AlignmentViewport av = findViewport(alignment);
jalview.datamodel.AlignmentI jal = null;
if (av != null)
{
- jal = av.getAlignment();
+ // TODO check that correct alignment object is retrieved when
+ // hidden seqs exist.
+ jal = (av.hasHiddenRows()) ? av.getAlignment()
+ .getHiddenSequences().getFullAlignment()
+ : av.getAlignment();
}
iSize = alignment.getAlignmentSequenceCount();
- boolean newal = (jal == null) ? true : false;
boolean refreshal = false;
Vector newasAnnots = new Vector();
char gapChar = ' '; // default for new alignments read in from the
@@ -1469,10 +1757,10 @@ public class VamsasAppDatastore
for (i = 0; i < iSize; i++)
{
AlignmentSequence valseq = alignment.getAlignmentSequence(i);
- jalview.datamodel.Sequence alseq = (jalview.datamodel.Sequence) getvObj2jv(valseq);
+ jalview.datamodel.Sequence alseq = (jalview.datamodel.Sequence) getvObj2jv(
+ valseq);
if (syncFromAlignmentSequence(valseq, valGapchar, gapChar,
- dsseqs)
- && alseq != null)
+ dsseqs) && alseq != null)
{
// updated to sequence from the document
@@ -1485,7 +1773,8 @@ public class VamsasAppDatastore
.getAlignmentSequenceAnnotation();
for (int a = 0; a < vasannot.length; a++)
{
- jalview.datamodel.AlignmentAnnotation asa = (jalview.datamodel.AlignmentAnnotation) getvObj2jv(vasannot[a]); // TODO:
+ jalview.datamodel.AlignmentAnnotation asa = (jalview.datamodel.AlignmentAnnotation) getvObj2jv(
+ vasannot[a]); // TODO:
// 1:many
// jalview
// alignment
@@ -1509,6 +1798,7 @@ public class VamsasAppDatastore
// positions.
alseq.addAlignmentAnnotation(asa);
bindjvvobj(asa, vasannot[a]);
+ refreshal = true;
newasAnnots.add(asa);
}
else
@@ -1519,8 +1809,8 @@ public class VamsasAppDatastore
// OBJECT LOCK
// METHODS)
{
- Cache.log
- .info("UNIMPLEMENTED: not recovering user modifiable sequence alignment annotation");
+ Cache.log.info(
+ "UNIMPLEMENTED: not recovering user modifiable sequence alignment annotation");
// TODO: should at least replace with new one - otherwise
// things will break
// basically do this:
@@ -1539,8 +1829,8 @@ public class VamsasAppDatastore
SequenceI[] seqs = new SequenceI[dsseqs.size()];
for (i = 0, iSize = dsseqs.size(); i < iSize; i++)
{
- seqs[i] = (SequenceI) dsseqs.elementAt(i);
- dsseqs.setElementAt(null, i);
+ seqs[i] = dsseqs.get(i);
+ dsseqs.set(i, null);
}
jal = new jalview.datamodel.Alignment(seqs);
Cache.log.debug("New vamsas alignment imported into jalview "
@@ -1550,10 +1840,11 @@ public class VamsasAppDatastore
if (newasAnnots != null && newasAnnots.size() > 0)
{
// Add the new sequence annotations in to the alignment.
- for (int an = 0, anSize = newasAnnots.size(); an < anSize; an++)
+ for (int an = 0, anSize = newasAnnots
+ .size(); an < anSize; an++)
{
- jal.addAnnotation((AlignmentAnnotation) newasAnnots
- .elementAt(an));
+ jal.addAnnotation(
+ (AlignmentAnnotation) newasAnnots.elementAt(an));
// TODO: check if anything has to be done - like calling
// adjustForAlignment or something.
newasAnnots.setElementAt(null, an);
@@ -1570,7 +1861,8 @@ public class VamsasAppDatastore
for (int j = 0; j < an.length; j++)
{
- jalview.datamodel.AlignmentAnnotation jan = (jalview.datamodel.AlignmentAnnotation) getvObj2jv(an[j]);
+ jalview.datamodel.AlignmentAnnotation jan = (jalview.datamodel.AlignmentAnnotation) getvObj2jv(
+ an[j]);
if (jan != null)
{
// update or stay the same.
@@ -1580,16 +1872,16 @@ public class VamsasAppDatastore
// jan.update(getjAlignmentAnnotation(jal, an[a])); // update
// from another annotation object in place.
- Cache.log
- .debug("update from vamsas alignment annotation to existing jalview alignment annotation.");
+ Cache.log.debug(
+ "update from vamsas alignment annotation to existing jalview alignment annotation.");
if (an[j].getModifiable() == null) // TODO: USE VAMSAS
// LIBRARY OBJECT LOCK
// METHODS)
{
// TODO: user defined annotation is totally mutable... - so
// load it up or throw away if locally edited.
- Cache.log
- .info("NOT IMPLEMENTED - Recovering user-modifiable annotation - yet...");
+ Cache.log.info(
+ "NOT IMPLEMENTED - Recovering user-modifiable annotation - yet...");
}
// TODO: compare annotation element rows
// TODO: compare props.
@@ -1597,8 +1889,11 @@ public class VamsasAppDatastore
else
{
jan = getjAlignmentAnnotation(jal, an[j]);
+ // TODO: ensure we add the alignment annotation before the
+ // automatic annotation rows
jal.addAnnotation(jan);
bindjvvobj(jan, an[j]);
+ refreshal = true;
}
}
}
@@ -1610,14 +1905,18 @@ public class VamsasAppDatastore
// ///////////////////////////////
// construct alignment view
alignFrame = new AlignFrame(jal, AlignFrame.DEFAULT_WIDTH,
- AlignFrame.DEFAULT_HEIGHT);
+ AlignFrame.DEFAULT_HEIGHT,
+ alignment.getVorbaId().toString());
av = alignFrame.getViewport();
- String title = alignment.getProvenance().getEntry(
- alignment.getProvenance().getEntryCount() - 1)
+ newAlignmentViews.addElement(av);
+ String title = alignment.getProvenance()
+ .getEntry(
+ alignment.getProvenance().getEntryCount() - 1)
.getAction();
if (alignment.getPropertyCount() > 0)
{
- for (int p = 0, pe = alignment.getPropertyCount(); p < pe; p++)
+ for (int p = 0, pe = alignment
+ .getPropertyCount(); p < pe; p++)
{
if (alignment.getProperty(p).getName().equals("title"))
{
@@ -1640,11 +1939,13 @@ public class VamsasAppDatastore
{
// find the alignFrame for jal.
// TODO: fix this so we retrieve the alignFrame handing av
- // *directly*
- alignFrame = getAlignFrameFor(av);
+ // *directly* (JBPNote - don't understand this now)
+ // TODO: make sure all associated views are refreshed
+ alignFrame = Desktop.getAlignFrameFor(av);
if (refreshal)
{
av.alignmentChanged(alignFrame.alignPanel);
+ alignFrame.alignPanel.adjustAnnotationHeight();
}
}
// LOAD TREES
@@ -1659,7 +1960,7 @@ public class VamsasAppDatastore
TreePanel tp = null;
if (vstree.isValidTree())
{
- tp = alignFrame.ShowNewickTree(vstree.getNewickTree(),
+ tp = alignFrame.showNewickTree(vstree.getNewickTree(),
vstree.getTitle(), vstree.getInputData(), 600,
500, t * 20 + 50, t * 20 + 50);
@@ -1694,7 +1995,8 @@ public class VamsasAppDatastore
DataSet dataset = root.getDataSet(_ds);
if (dataset.getSequenceMappingCount() > 0)
{
- for (int sm = 0, smCount = dataset.getSequenceMappingCount(); sm < smCount; sm++)
+ for (int sm = 0, smCount = dataset
+ .getSequenceMappingCount(); sm < smCount; sm++)
{
Rangetype seqmap = new jalview.io.vamsas.Sequencemapping(this,
dataset.getSequenceMapping(sm));
@@ -1702,12 +2004,14 @@ public class VamsasAppDatastore
}
}
}
+ return newAlignmentViews.size();
}
- public AlignViewport findViewport(Alignment alignment)
+ public AlignmentViewport findViewport(Alignment alignment)
{
- AlignViewport av = null;
- AlignViewport[] avs = findViewportForSequenceSetId((String) getvObj2jv(alignment));
+ AlignmentViewport av = null;
+ AlignmentViewport[] avs = Desktop
+ .getViewports((String) getvObj2jv(alignment));
if (avs != null)
{
av = avs[0];
@@ -1715,34 +2019,6 @@ public class VamsasAppDatastore
return av;
}
- private AlignViewport[] findViewportForSequenceSetId(String sequenceSetId)
- {
- Vector viewp = new Vector();
- if (Desktop.desktop != null)
- {
- javax.swing.JInternalFrame[] frames = Desktop.instance.getAllFrames();
-
- for (int t = 0; t < frames.length; t++)
- {
- if (frames[t] instanceof AlignFrame)
- {
- if (((AlignFrame) frames[t]).getViewport().getSequenceSetId()
- .equals(sequenceSetId))
- {
- viewp.addElement(((AlignFrame) frames[t]).getViewport());
- }
- }
- }
- if (viewp.size() > 0)
- {
- AlignViewport[] vp = new AlignViewport[viewp.size()];
- viewp.copyInto(vp);
- return vp;
- }
- }
- return null;
- }
-
// bitfields - should be a template in j1.5
private static int HASSECSTR = 0;
@@ -1777,11 +2053,11 @@ public class VamsasAppDatastore
// may not quite cope with this (without binding an array of annotations to
// a vamsas alignment annotation)
// summary flags saying what we found over the set of annotation rows.
- boolean[] AeContent = new boolean[]
- { false, false, false, false, false };
+ boolean[] AeContent = new boolean[] { false, false, false, false,
+ false };
int[] rangeMap = getMapping(annotation);
- jalview.datamodel.Annotation[][] anot = new jalview.datamodel.Annotation[][]
- { new jalview.datamodel.Annotation[rangeMap.length],
+ jalview.datamodel.Annotation[][] anot = new jalview.datamodel.Annotation[][] {
+ new jalview.datamodel.Annotation[rangeMap.length],
new jalview.datamodel.Annotation[rangeMap.length] };
boolean mergeable = true; // false if 'after positions cant be placed on
// same annotation row as positions.
@@ -1826,18 +2102,14 @@ public class VamsasAppDatastore
Glyph[] glyphs = ae[aa].getGlyph();
for (int g = 0; g < glyphs.length; g++)
{
- if (glyphs[g]
- .getDict()
- .equals(
- uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE))
+ if (glyphs[g].getDict().equals(
+ uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_SS_3STATE))
{
ss = glyphs[g].getContent();
AeContent[HASSECSTR] = true;
}
- else if (glyphs[g]
- .getDict()
- .equals(
- uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO))
+ else if (glyphs[g].getDict().equals(
+ uk.ac.vamsas.objects.utils.GlyphDictionary.PROTEIN_HD_HYDRO))
{
Cache.log.debug("ignoring hydrophobicity glyph marker.");
AeContent[HASHPHOB] = true;
@@ -1855,8 +2127,8 @@ public class VamsasAppDatastore
}
else
{
- Cache.log
- .debug("IMPLEMENTATION TODO: Ignoring unknown glyph type "
+ Cache.log.debug(
+ "IMPLEMENTATION TODO: Ignoring unknown glyph type "
+ glyphs[g].getDict());
}
}
@@ -1867,23 +2139,23 @@ public class VamsasAppDatastore
AeContent[HASVALS] = true;
if (ae[aa].getValueCount() > 1)
{
- Cache.log.warn("ignoring additional "
- + (ae[aa].getValueCount() - 1)
- + "values in annotation element.");
+ Cache.log.warn(
+ "ignoring additional " + (ae[aa].getValueCount() - 1)
+ + " values in annotation element.");
}
val = ae[aa].getValue(0);
}
if (colour == null)
{
anot[row][pos] = new jalview.datamodel.Annotation(
- (dc != null) ? dc : "", desc, (ss != null) ? ss
- .charAt(0) : ' ', val);
+ (dc != null) ? dc : "", desc,
+ (ss != null) ? ss.charAt(0) : ' ', val);
}
else
{
anot[row][pos] = new jalview.datamodel.Annotation(
- (dc != null) ? dc : "", desc, (ss != null) ? ss
- .charAt(0) : ' ', val, colour);
+ (dc != null) ? dc : "", desc,
+ (ss != null) ? ss.charAt(0) : ' ', val, colour);
}
}
else
@@ -1915,24 +2187,21 @@ public class VamsasAppDatastore
anot[1][i].description = anot[1][i].description + " (after)";
}
}
- return new Object[]
- { AeContent, rangeMap, anot[0], anot[1] };
+ return new Object[] { AeContent, rangeMap, anot[0], anot[1] };
}
else
{
// no annotations to parse. Just return an empty annotationElement[]
// array.
- return new Object[]
- { AeContent, rangeMap, anot[0], anot[1] };
+ return new Object[] { AeContent, rangeMap, anot[0], anot[1] };
}
// return null;
}
/**
* @param jal
- * the jalview alignment to which the annotation will be
- * attached (ideally - freshly updated from corresponding
- * vamsas alignment)
+ * the jalview alignment to which the annotation will be attached
+ * (ideally - freshly updated from corresponding vamsas alignment)
* @param annotation
* @return unbound jalview alignment annotation object.
*/
@@ -1985,19 +2254,24 @@ public class VamsasAppDatastore
Cache.log.warn("Failed to parse threshold property");
}
if (val != null)
+ {
if (gl == null)
{
- gl = new GraphLine(val.floatValue(), "", java.awt.Color.black);
+ gl = new GraphLine(val.floatValue(), "",
+ java.awt.Color.black);
}
else
{
gl.value = val.floatValue();
}
+ }
}
else if (props[p].getName().equalsIgnoreCase(THRESHOLD + "Name"))
{
if (gl == null)
+ {
gl = new GraphLine(0, "", java.awt.Color.black);
+ }
gl.label = props[p].getContent();
}
}
@@ -2017,8 +2291,8 @@ public class VamsasAppDatastore
}
if (parsedRangeAnnotation == null)
{
- Cache.log
- .debug("Inserting empty annotation row elements for a whole-alignment annotation.");
+ Cache.log.debug(
+ "Inserting empty annotation row elements for a whole-alignment annotation.");
}
else
{
@@ -2033,20 +2307,21 @@ public class VamsasAppDatastore
// way its 'odd' - there is already an existing TODO about removing this
// flag as being redundant
/*
- * if
- * ((annotation.getClass().equals(uk.ac.vamsas.objects.core.AlignmentAnnotation.class) &&
- * ((uk.ac.vamsas.objects.core.AlignmentAnnotation)annotation).getGraph()) ||
- * (hasSequenceRef=true &&
- * ((uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation)annotation).getGraph())) {
+ * if((annotation.getClass().equals(uk.ac.vamsas.objects.core.
+ * AlignmentAnnotation.class) &&
+ * ((uk.ac.vamsas.objects.core.AlignmentAnnotation)annotation).getGraph())
+ * || (hasSequenceRef=true &&
+ * ((uk.ac.vamsas.objects.core.AlignmentSequenceAnnotation
+ * )annotation).getGraph())) {
*/
if (has[HASVALS])
{
if (type == 0)
{
type = jalview.datamodel.AlignmentAnnotation.BAR_GRAPH; // default
- // type of
- // value
- // annotation
+ // type of
+ // value
+ // annotation
if (has[HASHPHOB])
{
// no hints - so we ensure HPHOB display is like this.
@@ -2111,7 +2386,8 @@ public class VamsasAppDatastore
&& arow[i].description.length() < 3)
{
// copy over the description as the display char.
- arow[i].displayCharacter = new String(arow[i].description);
+ arow[i].displayCharacter = new String(
+ arow[i].description);
}
}
else
@@ -2137,6 +2413,8 @@ public class VamsasAppDatastore
jan = new jalview.datamodel.AlignmentAnnotation(a_label, a_descr,
arow);
jan.setThreshold(null);
+ jan.annotationId = annotation.getVorbaId().toString(); // keep all the
+ // ids together.
}
if (annotation.getLinkCount() > 0)
{
@@ -2145,7 +2423,7 @@ public class VamsasAppDatastore
}
if (annotation.getModifiable() == null
|| annotation.getModifiable().length() == 0) // TODO: USE VAMSAS
- // LIBRARY OBJECT
+ // LIBRARY OBJECT
// LOCK METHODS)
{
jan.editable = true;
@@ -2156,17 +2434,17 @@ public class VamsasAppDatastore
&& annotation.getGroup().length() > 0)
{
jan.graphGroup = Integer.parseInt(annotation.getGroup()); // TODO:
- // group
- // similarly
- // named
- // annotation
- // together
- // ?
+ // group
+ // similarly
+ // named
+ // annotation
+ // together
+ // ?
}
} catch (Exception e)
{
- Cache.log
- .info("UNIMPLEMENTED : Couldn't parse non-integer group value for setting graphGroup correctly.");
+ Cache.log.info(
+ "UNIMPLEMENTED : Couldn't parse non-integer group value for setting graphGroup correctly.");
}
return jan;
@@ -2175,23 +2453,6 @@ public class VamsasAppDatastore
return null;
}
- private SequenceFeature getJalviewSeqFeature(RangeAnnotation dseta)
- {
- int[] se = getBounds(dseta);
- SequenceFeature sf = new jalview.datamodel.SequenceFeature(dseta
- .getType(), dseta.getDescription(), dseta.getStatus(), se[0],
- se[1], dseta.getGroup());
- if (dseta.getLinkCount() > 0)
- {
- Link[] links = dseta.getLink();
- for (int i = 0; i < links.length; i++)
- {
- sf.addLink(links[i].getContent() + "|" + links[i].getHref());
- }
- }
- return sf;
- }
-
/**
* get real bounds of a RangeType's specification. start and end are an
* inclusive range within which all segments and positions lie. TODO: refactor
@@ -2207,8 +2468,8 @@ public class VamsasAppDatastore
int[] se = null;
if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0)
{
- throw new Error(
- "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
+ throw new Error(MessageManager.getString(
+ "error.invalid_vamsas_rangetype_cannot_resolve_lists"));
}
if (dseta.getSegCount() > 0)
{
@@ -2231,8 +2492,7 @@ public class VamsasAppDatastore
// could do a polarity for pos range too. and pass back indication of
// discontinuities.
int pos = dseta.getPos(0).getI();
- se = new int[]
- { pos, pos };
+ se = new int[] { pos, pos };
for (int p = 0, pSize = dseta.getPosCount(); p < pSize; p++)
{
pos = dseta.getPos(p).getI();
@@ -2266,8 +2526,8 @@ public class VamsasAppDatastore
int[] se = null;
if (dseta.getSegCount() > 0 && dseta.getPosCount() > 0)
{
- throw new Error(
- "Invalid vamsas RangeType - cannot resolve both lists of Pos and Seg from choice!");
+ throw new Error(MessageManager.getString(
+ "error.invalid_vamsas_rangetype_cannot_resolve_lists"));
}
if (dseta.getSegCount() > 0)
{
@@ -2308,12 +2568,12 @@ 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
+ * where the from range is the local mapped range, and the to range
+ * is the 'mapped' range in the MapRangeType
* @param default
- * unit for local
+ * unit for local
* @param default
- * unit for mapped
+ * unit for mapped
* @return MapList
*/
private jalview.util.MapList parsemapType(MapType maprange, int localu,
@@ -2324,8 +2584,9 @@ public class VamsasAppDatastore
int[] mappedRange = getMapping(maprange.getMapped());
long lu = maprange.getLocal().hasUnit() ? maprange.getLocal().getUnit()
: localu;
- long mu = maprange.getMapped().hasUnit() ? maprange.getMapped()
- .getUnit() : mappedu;
+ long mu = maprange.getMapped().hasUnit()
+ ? maprange.getMapped().getUnit()
+ : mappedu;
ml = new jalview.util.MapList(localRange, mappedRange, (int) lu,
(int) mu);
return ml;
@@ -2335,15 +2596,15 @@ public class VamsasAppDatastore
* initialise a range type object from a set of start/end inclusive intervals
*
* @param mrt
- * @param range
+ * @param ranges
*/
- private void initRangeType(RangeType mrt, int[] range)
+ private void initRangeType(RangeType mrt, List ranges)
{
- for (int i = 0; i < range.length; i += 2)
+ for (int[] range : ranges)
{
Seg vSeg = new Seg();
- vSeg.setStart(range[i]);
- vSeg.setEnd(range[i + 1]);
+ vSeg.setStart(range[0]);
+ vSeg.setEnd(range[1]);
mrt.addSeg(vSeg);
}
}
@@ -2378,8 +2639,8 @@ public class VamsasAppDatastore
*
* 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();
+ * 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());
@@ -2397,9 +2658,9 @@ public class VamsasAppDatastore
jalview.datamodel.Provenance jprov = new jalview.datamodel.Provenance();
for (int i = 0; i < prov.getEntryCount(); i++)
{
- jprov.addEntry(prov.getEntry(i).getUser(), prov.getEntry(i)
- .getAction(), prov.getEntry(i).getDate(), prov.getEntry(i)
- .getId());
+ jprov.addEntry(prov.getEntry(i).getUser(),
+ prov.getEntry(i).getAction(), prov.getEntry(i).getDate(),
+ prov.getEntry(i).getId());
}
return jprov;
@@ -2466,10 +2727,10 @@ public class VamsasAppDatastore
return vobj2jv;
}
- public void storeSequenceMappings(AlignViewport viewport, String title)
- throws Exception
+ public void storeSequenceMappings(AlignmentViewport viewport,
+ String title) throws Exception
{
- AlignViewport av = viewport;
+ AlignmentViewport av = viewport;
try
{
jalview.datamodel.AlignmentI jal = av.getAlignment();
@@ -2481,33 +2742,39 @@ public class VamsasAppDatastore
Cache.log.warn("Creating new dataset for an alignment.");
jal.setDataset(null);
}
- dataset = (DataSet) getjv2vObj(jal.getDataset());
+ dataset = (DataSet) ((Alignment) getjv2vObj(
+ viewport.getSequenceSetId())).getV_parent(); // jal.getDataset());
+ if (dataset == null)
+ {
+ dataset = (DataSet) getjv2vObj(jal.getDataset());
+ Cache.log.error(
+ "Can't find the correct dataset for the alignment in this view. Creating new one.");
+
+ }
// Store any sequence mappings.
- if (av.getAlignment().getCodonFrames() != null
- && av.getAlignment().getCodonFrames().length > 0)
+ List cframes = av.getAlignment().getCodonFrames();
+ if (cframes != null)
{
- jalview.datamodel.AlignedCodonFrame[] cframes = av.getAlignment()
- .getCodonFrames();
- for (int cf = 0; cf < cframes.length; cf++)
+ for (AlignedCodonFrame acf : cframes)
{
- if (cframes[cf].getdnaSeqs().length > 0)
+ if (acf.getdnaSeqs() != null && acf.getdnaSeqs().length > 0)
{
- jalview.datamodel.SequenceI[] dmps = cframes[cf].getdnaSeqs();
- jalview.datamodel.Mapping[] mps = cframes[cf].getProtMappings();
+ jalview.datamodel.SequenceI[] dmps = acf.getdnaSeqs();
+ jalview.datamodel.Mapping[] mps = acf.getProtMappings();
for (int smp = 0; smp < mps.length; smp++)
{
- uk.ac.vamsas.objects.core.SequenceType mfrom = (SequenceType) getjv2vObj(dmps[smp]);
+ uk.ac.vamsas.objects.core.SequenceType mfrom = (SequenceType) getjv2vObj(
+ dmps[smp]);
if (mfrom != null)
{
- new jalview.io.vamsas.Sequencemapping(this, mps[smp],
- mfrom, dataset);
+ new jalview.io.vamsas.Sequencemapping(this, mps[smp], mfrom,
+ dataset);
}
else
{
- Cache.log
- .warn("NO Vamsas Binding for local sequence! NOT CREATING MAPPING FOR "
- + dmps[smp].getDisplayId(true)
- + " to "
+ Cache.log.warn(
+ "NO Vamsas Binding for local sequence! NOT CREATING MAPPING FOR "
+ + dmps[smp].getDisplayId(true) + " to "
+ mps[smp].getTo().getName());
}
}
@@ -2516,8 +2783,48 @@ public class VamsasAppDatastore
}
} catch (Exception e)
{
- throw new Exception("Couldn't store sequence mappings for " + title,
- e);
+ throw new Exception(MessageManager.formatMessage(
+ "exception.couldnt_store_sequence_mappings", new String[]
+ { title }), e);
+ }
+ }
+
+ public void clearSkipList()
+ {
+ if (skipList != null)
+ {
+ skipList.clear();
+ }
+ }
+
+ /**
+ * @return the skipList
+ */
+ public Hashtable getSkipList()
+ {
+ return skipList;
+ }
+
+ /**
+ * @param skipList
+ * the skipList to set
+ */
+ public void setSkipList(Hashtable skipList)
+ {
+ this.skipList = skipList;
+ }
+
+ /**
+ * registry for datastoreItems
+ */
+ DatastoreRegistry dsReg = new DatastoreRegistry();
+
+ public DatastoreRegistry getDatastoreRegisty()
+ {
+ if (dsReg == null)
+ {
+ dsReg = new DatastoreRegistry();
}
+ return dsReg;
}
}