code: public static void setPointJointAt(IRectangleRelationship rr, SettingsGraphicUml sg, int screenX, int screenY) {
      double realX = UtilsGraphMath.toRealX(sg, screenX);
      double realY = UtilsGraphMath.toRealY(sg, screenY);
      //all length:
      double lengthX = realX - rr.getShape().getPointStart().getX();
      double restX = rr.getShape().getWidth() - lengthX;
      double lengthY = realY - rr.getShape().getPointStart().getY();
      double restY = rr.getShape().getHeight() - lengthY;
      //1. min length:
      double minX = Math.min(lengthX, restX);
      double minY = Math.min(lengthY, restY);
      double min = Math.min(minX, minY);
      if(min == minX) {//left or right
        if(minX == lengthX) {
          rr.setSideJoint(EJointSide.LEFT);
          rr.setSideLength(restY);
        }  
        else {
          rr.setSideJoint(EJointSide.RIGHT);
          rr.setSideLength(lengthY);
        }
      }
      else {//top or bottom
        if(minY == lengthY) {
          rr.setSideJoint(EJointSide.TOP);
          rr.setSideLength(lengthX);
        }  
        else {
          rr.setSideJoint(EJointSide.BOTTOM);
          rr.setSideLength(restX);
        }
      }
      evalPointJoint(rr);
    }
docs: TODO