X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2FDocumentUpdaterEngine.java;h=19cae2d56acaa50c0ef0e824ca1ec99621093a3b;hb=1eea4b639911330e7cd65e17c5421cc584f0d22e;hp=cb2d2c36c8cec1c73f8ba80e21eb102b8e22994f;hpb=8da8584ed2c57001e6f4c41656746497052252a2;p=vamsas.git diff --git a/src/uk/ac/vamsas/objects/DocumentUpdaterEngine.java b/src/uk/ac/vamsas/objects/DocumentUpdaterEngine.java index cb2d2c3..19cae2d 100644 --- a/src/uk/ac/vamsas/objects/DocumentUpdaterEngine.java +++ b/src/uk/ac/vamsas/objects/DocumentUpdaterEngine.java @@ -1,38 +1,67 @@ +/* + * This file is part of the Vamsas Client version 0.2. + * Copyright 2010 by Jim Procter, Iain Milne, Pierre Marguerite, + * Andrew Waterhouse and Dominik Lindner. + * + * Earlier versions have also been incorporated into Jalview version 2.4 + * since 2008, and TOPALi version 2 since 2007. + * + * The Vamsas Client is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * The Vamsas Client 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 Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with the Vamsas Client. If not, see . + */ package uk.ac.vamsas.objects; import uk.ac.vamsas.client.IClientDocument; import uk.ac.vamsas.objects.core.*; + /** - * Implements a depth first traversal over the document tree calling update handlers based on the Vobject.isUpdated() and Vobject.isNewInDocument() state at each backtrack. + * Implements a depth first traversal over the document tree calling update + * handlers based on the Vobject.isUpdated() and Vobject.isNewInDocument() state + * at each backtrack. + * * @author JimP - * + * */ public class DocumentUpdaterEngine { - private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory.getLog(DocumentUpdaterEngine.class); + private static org.apache.commons.logging.Log log = org.apache.commons.logging.LogFactory + .getLog(DocumentUpdaterEngine.class); + private IDocumentUpdater handler; + /** - * initialise the engine with an implementation - * of the interface. + * initialise the engine with an implementation of the interface. + * * @param hander */ public DocumentUpdaterEngine(IDocumentUpdater handler) { super(); this.handler = handler; } + /** - * call the necessary update handlers at - * each point on the VamsasDocument OM - * TODO: later: Make this more elegant (use reflection and factor to single update(Object) method) ? - * - we take the plodding, explicit approach rather than a funky generalised one here + * call the necessary update handlers at each point on the VamsasDocument OM + * TODO: later: Make this more elegant (use reflection and factor to single + * update(Object) method) ? - we take the plodding, explicit approach rather + * than a funky generalised one here */ public void callHandlers(IClientDocument cdoc) { - if (cdoc==null) { + if (cdoc == null) { log.debug("Null IClientDocument instance."); return; } VAMSAS[] roots = cdoc.getVamsasRoots(); - if (roots!=null) { - for (int r=0; r