Finish code sweep
[nikiroo-utils.git] / src / jexer / TRadioGroup.java
index d811f273a56c6a6fc6d62b9a516701d2c894f55a..6e6f39d22ad0f955f4b78bd3c9ffa140077828e3 100644 (file)
@@ -35,6 +35,10 @@ import jexer.bits.CellAttributes;
  */
 public class TRadioGroup extends TWidget {
 
+    // ------------------------------------------------------------------------
+    // Variables --------------------------------------------------------------
+    // ------------------------------------------------------------------------
+
     /**
      * Label for this radio button group.
      */
@@ -45,30 +49,9 @@ public class TRadioGroup extends TWidget {
      */
     private TRadioButton selectedButton = null;
 
-    /**
-     * Get the radio button ID that was selected.
-     *
-     * @return ID of the selected button, or 0 if no button is selected
-     */
-    public int getSelected() {
-        if (selectedButton == null) {
-            return 0;
-        }
-        return selectedButton.getId();
-    }
-
-    /**
-     * Set the new selected radio button.  Note package private access.
-     *
-     * @param button new button that became selected
-     */
-    void setSelected(final TRadioButton button) {
-        assert (button.isSelected());
-        if (selectedButton != null) {
-            selectedButton.setSelected(false);
-        }
-        selectedButton = button;
-    }
+    // ------------------------------------------------------------------------
+    // Constructors -----------------------------------------------------------
+    // ------------------------------------------------------------------------
 
     /**
      * Public constructor.
@@ -87,6 +70,10 @@ public class TRadioGroup extends TWidget {
         this.label = label;
     }
 
+    // ------------------------------------------------------------------------
+    // TWidget ----------------------------------------------------------------
+    // ------------------------------------------------------------------------
+
     /**
      * Draw a radio button with label.
      */
@@ -107,6 +94,35 @@ public class TRadioGroup extends TWidget {
         getScreen().putStringXY(2, 0, label, radioGroupColor);
     }
 
+    // ------------------------------------------------------------------------
+    // TRadioGroup ------------------------------------------------------------
+    // ------------------------------------------------------------------------
+
+    /**
+     * Get the radio button ID that was selected.
+     *
+     * @return ID of the selected button, or 0 if no button is selected
+     */
+    public int getSelected() {
+        if (selectedButton == null) {
+            return 0;
+        }
+        return selectedButton.getId();
+    }
+
+    /**
+     * Set the new selected radio button.  Note package private access.
+     *
+     * @param button new button that became selected
+     */
+    void setSelected(final TRadioButton button) {
+        assert (button.isSelected());
+        if (selectedButton != null) {
+            selectedButton.setSelected(false);
+        }
+        selectedButton = button;
+    }
+
     /**
      * Convenience function to add a radio button to this group.
      *