More PMD warnings
[fanfix.git] / src / jexer / demos / DemoMainWindow.java
index 209bd1350ccef2f4a2d7464dcd0d7b2c126d86f2..eef25e29aee47926195631f4ae7eea2bf517d22a 100644 (file)
@@ -41,21 +41,35 @@ import static jexer.TKeypress.*;
  */
 public class DemoMainWindow extends TWindow {
 
-    // Timer that increments a number.
+    // ------------------------------------------------------------------------
+    // Variables --------------------------------------------------------------
+    // ------------------------------------------------------------------------
+
+    /**
+     * Timer that increments a number.
+     */
     private TTimer timer;
 
-    // Timer label is updated with timer ticks.
+    /**
+     * Timer label is updated with timer ticks.
+     */
     TLabel timerLabel;
 
     /**
-     * We need to override onClose so that the timer will no longer be called
-     * after we close the window.  TTimers currently are completely unaware
-     * of the rest of the UI classes.
+     * Timer increment used by the timer loop.  Has to be at class scope so
+     * that it can be accessed by the anonymous TAction class.
      */
-    @Override
-    public void onClose() {
-        getApplication().removeTimer(timer);
-    }
+    int timerI = 0;
+
+    /**
+     * Progress bar used by the timer loop.  Has to be at class scope so that
+     * it can be accessed by the anonymous TAction class.
+     */
+    TProgressBar progressBar;
+
+    // ------------------------------------------------------------------------
+    // Constructors -----------------------------------------------------------
+    // ------------------------------------------------------------------------
 
     /**
      * Construct demo window.  It will be centered on screen.
@@ -66,11 +80,6 @@ public class DemoMainWindow extends TWindow {
         this(parent, CENTERED | RESIZABLE);
     }
 
-    // These are used by the timer loop.  They have to be at class scope so
-    // that they can be accessed by the anonymous TAction class.
-    int timerI = 0;
-    TProgressBar progressBar;
-
     /**
      * Constructor.
      *
@@ -212,6 +221,20 @@ public class DemoMainWindow extends TWindow {
         statusBar.addShortcutKeypress(kbF10, cmExit, "Exit");
     }
 
+    // ------------------------------------------------------------------------
+    // TWindow ----------------------------------------------------------------
+    // ------------------------------------------------------------------------
+
+    /**
+     * We need to override onClose so that the timer will no longer be called
+     * after we close the window.  TTimers currently are completely unaware
+     * of the rest of the UI classes.
+     */
+    @Override
+    public void onClose() {
+        getApplication().removeTimer(timer);
+    }
+
     /**
      * Method that subclasses can override to handle posted command events.
      *