X-Git-Url: http://source.jalview.org/gitweb/?p=vamsas.git;a=blobdiff_plain;f=src%2Fuk%2Fac%2Fvamsas%2Fobjects%2FDocumentUpdaterEngine.java;h=715d7e488befc035ecc0dccd1980089d25c4514f;hp=cb2d2c36c8cec1c73f8ba80e21eb102b8e22994f;hb=844ccad5a3fcbedec17b2af66d460f31abc7cff1;hpb=6f33f705957d674dc2ab6c994a6ea87f7a91f40f diff --git a/src/uk/ac/vamsas/objects/DocumentUpdaterEngine.java b/src/uk/ac/vamsas/objects/DocumentUpdaterEngine.java index cb2d2c3..715d7e4 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.1. + * Copyright 2009 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