de.caff.vic

## Class ScaledIcon

- java.lang.Object
- - de.caff.vic.ScaledIcon

- All Implemented Interfaces:
    RecolorableIcon, javax.swing.Icon

      public class ScaledIcon
      extends java.lang.Object
      implements RecolorableIcon

  An icon based on a `vector image`.
  Author:
    Rammi

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ScaledIcon(VectorImage vectorImage, int width, int height)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getIconHeight()` Returns the icon's height.
    `int` | `getIconWidth()` Returns the icon's width.
    `RecolorableIcon` | `getRecoloredIcon(Function1<java.awt.Color,java.awt.Color> recolorer)` Get a recolored version of this icon.
    `void` | `paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)` Draw the icon at the specified location.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ScaledIcon

          public ScaledIcon(@NotNull
                            VectorImage vectorImage,
                            int width,
                            int height)

      Constructor.
      Parameters:
        `vectorImage` - vector image on which this icon is based
        `width` - screen width of icon in pixel
        `height` - screen height of icon in pixel

  - ### Method Detail

    - #### getRecoloredIcon

          @NotNull
          public RecolorableIcon getRecoloredIcon(@NotNull
                                                           Function1<java.awt.Color,java.awt.Color> recolorer)

      Description copied from interface: `RecolorableIcon`
      Get a recolored version of this icon.
      Specified by:
        `getRecoloredIcon` in interface `RecolorableIcon`
      Parameters:
        `recolorer` - recolor function which maps old colors into new colors
      Returns:
        recolored version of this icon

    - #### paintIcon

          public void paintIcon(@NotNull
                                java.awt.Component c,
                                @NotNull
                                java.awt.Graphics g,
                                int x,
                                int y)

      Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.
      Specified by:
        `paintIcon` in interface `javax.swing.Icon`
      Parameters:
        `c` - component to paint to
        `g` - graphics context to paint to
        `x` - x coordinate to paint to
        `y` - y coordinate to paint to

    - #### getIconWidth

          public int getIconWidth()

      Returns the icon's width.
      Specified by:
        `getIconWidth` in interface `javax.swing.Icon`
      Returns:
        an int specifying the fixed width of the icon.

    - #### getIconHeight

          public int getIconHeight()

      Returns the icon's height.
      Specified by:
        `getIconHeight` in interface `javax.swing.Icon`
      Returns:
        an int specifying the fixed height of the icon.