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
  • Constructor Details

    • 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 Details

    • derive

      public DarkSVGIcon derive(int width, int height)
      Description copied from interface: DerivableIcon
      Derive a new icon with the specified size.
      Specified by:
      derive in interface DerivableIcon<DarkSVGIcon>
      Parameters:
      width - the new width
      height - the new height.
      Returns:
      the derived icon.
    • setDisplaySize

      public void setDisplaySize(int width, int height)
    • paintIcon

      public void paintIcon(Component c, Graphics g, int x, int y)
      Specified by:
      paintIcon in interface Icon
    • 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:
      createImage in interface ImageSource
    • getName

      protected String getName(URI uri)
    • 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: RotateIcon
      Paint the icon with rotation.
      Specified by:
      paintIcon in interface RotateIcon
      Parameters:
      c - the parent component.
      g - the graphics object.
      x - the x coordinate
      y - the y coordinate
      rotation - the rotation in radians.
    • isDirectRenderingMode

      public boolean isDirectRenderingMode()
    • setDirectRenderingMode

      public void setDirectRenderingMode(boolean directRendering)
    • getIconWidth

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

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

      protected Dimension getSize()
    • getSVGIcon

      public com.kitfox.svg.app.beans.SVGIcon getSVGIcon()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getVisualPaddings

      @NotNull public @NotNull Insets getVisualPaddings(@NotNull @NotNull Component component)
      Specified by:
      getVisualPaddings in interface com.github.weisj.swingdsl.visualpadding.VisualPaddingProvider