Package com.github.weisj.darklaf.icons
Class DarkSVGIcon
- java.lang.Object
-
- com.github.weisj.darklaf.icons.DarkSVGIcon
-
- All Implemented Interfaces:
DerivableIcon<DarkSVGIcon>,ImageSource,RotateIcon,Serializable,Icon
- Direct Known Subclasses:
ThemedSVGIcon
public class DarkSVGIcon extends Object implements DerivableIcon<DarkSVGIcon>, RotateIcon, Serializable, ImageSource
Icon from SVG image.- Since:
- 2019
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDarkSVGIcon(int width, int height, DarkSVGIcon parent)DarkSVGIcon(URI uri, int displayWidth, int displayHeight)Method to fetch the SVG icon from a url.DarkSVGIcon(Supplier<URI> uriSupplier, int displayWidth, int displayHeight)Method to fetch the SVG icon from a url.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImagecreateImage(Dimension size)protected com.kitfox.svg.app.beans.SVGIconcreateSVGIcon()DarkSVGIconderive(int width, int height)Derive a new icon with the specified size.protected voidensureImageLoaded(Component c, double rotation)protected booleanensureLoaded(boolean painting)intgetIconHeight()intgetIconWidth()protected StringgetName(URI uri)com.kitfox.svg.app.beans.SVGIcongetSVGIcon()protected URIgetUri()booleanisDirectRenderingMode()voidpaintIcon(Component c, Graphics g, int x, int y)voidpaintIcon(Component c, Graphics g, int x, int y, double rotation)Paint the icon with rotation.voidsetDirectRenderingMode(boolean directRendering)voidsetDisplaySize(int width, int height)protected voidupdateCache(boolean update, Component c)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.weisj.darklaf.icons.DerivableIcon
copy
-
Methods inherited from interface com.github.weisj.darklaf.icons.ImageSource
createImage
-
-
-
-
Constructor Detail
-
DarkSVGIcon
public DarkSVGIcon(Supplier<URI> uriSupplier, int displayWidth, int displayHeight)
Method to fetch the SVG icon from a url.- Parameters:
uriSupplier- supplier for the uri from which to fetch the SVG icon.displayWidth- display width of icon.displayHeight- display height of icon.
-
DarkSVGIcon
public DarkSVGIcon(URI uri, int displayWidth, int displayHeight)
Method to fetch the SVG icon from a url.- Parameters:
uri- the uri from which to fetch the SVG icon.displayWidth- display width of icon.displayHeight- display height of icon.
-
DarkSVGIcon
protected DarkSVGIcon(int width, int height, DarkSVGIcon parent)
-
-
Method Detail
-
derive
public DarkSVGIcon derive(int width, int height)
Description copied from interface:DerivableIconDerive a new icon with the specified size.- Specified by:
derivein interfaceDerivableIcon<DarkSVGIcon>- Parameters:
width- the new widthheight- the new height.- Returns:
- the derived icon.
-
setDisplaySize
public void setDisplaySize(int width, int height)
-
ensureLoaded
protected boolean ensureLoaded(boolean painting)
-
getUri
protected URI getUri()
-
updateCache
protected void updateCache(boolean update, Component c)
-
createImage
public Image createImage(Dimension size)
- Specified by:
createImagein interfaceImageSource
-
ensureImageLoaded
protected void ensureImageLoaded(Component c, double rotation)
-
createSVGIcon
protected com.kitfox.svg.app.beans.SVGIcon createSVGIcon()
-
paintIcon
public void paintIcon(Component c, Graphics g, int x, int y, double rotation)
Description copied from interface:RotateIconPaint the icon with rotation.- Specified by:
paintIconin interfaceRotateIcon- Parameters:
c- the parent component.g- the graphics object.x- the x coordinatey- the y coordinaterotation- the rotation in radians.
-
isDirectRenderingMode
public boolean isDirectRenderingMode()
-
setDirectRenderingMode
public void setDirectRenderingMode(boolean directRendering)
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfaceIcon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfaceIcon
-
getSVGIcon
public com.kitfox.svg.app.beans.SVGIcon getSVGIcon()
-
-