Class RectangleUtils


  • public class RectangleUtils
    extends Object
    Helper class for selections.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • RectangleUtils

        public RectangleUtils()
    • Method Detail

      • rectangleCorner

        public static Point rectangleCorner​(Point corner1,
                                            Point corner2,
                                            RectangleUtils.RectangleCorner corner)
        Computes the specified corner of the rectangle using two arbitrary corner points of the rectangle.
        Parameters:
        corner1 - the first corner
        corner2 - the second corner
        corner - the type of corner to compute
        Returns:
        the computed corner
      • updateCorner

        public static Rectangle updateCorner​(Rectangle rect,
                                             Point cornerOld,
                                             Point cornerNew)
        Updates the corner of a rectangle and returns the new rectangle.
        Parameters:
        rect - the rectangle to update
        cornerOld - the old corner
        cornerNew - the new corner
        Returns:
        the updated rectangle