PMD code sweep, #6 don't add MyWindow twice to MyApplication
[fanfix.git] / src / jexer / backend / SwingComponent.java
index 48e4a44fa6b5b9f2db1765ec8f700f78137d38b3..4b0b2b4d079bc2f8b9d43bbc7ad10ab268852438 100644 (file)
@@ -52,11 +52,53 @@ import javax.swing.JFrame;
  */
 class SwingComponent {
 
+    // ------------------------------------------------------------------------
+    // Variables --------------------------------------------------------------
+    // ------------------------------------------------------------------------
+
     /**
      * If true, use triple buffering when drawing to a JFrame.
      */
     public static boolean tripleBuffer = true;
 
+    /**
+     * The frame reference, if we are drawing to a JFrame.
+     */
+    private JFrame frame;
+
+    /**
+     * The component reference, if we are drawing to a JComponent.
+     */
+    private JComponent component;
+
+    // ------------------------------------------------------------------------
+    // Constructors -----------------------------------------------------------
+    // ------------------------------------------------------------------------
+
+    /**
+     * Construct using a JFrame.
+     *
+     * @param frame the JFrame to draw to
+     */
+    public SwingComponent(final JFrame frame) {
+        this.frame = frame;
+        setupFrame();
+    }
+
+    /**
+     * Construct using a JComponent.
+     *
+     * @param component the JComponent to draw to
+     */
+    public SwingComponent(final JComponent component) {
+        this.component = component;
+        setupComponent();
+    }
+
+    // ------------------------------------------------------------------------
+    // SwingComponent ---------------------------------------------------------
+    // ------------------------------------------------------------------------
+
     /**
      * Get the BufferStrategy object needed for triple-buffering.
      *
@@ -73,16 +115,6 @@ class SwingComponent {
         }
     }
 
-    /**
-     * The frame reference, if we are drawing to a JFrame.
-     */
-    private JFrame frame;
-
-    /**
-     * The component reference, if we are drawing to a JComponent.
-     */
-    private JComponent component;
-
     /**
      * Get the JFrame reference.
      *
@@ -101,26 +133,6 @@ class SwingComponent {
         return component;
     }
 
-    /**
-     * Construct using a JFrame.
-     *
-     * @param frame the JFrame to draw to
-     */
-    public SwingComponent(final JFrame frame) {
-        this.frame = frame;
-        setupFrame();
-    }
-
-    /**
-     * Construct using a JComponent.
-     *
-     * @param component the JComponent to draw to
-     */
-    public SwingComponent(final JComponent component) {
-        this.component = component;
-        setupComponent();
-    }
-
     /**
      * Setup to render to an existing JComponent.
      */