From 6638c2755466ca601450700d5a39f390f23d4781 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 23 Mar 2015 14:44:05 +0000
Subject: [PATCH] AutoRefactored javadocs

---
 opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/CustomTree.java |   52 ++++++++++++++++++++--------------------------------
 1 files changed, 20 insertions(+), 32 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/CustomTree.java b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/CustomTree.java
index 76a6b57..03b997a 100644
--- a/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/CustomTree.java
+++ b/opendj-server-legacy/src/main/java/org/opends/guitools/controlpanel/ui/components/CustomTree.java
@@ -69,9 +69,7 @@
     MOUSE_PRESSED, MOUSE_CLICKED, MOUSE_RELEASED
   };
 
-  /**
-   * {@inheritDoc}
-   */
+  /** {@inheritDoc} */
   public void paintComponent(Graphics g)
   {
     int[] selectedRows = getSelectionRows();
@@ -88,16 +86,7 @@
     for ( int i = 0; i < nRows; i++)
     {
       int rowHeight = getRowBounds( i ).height;
-      boolean isSelected = false;
-      for (int j=0; j<selectedRows.length; j++)
-      {
-        if (selectedRows[j] == i)
-        {
-          isSelected = true;
-          break;
-        }
-      }
-      if (isSelected)
+      if (isRowSelected(selectedRows, i))
       {
         g.setColor(TreeCellRenderer.selectionBackground);
       }
@@ -121,6 +110,18 @@
     setOpaque(isOpaque);
   }
 
+  private boolean isRowSelected(int[] selectedRows, int i)
+  {
+    for (int j=0; j<selectedRows.length; j++)
+    {
+      if (selectedRows[j] == i)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+
   /**
    * Sets a popup menu that will be displayed when the user clicks on the tree.
    * @param popMenu the popup menu.
@@ -130,10 +131,7 @@
     this.popupMenu = popMenu;
   }
 
-  /**
-   * Default constructor.
-   *
-   */
+  /** Default constructor. */
   public CustomTree()
   {
     putClientProperty("JTree.lineStyle", "Angled");
@@ -143,9 +141,7 @@
     MouseListener mouseListener = new MouseAdapter()
     {
       private boolean ignoreEvents;
-      /**
-       * {@inheritDoc}
-       */
+      /** {@inheritDoc} */
       public void mousePressed(MouseEvent ev)
       {
         if (ignoreEvents)
@@ -194,9 +190,7 @@
         }
       }
 
-      /**
-       * {@inheritDoc}
-       */
+      /** {@inheritDoc} */
       public void mouseReleased(MouseEvent ev)
       {
         if (ignoreEvents)
@@ -219,9 +213,7 @@
         }
       }
 
-      /**
-       * {@inheritDoc}
-       */
+      /** {@inheritDoc} */
       public void mouseClicked(MouseEvent ev)
       {
         if (ignoreEvents)
@@ -300,9 +292,7 @@
     }
   }
 
-  /**
-   * {@inheritDoc}
-   */
+  /** {@inheritDoc} */
   public void addMouseListener(MouseListener mouseListener)
   {
     super.addMouseListener(mouseListener);
@@ -313,9 +303,7 @@
     mouseListeners.add(mouseListener);
   }
 
-  /**
-   * {@inheritDoc}
-   */
+  /** {@inheritDoc} */
   public void removeMouseListener(MouseListener mouseListener)
   {
     super.removeMouseListener(mouseListener);

--
Gitblit v1.10.0