Class Image.Rectangle

  • Enclosing class:
    Image

    public static class Image.Rectangle
    extends Image
    Class used to create the JSON for a Rectangle-shaped image (Referred to as "bitmap" in the fluxpoint API).

    Supported options:

    • Set X position.
    • Set Y position.
    • Set width.
    • Set height.
    • Set color.
    • Set rounding of corners.
    • Constructor Detail

      • Rectangle

        public Rectangle()
    • Method Detail

      • withPosX

        public Image.Rectangle withPosX​(int posX)
        Sets the position on the X (horizontal) axis for the image.
        The value can be both negative and positive.
        Specified by:
        withPosX in class Image
        Parameters:
        posX - The positive, horizontal position of the image.
        Returns:
        The Square instance. Useful for chaining.
      • withPosY

        public Image.Rectangle withPosY​(int posY)
        Sets the position on the Y (vertical) axis for the image.
        The value can be both negative and positive.
        Specified by:
        withPosY in class Image
        Parameters:
        posY - The positive, vertical position of the image.
        Returns:
        The Square instance. Useful for chaining.
      • withWidth

        public Image.Rectangle withWidth​(int width)
        Sets the width of the Image.

        An IllegalArgumentException may be thrown in the following case:

        • Width is less than 1 or larger than 3000.
        Specified by:
        withWidth in class Image
        Parameters:
        width - The width of the image.
        Returns:
        The Square instance. Useful for chaining.
      • withHeight

        public Image.Rectangle withHeight​(int height)
        Sets the height of the Image.

        An IllegalArgumentException may be thrown in the following case:

        • Height is less than 1 or larger than 3000.
        Specified by:
        withHeight in class Image
        Parameters:
        height - The height of the image.
        Returns:
        The Square instance. Useful for chaining.
      • withColor

        public Image.Rectangle withColor​(@NotNull
                                         @NotNull ColorObject color)
        Sets the color to use for the image.
        Please see the documentation of the ColorObject for possible errors and limitations.
        Specified by:
        withColor in class Image
        Parameters:
        color - The ColorObject to use.
        Returns:
        The Rectangle instance. Useful for chaining.
      • withRound

        public Image.Rectangle withRound​(int round)
        Sets the round for the corners of the Rectangle.
        Parameters:
        round - How round the corners should be
        Returns:
        This Rectangle instance. Useful for chaining.