Class ResizableIconAdapter

  • All Implemented Interfaces:
    ResizableIcon, java.lang.Cloneable, javax.swing.Icon

    @OpenApiAll
    public final class ResizableIconAdapter
    extends java.lang.Object
    implements ResizableIcon
    An adapter of simple Icon to a ResizableIcon
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Returns cloned instance of this icon.
      int getIconHeight()  
      int getIconWidth()  
      void paintIcon​(java.awt.Component c, java.awt.Graphics g, int x, int y)  
      void paintIcon​(java.awt.Component c, java.awt.Graphics g, int x, int y, int w, int h)
      Draw the icon in the given bounds.
      static ResizableIcon toResizableIcon​(javax.swing.Icon icon)
      Create an adapter for a given icon.
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • toResizableIcon

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

        public void paintIcon​(java.awt.Component c,
                              java.awt.Graphics g,
                              int x,
                              int y)
        Specified by:
        paintIcon in interface javax.swing.Icon
      • paintIcon

        public void paintIcon​(@CheckForNull
                              java.awt.Component c,
                              java.awt.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 java.lang.Object clone()
        Description copied from interface: ResizableIcon
        Returns cloned instance of this icon.
        Specified by:
        clone in interface ResizableIcon
        Overrides:
        clone in class java.lang.Object
        Returns:
        cloned instance.
      • getIconWidth

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

        public int getIconHeight()
        Specified by:
        getIconHeight in interface javax.swing.Icon