X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2Fvamsas%2FSequencefeature.java;h=31d64f594253b01e44229225276356521a6a17e2;hb=065e78a9a486362e2dd3ab8b64b8fd5111d4c656;hp=6e93f45ad7c190299033ad7fb9000539d6953d7b;hpb=4d7f98a6dd54d9863ba449ec79dcd95d25ed863d;p=jalview.git diff --git a/src/jalview/io/vamsas/Sequencefeature.java b/src/jalview/io/vamsas/Sequencefeature.java index 6e93f45..31d64f5 100644 --- a/src/jalview/io/vamsas/Sequencefeature.java +++ b/src/jalview/io/vamsas/Sequencefeature.java @@ -27,6 +27,7 @@ import jalview.io.VamsasAppDatastore; import jalview.util.UrlLink; import java.util.Enumeration; +import java.util.Iterator; import java.util.Vector; import uk.ac.vamsas.objects.core.DataSetAnnotations; @@ -71,6 +72,7 @@ public class Sequencefeature extends Rangetype doJvUpdate(); } + @Override public void addToDocument() { DataSetAnnotations dsa = (DataSetAnnotations) vobj; @@ -89,15 +91,14 @@ public class Sequencefeature extends Rangetype dataset.addDataSetAnnotations(dsa); } + @Override public void addFromDocument() { DataSetAnnotations dsa = (DataSetAnnotations) vobj; if (dsa.getSeqRefCount() != 1) { - Cache.log - .warn("Not binding " - + dsa.getVorbaId() - + " to Sequence Feature - has multiple dataset sequence references."); + Cache.log.warn("Not binding " + dsa.getVorbaId() + + " to Sequence Feature - has multiple dataset sequence references."); return; } jalview.datamodel.SequenceFeature sf = (jalview.datamodel.SequenceFeature) jvobj; @@ -106,6 +107,7 @@ public class Sequencefeature extends Rangetype bindjvvobj(sf, dsa); } + @Override public void conflict() { log.warn("Untested sequencefeature conflict code"); @@ -118,6 +120,7 @@ public class Sequencefeature extends Rangetype addToDocument(); // and create a new feature in the document } + @Override public void updateToDoc() { DataSetAnnotations dsa = (DataSetAnnotations) vobj; @@ -125,8 +128,8 @@ public class Sequencefeature extends Rangetype if (dsa.getSeqRefCount() != 1) { replaceJvObjMapping(feature, null); - Cache.log - .warn("Binding of annotation to jalview feature has changed. Removing binding and recreating."); + Cache.log.warn( + "Binding of annotation to jalview feature has changed. Removing binding and recreating."); doSync(); // re-verify bindings. } else @@ -144,6 +147,7 @@ public class Sequencefeature extends Rangetype } + @Override public void updateFromDoc() { DataSetAnnotations dsa = (DataSetAnnotations) vobj; @@ -152,10 +156,8 @@ public class Sequencefeature extends Rangetype { // conflicting update from document - we cannot map this feature anymore. replaceJvObjMapping(feature, null); - Cache.log - .warn("annotation (" - + dsa.getVorbaId() - + " bound to jalview feature cannot be mapped. Removing binding, deleting feature, and deleting feature."); + Cache.log.warn("annotation (" + dsa.getVorbaId() + + " bound to jalview feature cannot be mapped. Removing binding, deleting feature, and deleting feature."); // - consider deleting the feature ? dsSeq.deleteFeature(feature); // doSync(); @@ -196,8 +198,8 @@ public class Sequencefeature extends Rangetype vSeg.setInclusive(true); if (dsa.getSegCount() > 1) { - Cache.log - .debug("About to destroy complex annotation in vamsas document mapped to sequence feature (" + Cache.log.debug( + "About to destroy complex annotation in vamsas document mapped to sequence feature (" + dsa.getVorbaId() + ")"); } dsa.setSeg(new Seg[] { vSeg }); @@ -229,11 +231,11 @@ public class Sequencefeature extends Rangetype } if (feature.otherDetails != null) { - Enumeration iter = feature.otherDetails.keys(); + Iterator iter = feature.otherDetails.keySet().iterator(); Vector props = dsa.getPropertyAsReference(); - while (iter.hasMoreElements()) + while (iter.hasNext()) { - String key = (String) iter.nextElement(); + String key = iter.next(); if (!key.equalsIgnoreCase("score") && !key.equalsIgnoreCase("status")) { @@ -250,7 +252,8 @@ public class Sequencefeature extends Rangetype else if (vlu instanceof Integer) { valid = true; - nprop.setType(uk.ac.vamsas.objects.utils.Properties.INTEGERTYPE); + nprop.setType( + uk.ac.vamsas.objects.utils.Properties.INTEGERTYPE); } else if (vlu instanceof Float) {