@Override
	default void paintIcon( Component c, Graphics g, int x, int y ) {
		AnimationSupport.paintIcon( this, c, g, x, y );
	}
Icon that automatically animates painting on component value changes.
<p>
{@link #getValue(Component)} returns the value of the component.
If the value changes, then {@link #paintIconAnimated(Component, Graphics, int, int, float)}
is invoked multiple times with animated value (from old value to new value).
<p>
Example for an animated icon:
<pre>
private class AnimatedMinimalTestIcon
    implements AnimatedIcon
{
    &#64;Override public int getIconWidth() { return 100; }
    &#64;Override public int getIconHeight() { return 20; }

    &#64;Override
    public void paintIconAnimated( Component c, Graphics g, int x, int y, float animatedValue ) {
        int w = getIconWidth();
        int h = getIconHeight();

        g.setColor( Color.red );
        g.drawRect( x, y, w - 1, h - 1 );
        g.fillRect( x, y, Math.round( w * animatedValue ), h );
    }

    &#64;Override
    public float getValue( Component c ) {
        return ((AbstractButton)c).isSelected() ? 1 : 0;
    }
}

// sample usage
JCheckBox checkBox = new JCheckBox( "test" );
checkBox.setIcon( new AnimatedMinimalTestIcon() );
</pre>

Animation works only if the component passed to {@link #paintIcon(Component, Graphics, int, int)}
is an instance of {@link JComponent}.
A client property is set on the component to store the animation state.

@author Karl Tauber
flatlaf-core/src/main/java/com/formdev/flatlaf/util/AnimatedIcon.java