System.err.println(factor);
   double getConversionFactor(      int units_from,      int units_to,      double resolution,      int units_resolution)   {      System.err.print(         "Converting from "            + sizeUnits[units_from]            + " to "            + sizeUnits[units_to]            + " at "            + resolution            + " "            + resolutionUnits[units_resolution]            + "... Factor: ");      // There has to be a better way...      double factor = 0.0;      switch (units_from)      {         case S_UNITS_PIXELS :            switch (units_to)            {               case S_UNITS_PIXELS :                  factor = 1.0;                  break;               case S_UNITS_INCHES :                  switch (units_resolution)                  {                     case R_UNITS_PIXELS_PER_INCH :                        factor = 1 / resolution;                        break;                     case R_UNITS_PIXELS_PER_CENT :                        factor = 1 / (resolution * INCHES_TO_CENTS);                        break;                  }                  break;               case S_UNITS_CENTS :                  switch (units_resolution)                  {                     case R_UNITS_PIXELS_PER_INCH :                        factor = 1 / (resolution * CENTS_TO_INCHES);                        break;                     case R_UNITS_PIXELS_PER_CENT :                        factor = 1 / resolution;                        break;                  }                  break;            }            break;         case S_UNITS_INCHES :            switch (units_to)            {               case S_UNITS_PIXELS :                  switch (units_resolution)                  {                     case R_UNITS_PIXELS_PER_INCH :                        factor = resolution;                        break;                     case R_UNITS_PIXELS_PER_CENT :                        factor = resolution * INCHES_TO_CENTS;                        break;                  }                  break;               case S_UNITS_INCHES :                  factor = 1.0;                  break;               case S_UNITS_CENTS :                  factor = INCHES_TO_CENTS;                  break;            }            break;         case S_UNITS_CENTS :            switch (units_to)            {               case S_UNITS_PIXELS :                  switch (units_resolution)                  {                     case R_UNITS_PIXELS_PER_INCH :                        factor = resolution * INCHES_TO_CENTS;                        break;                     case R_UNITS_PIXELS_PER_CENT :                        factor = resolution;                        break;                  }                  break;               case S_UNITS_INCHES :                  factor = CENTS_TO_INCHES;                  break;               case S_UNITS_CENTS :                  factor = 1.0;                  break;            }            break;      }      System.err.println(factor);      if (factor == 0.0)      {         System.err.println("Factor was not set.");      }      return factor;   }