Class DynamicImageResource

    • Constructor Detail

      • DynamicImageResource

        public DynamicImageResource()
        Construct.
      • DynamicImageResource

        public DynamicImageResource​(java.lang.String format)
        Creates a dynamic resource from for the given locale
        Parameters:
        format - The image format ("png", "jpeg", etc)
    • Method Detail

      • getFormat

        public final java.lang.String getFormat()
        Returns:
        Returns the image format.
      • setFormat

        public final void setFormat​(java.lang.String format)
        Sets the format of this resource
        Parameters:
        format - The format (jpg, png or gif..)
      • setLastModifiedTime

        protected void setLastModifiedTime​(org.apache.wicket.util.time.Time time)
        set the last modified time for this resource.
        Parameters:
        time -
      • toImageData

        protected byte[] toImageData​(java.awt.image.BufferedImage image)
        Parameters:
        image - The image to turn into data
        Returns:
        The image data for this dynamic image
      • getImageData

        protected abstract byte[] getImageData​(IResource.Attributes attributes)
        Get image data for our dynamic image resource. If the subclass regenerates the data, it should set the setLastModifiedTime(Time) when it does so. This ensures that image caching works correctly.
        Parameters:
        attributes - the context bringing the request, response and the parameters
        Returns:
        The image data for this dynamic image. null means there is no image and 404 (Not found) response will be return.