code: public Point2d toModelCoordinates(double screenX, double screenY) {
          try {
              double[] dest = new double[2];
              double[] src = new double[]{screenX, screenY};
              transform.inverseTransform(src, 0, dest, 0, 1);
              return new Point2d(dest[0], dest[1]);
          } catch (NoninvertibleTransformException n) {
              return new Point2d(0, 0);
          }
      }
docs: Convert a point in screen space into a point in model space.
  
  @param screenX the screen x-coordinate
  @param screenY the screen y-coordinate
  @return the equivalent point in model space, or (0,0) if there is an error