PMD code sweep, #6 don't add MyWindow twice to MyApplication
[fanfix.git] / src / jexer / backend / GenericBackend.java
index bf27e947607f1c7bea073b4edac0689f300e6067..bb9ae9f95af83a52c618541f121df6cbb0faecc5 100644 (file)
@@ -39,11 +39,33 @@ import jexer.event.TInputEvent;
  */
 public abstract class GenericBackend implements Backend {
 
+    // ------------------------------------------------------------------------
+    // Variables --------------------------------------------------------------
+    // ------------------------------------------------------------------------
+
     /**
      * The session information.
      */
     protected SessionInfo sessionInfo;
 
+    /**
+     * The screen to draw on.
+     */
+    protected Screen screen;
+
+    /**
+     * Input events are processed by this Terminal.
+     */
+    protected TerminalReader terminal;
+
+    // ------------------------------------------------------------------------
+    // Constructors -----------------------------------------------------------
+    // ------------------------------------------------------------------------
+
+    // ------------------------------------------------------------------------
+    // Backend ----------------------------------------------------------------
+    // ------------------------------------------------------------------------
+
     /**
      * Getter for sessionInfo.
      *
@@ -53,11 +75,6 @@ public abstract class GenericBackend implements Backend {
         return sessionInfo;
     }
 
-    /**
-     * The screen to draw on.
-     */
-    protected Screen screen;
-
     /**
      * Getter for screen.
      *
@@ -75,9 +92,13 @@ public abstract class GenericBackend implements Backend {
     }
 
     /**
-     * Input events are processed by this Terminal.
+     * Check if there are events in the queue.
+     *
+     * @return if true, getEvents() has something to return to the application
      */
-    protected TerminalReader terminal;
+    public boolean hasEvents() {
+        return terminal.hasEvents();
+    }
 
     /**
      * Get keyboard, mouse, and screen resize events.