Class BasicThumbnail.Image

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


    public static class BasicThumbnail.Image
    extends Object
    implements BasicThumbnail.Layer
    This layer paints the actual scaled source image. This layer has no insets, but it does have an optional background color and curvature.
    • Field Summary

      Fields

      Modifier and Type Field and Description
      Color color
      An optional color to paint below this image.
      int curvature
      The curvature to apply to the borders of the scaled image.
    • Constructor Summary

      Constructors

      Constructor and Description
      Image()
      Create an Image with a white background and zero curvature.
      Image(Color color, int curvature)
      Create an Image.
    • Field Detail

      • color

        public final Color color
        An optional color to paint below this image.
      • curvature

        public final int curvature
        The curvature to apply to the borders of the scaled image.
    • Constructor Detail

      • Image

        public Image()
        Create an Image with a white background and zero curvature.
      • Image

        public Image(Color color,
                     int curvature)
        Create an Image.
        Parameters:
        color - the optional background color (may be null)
        curvature - the curvature.
    • Method Detail

      • equals

        public boolean equals(Object obj)
      • hashCode

        public int hashCode()
      • toString

        public String toString()
      • getInsets

        public Insets getInsets()
        Description copied from interface: BasicThumbnail.Layer
        Return the size of this layer. Note that rounded corners may fall outside of these insets; that is why it is important that these layers always be painted in the correct z-order to achieve the right result.
      • paint

        public void paint(Graphics2D g,
                          int x,
                          int y,
                          int width,
                          int height)
        If a background color was provided: this paints that background. This method is not capable of painting the scaled image, though.
        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.