applied LGPLv3 and source code formatting.
[vamsas.git] / src / uk / ac / vamsas / client / simpleclient / SessionFlagWatcherElement.java
index 8d70d9f..0c87398 100644 (file)
@@ -1,39 +1,69 @@
+/*\r
+ * This file is part of the Vamsas Client version 0.1. \r
+ * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite, \r
+ *  Andrew Waterhouse and Dominik Lindner.\r
+ * \r
+ * Earlier versions have also been incorporated into Jalview version 2.4 \r
+ * since 2008, and TOPALi version 2 since 2007.\r
+ * \r
+ * The Vamsas Client is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU Lesser General Public License as published by\r
+ * the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *  \r
+ * The Vamsas Client is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU Lesser General Public License for more details.\r
+ * \r
+ * You should have received a copy of the GNU Lesser General Public License\r
+ * along with the Vamsas Client.  If not, see <http://www.gnu.org/licenses/>.\r
+ */\r
 package uk.ac.vamsas.client.simpleclient;\r
 \r
-\r
 /**\r
- * Element of the VamsasFileWatcherThread event generator chain.\r
- * Keep a reference to this element before adding it to the chain \r
- * in order to control the generation of events with halt and enable.\r
+ * Element of the VamsasFileWatcherThread event generator chain. Keep a\r
+ * reference to this element before adding it to the chain in order to control\r
+ * the generation of events with halt and enable.\r
  * \r
- * doWatch will do nothing if the element is not enabled.\r
- * TODO: TEST THIS CLASS - not yet used in SimpleClient\r
+ * doWatch will do nothing if the element is not enabled. TODO: TEST THIS CLASS\r
+ * - not yet used in SimpleClient\r
  */\r
 public class SessionFlagWatcherElement extends WatcherElement {\r
-  SessionFlagFile watched=null;\r
+  SessionFlagFile watched = null;\r
+\r
   /**\r
    * create a new, enabled watch element\r
-   * @param watcher file being watched\r
-   * @param handler handler to call on state change\r
+   * \r
+   * @param watcher\r
+   *          file being watched\r
+   * @param handler\r
+   *          handler to call on state change\r
    */\r
-  public SessionFlagWatcherElement(SessionFlagFile watcher, WatcherCallBack handler) {\r
+  public SessionFlagWatcherElement(SessionFlagFile watcher,\r
+      WatcherCallBack handler) {\r
     this(watcher, handler, true);\r
   }\r
+\r
   protected void initWatch() {\r
-    if (watched==null)\r
+    if (watched == null)\r
       return;\r
     watcher = new FileWatcher(watched.flagFile);\r
   }\r
+\r
   protected void endWatch() {\r
     // leaves watcher in state its in.\r
   }\r
+\r
   /**\r
    * new watcher with flag to initially skip watching this sessionfile\r
+   * \r
    * @param watcher\r
    * @param handler\r
    * @param enableWatching\r
    */\r
-  public SessionFlagWatcherElement(SessionFlagFile watcher, WatcherCallBack handler, boolean enableWatching) {\r
+  public SessionFlagWatcherElement(SessionFlagFile watcher,\r
+      WatcherCallBack handler, boolean enableWatching) {\r
     super(handler);\r
     this.watched = watcher;\r
     if (enableWatching)\r
@@ -41,14 +71,16 @@ public class SessionFlagWatcherElement extends WatcherElement {
     else\r
       haltWatch();\r
   }\r
+\r
   /**\r
    * @return the watched\r
    */\r
   public SessionFlagFile getWatched() {\r
     return watched;\r
   }\r
+\r
   protected String getSubject() {\r
-    \r
+\r
     return watched.flagFile.toString();\r
   }\r
 }\r