X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Frenderer%2FContactGeometry.java;fp=src%2Fjalview%2Frenderer%2FContactGeometry.java;h=42dde8d07a5e828aee9f20da1fc1ad7975ff128d;hb=4a28fee3e0c129a01268d26e1396b045bd893fb8;hp=a1443c82cec29f357abfe974f60cf85a24821eab;hpb=6ca8a32d88328b8f2162512f41c657c87e131045;p=jalview.git diff --git a/src/jalview/renderer/ContactGeometry.java b/src/jalview/renderer/ContactGeometry.java index a1443c8..42dde8d 100644 --- a/src/jalview/renderer/ContactGeometry.java +++ b/src/jalview/renderer/ContactGeometry.java @@ -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 . + * 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 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;