Class ResizableIconAdapter

java.lang.Object
com.nomagic.ui.ResizableIconAdapter
All Implemented Interfaces:
ResizableIcon, Cloneable, Icon

@OpenApiAll public final class ResizableIconAdapter extends Object implements ResizableIcon
An adapter of simple Icon to a ResizableIcon
  • Method Details

    • toResizableIcon

      public static ResizableIcon toResizableIcon(Icon icon)
      Create an adapter for a given icon.
      Parameters:
      icon - icon
      Returns:
      adapted icon
    • paintIcon

      public void paintIcon(Component c, Graphics g, int x, int y)
      Specified by:
      paintIcon in interface Icon
    • paintIcon

      public void paintIcon(@CheckForNull Component c, Graphics g, int x, int y, int w, int h)
      Description copied from interface: ResizableIcon
      Draw the icon in the given bounds. 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 ResizableIcon
      Parameters:
      c - the given component.
      g - the graphics to paint on.
      x - x coordinate.
      y - y coordinate.
      w - width to paint.
      h - height to paint.
    • clone

      public Object clone()
      Description copied from interface: ResizableIcon
      Returns cloned instance of this icon.
      Specified by:
      clone in interface ResizableIcon
      Overrides:
      clone in class Object
      Returns:
      cloned instance.
    • getIconWidth

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

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