Beispiel #1
0
  public int getIndexOfEdgePointAt(int x, int y, int tol) {
    Rectangle rect = new Rectangle(x - tol / 2, y - tol / 2, tol, tol);
    List<mxPoint> pts = getAbsolutePoints();

    int i = 0;
    for (mxPoint p : pts) {
      // System.out.println("point="+p.getX()+" "+p.getY());
      if (rect.contains(p.getPoint())) return i;
      i++;
    }
    return -1;
  }