Class RoundedBorder

  • All Implemented Interfaces:
    Outline

    public class RoundedBorder
    extends java.lang.Object
    implements Outline
    Draws a uniform border with round corners.

    May be associated with RoundedBackground or used on its own.

    The corner radius and thickness are stored as a char for heap optimization and therefore cannot exceed 65535.

    This outline does not perform any drawing for thickness 0. The thickness of RoundedBorder (and therefore of its associated RoundedBackground) should be at least 1 to have some "anti-aliased" round corners.

    • Constructor Summary

      Constructors 
      Constructor Description
      RoundedBorder​(int color, int cornerRadius, int thickness)
      Creates a rounded border specifying its attributes.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void apply​(ej.microui.display.GraphicsContext g, Size size)
      Applies the outline on a graphics context.
      void apply​(Outlineable outlineable)
      Removes the thickness of this outline from the given object.
      boolean equals​(java.lang.Object obj)  
      int getColor()
      Gets the color.
      int getCornerRadius()
      Gets the corner radius.
      int getThickness()
      Gets the thickness.
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RoundedBorder

        public RoundedBorder​(int color,
                             int cornerRadius,
                             int thickness)
        Creates a rounded border specifying its attributes.

        The given corner radius and thickness are clamped between 0 and Character.MAX_VALUE.

        Parameters:
        color - the color.
        cornerRadius - the corner radius.
        thickness - the border thickness.
    • Method Detail

      • getColor

        public int getColor()
        Gets the color.
        Returns:
        the color.
      • getCornerRadius

        public int getCornerRadius()
        Gets the corner radius.
        Returns:
        the corner radius.
      • getThickness

        public int getThickness()
        Gets the thickness.
        Returns:
        the thickness.
      • apply

        public void apply​(Outlineable outlineable)
        Description copied from interface: Outline
        Removes the thickness of this outline from the given object.
        Specified by:
        apply in interface Outline
        Parameters:
        outlineable - the object to unwrap.
      • apply

        public void apply​(ej.microui.display.GraphicsContext g,
                          Size size)
        Description copied from interface: Outline
        Applies the outline on a graphics context.
        Specified by:
        apply in interface Outline
        Parameters:
        g - the graphics context.
        size - the size to apply on.
      • equals

        public boolean equals​(@Nullable
                              java.lang.Object obj)
        Specified by:
        equals in interface Outline
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface Outline
        Overrides:
        hashCode in class java.lang.Object