Package com.github.weisj.darklaf.icons
Class DarkSVGIcon
java.lang.Object
com.github.weisj.darklaf.icons.DarkSVGIcon
- All Implemented Interfaces:
DerivableIcon<DarkSVGIcon>,ImageSource,RotateIcon,com.github.weisj.swingdsl.visualpadding.VisualPaddingProvider,Serializable,Icon
- Direct Known Subclasses:
ThemedSVGIcon
public class DarkSVGIcon
extends Object
implements DerivableIcon<DarkSVGIcon>, RotateIcon, Serializable, ImageSource, com.github.weisj.swingdsl.visualpadding.VisualPaddingProvider
Icon from SVG image.
- Since:
- 2019
- See Also:
- Serialized Form
-
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(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
Modifier and TypeMethodDescriptioncreateImage(Dimension size)protected com.kitfox.svg.app.beans.SVGIconderive(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.kitfox.svg.app.beans.SVGIconprotected URIgetUri()@NotNull InsetsgetVisualPaddings(@NotNull Component component)booleanvoidvoidPaint the icon with rotation.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.icons.DerivableIcon
copyMethods inherited from interface com.github.weisj.darklaf.icons.ImageSource
createImage
-
Constructor Details
-
DarkSVGIcon
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
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
-
-
Method Details
-
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) -
getUri
-
updateCache
-
createImage
- Specified by:
createImagein interfaceImageSource
-
getName
-
ensureImageLoaded
-
createSVGIcon
protected com.kitfox.svg.app.beans.SVGIcon createSVGIcon() -
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
-
getSVGIcon
public com.kitfox.svg.app.beans.SVGIcon getSVGIcon() -
toString
-
getVisualPaddings
- Specified by:
getVisualPaddingsin interfacecom.github.weisj.swingdsl.visualpadding.VisualPaddingProvider
-