Class BasicThumbnail.Shadow

  • All Implemented Interfaces:
    BasicThumbnail.Layer
    Enclosing class:
    BasicThumbnail


    public static class BasicThumbnail.Shadow
    extends Object
    implements BasicThumbnail.Layer
    This is a set of concentric rounded rectangles used to paint a shadow. These are painted as strokes of varying thickness around the same target rectangle, so each new ring overlaps all previous rings as the thickness grows.
    • Field Detail

      • ringOpacities

        public final int[] ringOpacities
        The opacities of each ring, starting with the innermost ring.

        Each ring is solid black with a varying level of opacity.

      • innerCurvature

        public final int innerCurvature
        The curvature if the innermost ring.
      • outerCurvature

        public final int outerCurvature
        The curvature if the outermost ring.
    • Constructor Detail

      • Shadow

        public Shadow(int[] ringOpacities,
                      int innerCurvature,
                      int outerCurvature)
        Create a new Shadow object.
        Parameters:
        ringOpacities - the opacities of each ring, starting with the innermost ring, from [0, 255]
        innerCurvature - the curvature of the innermost ring.
        outerCurvature - the curvature of the outermost ring.
    • Method Detail

      • equals

        public boolean equals(Object obj)
      • hashCode

        public int hashCode()
      • toString

        public String toString()
      • getInsets

        public Insets getInsets()
        The number of ring opacities is the thickness on all sides of this layer.
      • paint

        public void paint(Graphics2D g,
                          int x,
                          int y,
                          int width,
                          int height)
        Description copied from interface: BasicThumbnail.Layer
        Paint this layer.
        Specified by:
        paint in interface  BasicThumbnail.Layer
        Parameters:
        g - the graphics to paint to.
        x - the left edge of the area to paint.
        y - the top edge of the area to paint.
        width - the width of the area to paint.
        height - the height of the area to paint.