Class ReflectedImageLabel

    • Constructor Detail

      • ReflectedImageLabel

        public ReflectedImageLabel​(Image image,
                                   int width,
                                   int height)
        Deprecated.
        This function will be removed, use setNeutralWidth() on JCarousel instead.
        Creates a new instance from the supplied image object
        Parameters:
        image - The Image object
        width - The prefered width of the image when rendered by a rich container
        height - The prefered heightof the image when rendered by a rich container
      • ReflectedImageLabel

        public ReflectedImageLabel​(Image image,
                                   String text,
                                   int width,
                                   int height)
        Deprecated.
        This function will be removed, use setNeutralWidth() on JCarousel instead.
        Creates a new instance of a reflected label for the supplied image, also setting the text to be associated with the image.
        Parameters:
        image - The image
        text - The text label
        width - The prefered width of the image when rendered by a rich container
        height - The prefered height of the image when rendered by a rich container
      • ReflectedImageLabel

        public ReflectedImageLabel​(Image image,
                                   String text)
        Creates a new instance of a reflected label using the supplied image and text
        Parameters:
        image - The image to be used
        text - The text to be displayed
      • ReflectedImageLabel

        public ReflectedImageLabel​(String imageURL)
        See constructor for image label, this version of the constructor takes an image URL instead of the image object (the URL can be in string format).
        Parameters:
        imageURL - A URL (in string form) of the image.
      • ReflectedImageLabel

        public ReflectedImageLabel​(String imageURL,
                                   int width,
                                   int height)
        Deprecated.
        This function will be removed, use setNeutralWidth() on JCarousel instead.
        Creates a new instance, setting the width and the height that may be used by the RichContainer
        Parameters:
        imageURL - The URL of the image (String form)
        width - The prefered width of the image when rendered by a rich container
        height - The prefered height of the image when rendered by a rich container
      • ReflectedImageLabel

        public ReflectedImageLabel​(String imageURL,
                                   String text,
                                   int width,
                                   int height)
        Deprecated.
        This function will be removed, use setNeutralWidth() on JCarousel instead.
        Creates a new instance, using the image specified in the URL string, the prefered dimensions and sets the Rich text as well
        Parameters:
        imageURL - The URL of the image in text form
        text - The RichText to be displayed
        width - The prefered width of the image when rendered by a rich container
        height - The prefered height of the image when rendered by a rich container
    • Method Detail

      • setLabel

        public void setLabel​(String text)
        Deprecated.
        Use setRichText() instead
        Depricated.
        Parameters:
        text - The rich text
      • setupImage

        protected void setupImage​(Image image)
        Adds a reflection to the supplied image
        Parameters:
        image - The image object to use to pre-render the reflection
      • setAlpha

        public void setAlpha​(float alphaLevel)
        Sets the transparency of the component
        Specified by:
        setAlpha in interface RichComponent
        Parameters:
        alphaLevel - The alpha level of the object
        See Also:
        RichComponent
      • setImage

        public void setImage​(Image image)
        Deprecated.
        Please use setRichImage() instead from the RichComponent interface
        Deprecated
        Parameters:
        image - An image object to use (reflection will be added)
        See Also:
        RichComponent
      • getPreferredSize

        public Dimension getPreferredSize()
        Overrides the default getPreferedSize() which has been controlled by the created image and adds 50% onto the height to allow for the reflection.
        Overrides:
        getPreferredSize in class JComponent
        Returns:
        The prefered dimensions of the component
      • paintComponent

        public void paintComponent​(Graphics graphics)
        Paints the component
        Overrides:
        paintComponent in class JComponent
        Parameters:
        graphics - The graphics context
      • setRichImage

        public void setRichImage​(URL image)
        Assigns an image to the component, the width and height taken from the supplied image
        Specified by:
        setRichImage in interface RichComponent
        Parameters:
        image - The URL of the image