+
+ /**
+ * Helper method for calcColor methods.
+ *
+ * @param smallercolor_component_x
+ * color component the smaller color
+ * @param largercolor_component_x
+ * color component the larger color
+ * @param x
+ * factor
+ * @return an int representing a color component
+ */
+ final private static int calculateColorComponent( final double smallercolor_component_x,
+ final double largercolor_component_x,
+ final double x ) {
+ return ( int ) ( smallercolor_component_x + ( ( x * ( largercolor_component_x - smallercolor_component_x ) ) / 255.0 ) );
+ }
+
+ /**
+ * Helper method for calcColor methods.
+ *
+ *
+ * @param value
+ * the value
+ * @param larger
+ * the largest value
+ * @param smaller
+ * the smallest value
+ * @return a normalized value between larger and smaller
+ */
+ final private static double calculateColorFactor( final double value, final double larger, final double smaller ) {
+ return ( 255.0 * ( value - smaller ) ) / ( larger - smaller );
+ }
+
+ final private static String[] splitString( final String str ) {
+ final String regex = "[\\s;,]+";
+ return str.split( regex );
+ }
+
+ public final static void outOfMemoryError( final OutOfMemoryError e ) {
+ System.err.println();
+ System.err.println( "Java memory allocation might be too small, try \"-Xmx2048m\" java command line option" );
+ System.err.println();
+ e.printStackTrace( System.err );
+ System.err.println();
+ System.exit( -1 );
+ }