Package com.github.weisj.darklaf.icons
Class DerivableImageIcon
java.lang.Object
com.github.weisj.darklaf.icons.DerivableImageIcon
- All Implemented Interfaces:
DerivableIcon<DerivableImageIcon>,ImageSource,Accessible,Icon
public class DerivableImageIcon
extends Object
implements DerivableIcon<DerivableImageIcon>, ImageSource, Accessible
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDerivableImageIcon(DerivableImageIcon parent, int width, int height)DerivableImageIcon(Image img)Create a new derivable image.DerivableImageIcon(Image img, int scalingMode)Create a new derivable image icon with specified scalingMode.DerivableImageIcon(Image img, int width, int height)Create a new derivable image icon with default scalingMode.DerivableImageIcon(Image img, int width, int height, int scalingMode)Create a new derivable image icon with specified scalingMode.DerivableImageIcon(String imagePath)Create a new derivable image icon.DerivableImageIcon(String imagePath, int width, int height)Create a new derivable image icon.DerivableImageIcon(String imagePath, int width, int height, int scalingMode)Create a new derivable image icon.DerivableImageIcon(URL url)Create a new derivable image icon.DerivableImageIcon(URL url, int width, int height)Create a new derivable image icon.DerivableImageIcon(URL url, int width, int height, int scalingMode)Create a new derivable image icon.DerivableImageIcon(Supplier<Image> imageSupplier)DerivableImageIcon(Supplier<Image> imageSupplier, int width, int height)DerivableImageIcon(Supplier<Image> imageSupplier, int width, int height, int scalingMode)DerivableImageIcon(ImageIcon icon)Create a new derivable image icon.DerivableImageIcon(ImageIcon icon, int scalingMode)Create a new derivable image icon with specified scalingMode.DerivableImageIcon(ImageIcon icon, int width, int height)Create a new derivable image icon with specified scalingMode.DerivableImageIcon(ImageIcon icon, int width, int height, int scalingMode)Create a new derivable image icon with specified scalingMode. -
Method Summary
Modifier and TypeMethodDescriptioncreateImage(Dimension size)derive(int width, int height)Derive a new icon with the specified size.Gets the description of the image.intintgetImage()Get the underlyingImage.getImage(ImageObserver observer)Get the underlyingImage.protected ImagevoidvoidsetDescription(String description)Sets the description of the image.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.github.weisj.darklaf.icons.DerivableIcon
copyMethods inherited from interface com.github.weisj.darklaf.icons.ImageSource
createImage
-
Constructor Details
-
DerivableImageIcon
Create a new derivable image icon.- Parameters:
imagePath- the image path.
-
DerivableImageIcon
Create a new derivable image icon.- Parameters:
imagePath- the image path.width- the icon width.height- the icon height.
-
DerivableImageIcon
Create a new derivable image icon.- Parameters:
imagePath- the image path.width- the icon width.height- the icon height.scalingMode- One ofImage.SCALE_DEFAULT,Image.SCALE_FAST,Image.SCALE_REPLICATE,Image.SCALE_AREA_AVERAGING,Image.SCALE_SMOOTH
-
DerivableImageIcon
Create a new derivable image icon.- Parameters:
url- the url to load the image from.
-
DerivableImageIcon
Create a new derivable image icon.- Parameters:
url- the url to load the image from.width- the icon width.height- the icon height.
-
DerivableImageIcon
Create a new derivable image icon.- Parameters:
url- the url to load the image from.width- the icon width.height- the icon height.scalingMode- One ofImage.SCALE_DEFAULT,Image.SCALE_FAST,Image.SCALE_REPLICATE,Image.SCALE_AREA_AVERAGING,Image.SCALE_SMOOTH
-
DerivableImageIcon
-
DerivableImageIcon
-
DerivableImageIcon
-
DerivableImageIcon
Create a new derivable image icon.- Parameters:
icon- the source image icon.
-
DerivableImageIcon
Create a new derivable image icon with specified scalingMode.- Parameters:
icon- the source icon.scalingMode- One ofImage.SCALE_DEFAULT,Image.SCALE_FAST,Image.SCALE_REPLICATE,Image.SCALE_AREA_AVERAGING,Image.SCALE_SMOOTH
-
DerivableImageIcon
Create a new derivable image icon with specified scalingMode.- Parameters:
icon- the source icon.width- the icon width.height- the icon height.
-
DerivableImageIcon
Create a new derivable image icon with specified scalingMode. If the source image doesnt match the specified dimensions it will be scaled accordingly.- Parameters:
icon- the source icon.width- the icon width.height- the icon height.scalingMode- One ofImage.SCALE_DEFAULT,Image.SCALE_FAST,Image.SCALE_REPLICATE,Image.SCALE_AREA_AVERAGING,Image.SCALE_SMOOTH
-
DerivableImageIcon
Create a new derivable image.- Parameters:
img- the source image.
-
DerivableImageIcon
Create a new derivable image icon with specified scalingMode.- Parameters:
img- the source image.scalingMode- One ofImage.SCALE_DEFAULT,Image.SCALE_FAST,Image.SCALE_REPLICATE,Image.SCALE_AREA_AVERAGING,Image.SCALE_SMOOTH
-
DerivableImageIcon
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
Create a new derivable image icon with specified 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.scalingMode- One ofImage.SCALE_DEFAULT,Image.SCALE_FAST,Image.SCALE_REPLICATE,Image.SCALE_AREA_AVERAGING,Image.SCALE_SMOOTH
-
DerivableImageIcon
-
-
Method Details
-
derive
Description copied from interface:DerivableIconDerive a new icon with the specified size.- Specified by:
derivein interfaceDerivableIcon<DerivableImageIcon>- Parameters:
width- the new widthheight- the new height.- Returns:
- the derived icon.
-
paintIcon
-
getImage
Get the underlyingImage.- Returns:
- the image.
-
getImage
Get the underlyingImage.- Parameters:
observer- theImageObserver.- Returns:
- the image.
-
getOriginal
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidthin interfaceIcon
-
getIconHeight
public int getIconHeight()- Specified by:
getIconHeightin interfaceIcon
-
getAccessibleContext
- Specified by:
getAccessibleContextin interfaceAccessible
-
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
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
-
createImage
- Specified by:
createImagein interfaceImageSource
-