applied LGPLv3 and source code formatting.
[vamsas.git] / src / uk / ac / vamsas / client / IObjectUpdate.java
1 /*\r
2  * This file is part of the Vamsas Client version 0.1. \r
3  * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite, \r
4  *  Andrew Waterhouse and Dominik Lindner.\r
5  * \r
6  * Earlier versions have also been incorporated into Jalview version 2.4 \r
7  * since 2008, and TOPALi version 2 since 2007.\r
8  * \r
9  * The Vamsas Client is free software: you can redistribute it and/or modify\r
10  * it under the terms of the GNU Lesser General Public License as published by\r
11  * the Free Software Foundation, either version 3 of the License, or\r
12  * (at your option) any later version.\r
13  *  \r
14  * The Vamsas Client is distributed in the hope that it will be useful,\r
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
17  * GNU Lesser General Public License for more details.\r
18  * \r
19  * You should have received a copy of the GNU Lesser General Public License\r
20  * along with the Vamsas Client.  If not, see <http://www.gnu.org/licenses/>.\r
21  */\r
22 package uk.ac.vamsas.client;\r
23 \r
24 /**\r
25  * Methods implemented by a Vamsas Application's Object Update handler\r
26  * \r
27  * @author vamsas Introduced November 2006 Vamsas Meeting TODO: verify this is\r
28  *         sufficient for the per-object update event mechanism\r
29  */\r
30 public interface IObjectUpdate {\r
31   /**\r
32    * Called by the library to find out which vamsas document object this update\r
33    * handler is interested in\r
34    * \r
35    * @return class that extends org.vamsas.Vobject\r
36    */\r
37   Class getRootVobject();\r
38 \r
39   /**\r
40    * Called to test if this handler is to be called for updates to any Vobjects\r
41    * below the Root Vobject in the vamsas document.\r
42    * \r
43    * @return false means IObjectUpdate.update(updated, cdoc) will only be called\r
44    *         with instances of type getRootVobject().\r
45    */\r
46   boolean handlesSubtreeUpdates();\r
47 \r
48   /**\r
49    * Method called by Vamsas Client Library for all updated objects that the\r
50    * handler is registered for.\r
51    * \r
52    * @param updated\r
53    * @param cdoc\r
54    */\r
55   void update(uk.ac.vamsas.client.Vobject updated,\r
56       uk.ac.vamsas.client.IClientDocument cdoc);\r
57 }\r