(no commit message)
[jalview.git] / forester / java / src / org / forester / development / ResidueRenderer.java
index da8088c..fe07389 100644 (file)
@@ -5,7 +5,7 @@
 // Copyright (C) 2010 Christian M Zmasek
 // Copyright (C) 2010 Sanford-Burnham Medical Research Institute
 // All rights reserved
-// 
+//
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 // Lesser General Public License for more details.
-// 
+//
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
 //
 // Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
 
 package org.forester.development;
 
@@ -39,7 +39,7 @@ public class ResidueRenderer extends AbstractRenderer {
     static final int          DISTANCE_OVAL_BORDER = 1;
     static final int          SIZE_LIMIT           = 7;
     /**
-     * 
+     *
      */
     private static final long serialVersionUID     = -2331160296913478874L;
     private final char        _value;
@@ -72,9 +72,9 @@ public class ResidueRenderer extends AbstractRenderer {
             value = max;
         }
         final double x = ( 255D * ( value - min ) ) / ( max - min );
-        final int red = ( int ) ( minColor.getRed() + x * calcFactor( minColor.getRed(), maxColor.getRed() ) );
-        final int green = ( int ) ( minColor.getGreen() + x * calcFactor( minColor.getGreen(), maxColor.getGreen() ) );
-        final int blue = ( int ) ( minColor.getBlue() + x * calcFactor( minColor.getBlue(), maxColor.getBlue() ) );
+        final int red = ( int ) ( minColor.getRed() + ( x * calcFactor( minColor.getRed(), maxColor.getRed() ) ) );
+        final int green = ( int ) ( minColor.getGreen() + ( x * calcFactor( minColor.getGreen(), maxColor.getGreen() ) ) );
+        final int blue = ( int ) ( minColor.getBlue() + ( x * calcFactor( minColor.getBlue(), maxColor.getBlue() ) ) );
         return new Color( red, green, blue );
     }
 
@@ -99,18 +99,18 @@ public class ResidueRenderer extends AbstractRenderer {
         }
         if ( value < mean ) {
             final double x = ( 255D * ( value - min ) ) / ( mean - min );
-            final int red = ( int ) ( minColor.getRed() + x * calcFactor( minColor.getRed(), meanColor.getRed() ) );
-            final int green = ( int ) ( minColor.getGreen() + x
-                    * calcFactor( minColor.getGreen(), meanColor.getGreen() ) );
-            final int blue = ( int ) ( minColor.getBlue() + x * calcFactor( minColor.getBlue(), meanColor.getBlue() ) );
+            final int red = ( int ) ( minColor.getRed() + ( x * calcFactor( minColor.getRed(), meanColor.getRed() ) ) );
+            final int green = ( int ) ( minColor.getGreen() + ( x * calcFactor( minColor.getGreen(),
+                                                                                meanColor.getGreen() ) ) );
+            final int blue = ( int ) ( minColor.getBlue() + ( x * calcFactor( minColor.getBlue(), meanColor.getBlue() ) ) );
             return new Color( red, green, blue );
         }
         if ( value > mean ) {
             final double x = ( 255D * ( value - mean ) ) / ( max - mean );
-            final int red = ( int ) ( meanColor.getRed() + x * calcFactor( meanColor.getRed(), maxColor.getRed() ) );
-            final int green = ( int ) ( meanColor.getGreen() + x
-                    * calcFactor( meanColor.getGreen(), maxColor.getGreen() ) );
-            final int blue = ( int ) ( meanColor.getBlue() + x * calcFactor( meanColor.getBlue(), maxColor.getBlue() ) );
+            final int red = ( int ) ( meanColor.getRed() + ( x * calcFactor( meanColor.getRed(), maxColor.getRed() ) ) );
+            final int green = ( int ) ( meanColor.getGreen() + ( x * calcFactor( meanColor.getGreen(),
+                                                                                 maxColor.getGreen() ) ) );
+            final int blue = ( int ) ( meanColor.getBlue() + ( x * calcFactor( meanColor.getBlue(), maxColor.getBlue() ) ) );
             return new Color( red, green, blue );
         }
         else {