Interface RectangularShape2ai<ST extends Shape2ai<?,​?,​IE,​P,​V,​B>,​IT extends RectangularShape2ai<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2ai,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2ai<?,​?,​IE,​P,​V,​B>>

    • Method Detail

      • set

        default void set​(int x,
                         int y,
                         int width,
                         int height)
        Change the frame of the rectangle.
        Parameters:
        x - x coordinate of the lower corner.
        y - y coordinate of the lower corner.
        width - width of the rectangular shape.
        height - height of the rectangular shape.
      • set

        default void set​(Point2D<?,​?> min,
                         Point2D<?,​?> max)
        Change the frame of the rectangle.
        Parameters:
        min - is the min corner of the rectangle.
        max - is the max corner of the rectangle.
      • setWidth

        default void setWidth​(int width)
        Change the width of the rectangle, not the min corner.
        Parameters:
        width - width of the rectangular shape.
      • setHeight

        default void setHeight​(int height)
        Change the height of the rectangle, not the min corner.
        Parameters:
        height - height of the rectangular shape.
      • setFromCorners

        void setFromCorners​(int x1,
                            int y1,
                            int x2,
                            int y2)
        Change the frame of the rectangle conserving previous min and max if needed.
        Parameters:
        x1 - is the coordinate of the first corner.
        y1 - is the coordinate of the first corner.
        x2 - is the coordinate of the second corner.
        y2 - is the coordinate of the second corner.
      • setFromCorners

        default void setFromCorners​(Point2D<?,​?> p1,
                                    Point2D<?,​?> p2)
        Change the frame of the rectangle conserving previous min and max if needed.
        Parameters:
        p1 - the first corner.
        p2 - the second corner.
      • setFromCenter

        default void setFromCenter​(int centerX,
                                   int centerY,
                                   int cornerX,
                                   int cornerY)
        Sets the framing rectangle of this Shape based on the specified center point coordinates and corner point coordinates. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.
        Parameters:
        centerX - the X coordinate of the specified center point
        centerY - the Y coordinate of the specified center point
        cornerX - the X coordinate of the specified corner point
        cornerY - the Y coordinate of the specified corner point
      • setFromCenter

        default void setFromCenter​(Point2D<?,​?> center,
                                   Point2D<?,​?> corner)
        Sets the framing rectangle of this Shape based on the specified center point coordinates and corner point coordinates. The framing rectangle is used by the subclasses of RectangularShape to define their geometry.
        Parameters:
        center - the specified center point
        corner - the specified corner point
      • getMinX

        @Pure
        int getMinX()
        Replies the min X.
        Returns:
        the min x.
      • setMinX

        void setMinX​(int x)
        Set the min X conserving previous min if needed.
        Parameters:
        x - the min x.
      • getCenterX

        @Pure
        default int getCenterX()
        Replies the center x.
        Returns:
        the center x.
      • getCenter

        @Pure
        default P getCenter()
        Replies the center.
        Returns:
        the center.
      • getMaxX

        @Pure
        int getMaxX()
        Replies the max x.
        Returns:
        the max x.
      • setMaxX

        void setMaxX​(int x)
        Set the max X conserving previous max if needed.
        Parameters:
        x - the max x.
      • getMinY

        @Pure
        int getMinY()
        Replies the min y.
        Returns:
        the min y.
      • setMinY

        void setMinY​(int y)
        Set the min Y conserving previous min if needed.
        Parameters:
        y - the min y.
      • getCenterY

        @Pure
        default int getCenterY()
        Replies the center y.
        Returns:
        the center y.
      • getMaxY

        @Pure
        int getMaxY()
        Replies the max y.
        Returns:
        the max y.
      • setMaxY

        void setMaxY​(int y)
        Set the max Y conserving previous max if needed.
        Parameters:
        y - the max y.
      • getWidth

        @Pure
        default int getWidth()
        Replies the width.
        Returns:
        the width.
      • getHeight

        @Pure
        default int getHeight()
        Replies the height.
        Returns:
        the height.
      • isEmpty

        @Pure
        default boolean isEmpty()
        Description copied from interface: Shape2D
        Replies if this shape is empty. The semantic associated to the state "empty" depends on the implemented shape. See the subclasses for details.
        Specified by:
        isEmpty in interface Shape2D<ST extends Shape2ai<?,​?,​IE,​P,​V,​B>,​IT extends RectangularShape2ai<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2ai,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2ai<?,​?,​IE,​P,​V,​B>>
        Returns:
        true if the shape is empty; false otherwise.
      • inflate

        default void inflate​(int minXBorder,
                             int minYBorder,
                             int maxXBorder,
                             int maxYBorder)
        Inflate this rectangle with the given amounts.

        The four borders may be inflated. If the value associated to a border is positive, the border is moved outside the current rectangle. If the value is negative, the border is moved inside the rectangle.

        Parameters:
        minXBorder - the value to substract to the minimum x.
        minYBorder - the value to substract to the minimum y.
        maxXBorder - the value to add to the maximum x.
        maxYBorder - the value to add to the maximum y.