Class DerivableImageIcon

    • Constructor Detail

      • DerivableImageIcon

        public DerivableImageIcon​(String imagePath)
        Create a new derivable image icon.
        Parameters:
        imagePath - the image path.
      • DerivableImageIcon

        public DerivableImageIcon​(String imagePath,
                                  int width,
                                  int height)
        Create a new derivable image icon.
        Parameters:
        imagePath - the image path.
        width - the icon width.
        height - the icon height.
      • DerivableImageIcon

        public DerivableImageIcon​(URL url)
        Create a new derivable image icon.
        Parameters:
        url - the url to load the image from.
      • DerivableImageIcon

        public DerivableImageIcon​(URL url,
                                  int width,
                                  int height)
        Create a new derivable image icon.
        Parameters:
        url - the url to load the image from.
        width - the icon width.
        height - the icon height.
      • DerivableImageIcon

        public DerivableImageIcon​(Supplier<Image> imageSupplier)
      • DerivableImageIcon

        public DerivableImageIcon​(Supplier<Image> imageSupplier,
                                  int width,
                                  int height)
      • DerivableImageIcon

        public DerivableImageIcon​(Supplier<Image> imageSupplier,
                                  int width,
                                  int height,
                                  int scalingMode)
      • DerivableImageIcon

        public DerivableImageIcon​(ImageIcon icon)
        Create a new derivable image icon.
        Parameters:
        icon - the source image icon.
      • DerivableImageIcon

        public DerivableImageIcon​(ImageIcon icon,
                                  int width,
                                  int height)
        Create a new derivable image icon with specified scalingMode.
        Parameters:
        icon - the source icon.
        width - the icon width.
        height - the icon height.
      • DerivableImageIcon

        public DerivableImageIcon​(Image img)
        Create a new derivable image.
        Parameters:
        img - the source image.
      • DerivableImageIcon

        public DerivableImageIcon​(Image img,
                                  int width,
                                  int height)
        Create a new derivable image icon with default scalingMode. If the source image doesnt match the specified dimensions it will be scaled accordingly.
        Parameters:
        img - the source image.
        width - the icon width.
        height - the icon height.
      • DerivableImageIcon

        protected DerivableImageIcon​(DerivableImageIcon parent,
                                     int width,
                                     int height)
    • Method Detail

      • getImage

        public Image getImage()
        Get the underlying Image.
        Returns:
        the image.
      • getOriginal

        protected Image getOriginal()
      • getIconWidth

        public int getIconWidth()
        Specified by:
        getIconWidth in interface Icon
      • getIconHeight

        public int getIconHeight()
        Specified by:
        getIconHeight in interface Icon
      • getDescription

        public String getDescription()
        Gets the description of the image. This is meant to be a brief textual description of the object. For example, it might be presented to a blind user to give an indication of the purpose of the image. The description may be null.
        Returns:
        a brief textual description of the image
      • setDescription

        public void setDescription​(String description)
        Sets the description of the image. This is meant to be a brief textual description of the object. For example, it might be presented to a blind user to give an indication of the purpose of the image.
        Parameters:
        description - a brief textual description of the image