Class DarkSVGIcon
java.lang.Object
com.github.weisj.darklaf.properties.icons.DarkSVGIcon
- All Implemented Interfaces:
DerivableIcon<DarkSVGIcon>,IconLoader.CacheableIcon,ImageSource,RotateIcon,com.github.weisj.darklaf.util.cache.SoftCache.Cacheable<com.github.weisj.darklaf.properties.icons.IconLoader.IconKey>,com.github.weisj.swingdsl.visualpadding.VisualPaddingProvider,Serializable,Icon
- Direct Known Subclasses:
ThemedSVGIcon
public class DarkSVGIcon
extends Object
implements DerivableIcon<DarkSVGIcon>, IconLoader.CacheableIcon, RotateIcon, Serializable, ImageSource, com.github.weisj.swingdsl.visualpadding.VisualPaddingProvider
Icon from SVG image.
- Since:
- 2019
- See Also:
-
Field Summary
Fields inherited from interface com.github.weisj.swingdsl.visualpadding.VisualPaddingProvider
VISUAL_PADDING_PROP -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDarkSVGIcon(int width, int height, DarkSVGIcon parent) DarkSVGIcon(@NotNull URI uri, int displayWidth, int displayHeight) Method to fetch the SVG icon from an url. -
Method Summary
Modifier and TypeMethodDescriptioncreateImage(Dimension size) protected @NotNull com.github.weisj.jsvg.parser.ParserProviderderive(int width, int height) Derive a new icon with the specified size.protected voidensureImageLoaded(Component c, double rotation) protected booleanensureLoaded(boolean painting) intintprotected Stringprotected DimensiongetSize()com.github.weisj.jsvg.SVGDocumentgetURI()@NotNull InsetsgetVisualPaddings(@NotNull Component component) booleanvoidvoidPaint the icon with rotation.voidsetCacheKey(com.github.weisj.darklaf.properties.icons.IconLoader.IconKey key) voidsetDirectRenderingMode(boolean directRendering) voidsetDisplaySize(int width, int height) toString()protected voidupdateCache(boolean update, Component c) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.weisj.darklaf.properties.icons.DerivableIcon
copyMethods inherited from interface com.github.weisj.darklaf.properties.icons.ImageSource
createImage
-
Constructor Details
-
DarkSVGIcon
Method to fetch the SVG icon from an url.- Parameters:
uri- the svg uri.displayWidth- display width of icon.displayHeight- display height of icon.
-
DarkSVGIcon
-
-
Method Details
-
setCacheKey
public void setCacheKey(com.github.weisj.darklaf.properties.icons.IconLoader.IconKey key) - Specified by:
setCacheKeyin interfacecom.github.weisj.darklaf.util.cache.SoftCache.Cacheable<com.github.weisj.darklaf.properties.icons.IconLoader.IconKey>
-
derive
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) -
paintIcon
-
ensureLoaded
protected boolean ensureLoaded(boolean painting) -
createParserProvider
@NotNull protected @NotNull com.github.weisj.jsvg.parser.ParserProvider createParserProvider() -
updateCache
-
createImage
- Specified by:
createImagein interfaceImageSource
-
getName
-
ensureImageLoaded
-
paintIcon
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
-
getSize
-
getSVGDocument
public com.github.weisj.jsvg.SVGDocument getSVGDocument() -
getVisualPaddings
- Specified by:
getVisualPaddingsin interfacecom.github.weisj.swingdsl.visualpadding.VisualPaddingProvider
-
getURI
-
toString
-