Package: groovy.console.ui

## [Groovy] Class Icons.DynamicSVGIcon

- groovy.console.ui.Icons.DynamicSVGIcon

- All Implemented Interfaces and Traits:
    Icon

      static class Icons.DynamicSVGIcon
      extends Object
      implements Icon

  Icon proxy whose inner FlatSVGIcon can be rebuilt at a new size without changing the outer reference held by Swing components.

  Since:
    6.0.0

- - ### Constructor Summary

    Constructors
    Constructor and description
    `DynamicSVGIcon(String path, int size, Closure<Color> colorMapper)` Creates a dynamic icon wrapper for the given SVG resource.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `int` | `getIconHeight()` Returns the current icon height in pixels.
    `` | `int` | `getIconWidth()` Returns the current icon width in pixels.
    `` | `void` | `paintIcon(Component c, Graphics g, int x, int y)` Paints the enabled or disabled delegate icon for the target component.
    `` | `void` | `refreshColors()` Rebuilds this icon so it adopts current theme colours.
    `` | `void` | `setSize(int newSize)` Rebuilds this icon at a new square size.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DynamicSVGIcon(String path, int size, Closure<Color> colorMapper)

      Creates a dynamic icon wrapper for the given SVG resource.

      Parameters:
        `path` - the classpath-relative SVG resource path
        `size` - the initial square icon size in pixels
        `colorMapper` - the color filter applied to the loaded icon

  - ### Method Detail

    - #### @Override
      int getIconHeight()

      Returns the current icon height in pixels.

    - #### @Override
      int getIconWidth()

      Returns the current icon width in pixels.

    - #### @Override
      void paintIcon(Component c, Graphics g, int x, int y)

      Paints the enabled or disabled delegate icon for the target component.

    - #### void refreshColors()

      Rebuilds this icon so it adopts current theme colours.

    - #### void setSize(int newSize)

      Rebuilds this icon at a new square size.