if (x > tArea.getMaxX()) x = (int)tArea.getMaxX() - 1; if (y > tArea.getMaxY()) y = (int)tArea.getMaxY() - 1; if (x < tArea.getMinX()) x = 0; if (y < tArea.getMinY()) y = 0;          int s = fmWidth * numCols; int t = s - x; int u = t / fmWidth; int v = numCols - u;
   public int getRowColFromPoint (int x, int y) {      // is x,y in the drawing area      // x is left to right and y is top to bottom//         if (tArea.contains(x,y)) {////   //         int cols = (numCols - ((((fmWidth * numCols) - x) / fmWidth)));//   //         System.out.println(cols);//            return getPos((numRows - ((((fmHeight * (numRows)) - y) / fmHeight))),//                           (numCols - ((((fmWidth * (numCols)) - x) / fmWidth)))//                        );////         }//         else {//      if (!tArea.contains(x,y)) {//         System.out.println(" Not in area before " +//                           (int)tArea.getMinX() + " " +//                           (int)tArea.getMinY() + " " +//                           (int)tArea.getMaxX() + " " +//                           (int)tArea.getMaxY() + " " +//                           x + " " + y);         if (x > tArea.getMaxX())            x = (int)tArea.getMaxX() - 1;         if (y > tArea.getMaxY())            y = (int)tArea.getMaxY() - 1;         if (x < tArea.getMinX())            x = 0;         if (y < tArea.getMinY())            y = 0;//         System.out.println(" Not in area after " +//                           (int)tArea.getMinX() + " " +//                           (int)tArea.getMinY() + " " +//                           (int)tArea.getMaxX() + " " +//                           (int)tArea.getMaxY() + " " +//                           x + " " + y);//      }      int s = fmWidth * numCols;      int t = s - x;      int u = t / fmWidth;      int v = numCols - u;      int s0 = y / fmHeight;      int s1 = x / fmWidth;//      return getPos((numRows - ((((fmHeight * (numRows)) - y) / fmHeight))),//                     (numCols - ((((fmWidth * (numCols)) - x) / fmWidth)))//                  );      return getPos(s0,s1);//      return 0;   }