Interface SVGIcons


public interface SVGIcons
Manages SVG icons for ui components. color() follows the 'Button.foreground' color of the current Look and feel. Add icons via put(String, URL) or put(String, SVGIcon) and retrieve them via get(String).
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final PropertyValue<Color>
    The default icon color.
  • Method Summary

    Modifier and Type
    Method
    Description
    Follows the 'Button.foreground' color of the current Look and feel.
    get(String identifier)
    Retrieves the icon associated with the given ikon from this Icons instance.
    void
    put(String identifier, SVGIcon icon)
    Adds the given icon to this SVGIcons instance.
    void
    put(String identifier, URL svgUrl)
    Adds the given icon to this Icons instance, using size() and color().
    int
     
    static SVGIcons
    svgIcons(int size)
     
  • Field Details

    • COLOR

      static final PropertyValue<Color> COLOR
      The default icon color.
      • Value type: Color
      • Default value: UIManager.getColor("Button.foreground")
  • Method Details

    • color

      Value<Color> color()
      Follows the 'Button.foreground' color of the current Look and feel.
      Returns:
      the Value controlling the icon color
    • size

      int size()
      Returns:
      the icon size
    • put

      void put(String identifier, URL svgUrl)
      Adds the given icon to this Icons instance, using size() and color(). Retrieve an icon via get(String).
      Parameters:
      identifier - the icon identifier
      svgUrl - the svg resource url
      Throws:
      IllegalArgumentException - in case an icon has already been associated with the given identifier
    • put

      void put(String identifier, SVGIcon icon)
      Adds the given icon to this SVGIcons instance. Retrieve an icon via get(String).
      Parameters:
      identifier - the icon identifier
      icon - the icon
      Throws:
      IllegalArgumentException - in case an icon has already been associated with the given identifier
    • get

      SVGIcon get(String identifier)
      Retrieves the icon associated with the given ikon from this Icons instance.
      Parameters:
      identifier - the icon identifier
      Returns:
      the SVGIcon associated with the given identifier
      Throws:
      IllegalArgumentException - in case no icon has been associated with the given identifier
    • svgIcons

      static SVGIcons svgIcons(int size)
      Parameters:
      size - the icon size
      Returns:
      a new SVGIcons instance