Merge branch 'develop' into bug/JAL-4235_gradle_task_jalviewjsTranspile_does_not_fail...
[jalview.git] / src / jalview / renderer / ContactGeometry.java
index a1443c8..42dde8d 100644 (file)
@@ -1,3 +1,23 @@
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
 package jalview.renderer;
 
 import java.util.Arrays;
@@ -45,13 +65,15 @@ public class ContactGeometry
    * number of contacts for each pixel_step - to last whole contact
    */
   final double contacts_step;
-  
+
   final int lastStep;
 
   /**
    * Bean used to map from a range of contacts to a range of pixels
+   * 
    * @param contacts
-   * @param graphHeight Number of pixels to map given range of contacts
+   * @param graphHeight
+   *          Number of pixels to map given range of contacts
    */
   public ContactGeometry(final ContactListI contacts, int graphHeight)
   {
@@ -73,8 +95,9 @@ public class ContactGeometry
       pixels_step = (int) Math
               .ceil(((double) graphHeight) / (double) contact_height);
     }
-    contacts_step = pixels_step*contacts_per_pixel;
-    lastStep = (int) Math.min((double)graphHeight, ((double)graphHeight)/((double)pixels_step));
+    contacts_step = pixels_step * contacts_per_pixel;
+    lastStep = (int) Math.min((double) graphHeight,
+            ((double) graphHeight) / ((double) pixels_step));
   }
 
   public class contactInterval
@@ -108,10 +131,12 @@ public class ContactGeometry
       return cStart == them.cStart && cEnd == them.cEnd && pEnd == them.pEnd
               && pStart == them.pStart;
     }
+
     @Override
     public String toString()
     {
-      return "Contacts ["+cStart+","+cEnd+"] : Pixels ["+pStart+","+pEnd+"]";
+      return "Contacts [" + cStart + "," + cEnd + "] : Pixels [" + pStart
+              + "," + pEnd + "]";
     }
   }
 
@@ -144,7 +169,7 @@ public class ContactGeometry
       {
         // TODO: turn into function on hiddenColumns and create test !!
         Iterator<int[]> viscont = hiddenColumns.getVisContigsIterator(
-                -1+mappedRange[p], -1+mappedRange[p + 1], false);
+                -1 + mappedRange[p], -1 + mappedRange[p + 1], false);
         containsHidden = !viscont.hasNext();
         if (!containsHidden)
         {
@@ -156,8 +181,8 @@ public class ContactGeometry
       }
       else
       {
-        rowsel = columnSelection.intersects(-1+mappedRange[p],
-                -1+mappedRange[p + 1]);
+        rowsel = columnSelection.intersects(-1 + mappedRange[p],
+                -1 + mappedRange[p + 1]);
       }
     }
     return rowsel;