Interface RectangularShape2afp<ST extends Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RectangularShape2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>

    • Method Detail

      • set

        default void set​(double x,
                         double y,
                         double width,
                         double height)
        Change the frame of the rectangle.
        Parameters:
        x - x coordinate of the lower corner of the rectangular shape.
        y - y coordinate of the lower corner of the rectangular shape.
        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​(double width)
        Change the width of the rectangle, not the min corner.
        Parameters:
        width - width of the rectangular shape.
      • setHeight

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

        void setFromCorners​(double x1,
                            double y1,
                            double x2,
                            double 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​(double centerX,
                                   double centerY,
                                   double cornerX,
                                   double 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
        double getMinX()
        Replies the min X.
        Returns:
        the min x.
      • setMinX

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

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

        @Pure
        default double getCenterX()
        Replies the center x.
        Returns:
        the center x.
      • getMaxX

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

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

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

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

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

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

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

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

        @Pure
        default double 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 Shape2afp<?,​?,​IE,​P,​V,​B>,​IT extends RectangularShape2afp<?,​?,​IE,​P,​V,​B>,​IE extends PathElement2afp,​P extends Point2D<? super P,​? super V>,​V extends Vector2D<? super V,​? super P>,​B extends Rectangle2afp<?,​?,​IE,​P,​V,​B>>
        Returns:
        true if the shape is empty; false otherwise.
      • inflate

        default void inflate​(double minXBorder,
                             double minYBorder,
                             double maxXBorder,
                             double 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.