Class SwingImageIcon

java.lang.Object
javax.swing.ImageIcon
com.nomagic.ui.SwingImageIcon
All Implemented Interfaces:
ResizableIcon, Serializable, Cloneable, Accessible, Icon

@OpenApiAll @Deprecated public class SwingImageIcon extends ImageIcon implements Serializable, ResizableIcon
Deprecated.
Extended version of javax.swing.ImageIcon with some utility methods.
See Also:
  • Constructor Details

    • SwingImageIcon

      public SwingImageIcon(Image image)
      Deprecated.
      Constructs a new ImageIcon instance.
    • SwingImageIcon

      public SwingImageIcon(byte[] imageData, String description)
      Deprecated.
      Construct icon from image data
      Parameters:
      imageData - image data
      description - description
    • SwingImageIcon

      public SwingImageIcon(String file)
      Deprecated.
      Construct image from file
      Parameters:
      file - file
    • SwingImageIcon

      public SwingImageIcon(URL url)
      Deprecated.
      Construct image from url
      Parameters:
      url - url
    • SwingImageIcon

      public SwingImageIcon(Class clazz, String location)
      Deprecated.
      Construct image from resources available to class loader of given class at given location
      Parameters:
      clazz - class
      location - location
    • SwingImageIcon

      public SwingImageIcon(Class clazz, String location, boolean silent)
      Deprecated.
      Construct image from resources available to class loader of given class at given location
      Parameters:
      clazz - class
      location - location
      silent - if true, does not report to log file about missing icon at given location
  • Method Details

    • paintIcon

      public void paintIcon(Component c, Graphics g, int x, int y, int w, int h)
      Deprecated.
      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.
    • getLocation

      public String getLocation()
      Deprecated.
      Returns:
      location
    • getURL

      public URL getURL()
      Deprecated.
      Returns:
      url
    • clone

      public Object clone()
      Deprecated.
      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.
    • createScaledInstance

      public static ResizableIcon createScaledInstance(ResizableIcon icon, int size)
      Deprecated.
      Utility method to create a scaled instance of given icon
      Parameters:
      icon - icon
      size - size
      Returns:
      scaled icon
    • createScaledInstance

      public static Icon createScaledInstance(Icon icon, int size)
      Deprecated.
      Utility method to create a scaled instance of given icon
      Parameters:
      icon - icon
      size - size
      Returns:
      scaled icon
    • createImageIcon

      public static ImageIcon createImageIcon(@CheckForNull Component component, @Nonnull Icon icon)
      Deprecated.
      Utility method to create an image icon from given icon
      Parameters:
      component - owner of icon
      icon - icon
      Returns:
      scaled icon
    • createImageIcon

      public static ImageIcon createImageIcon(Icon icon, int width, int height)
      Deprecated.
      Create image icon of given size from given icon
      Parameters:
      icon - icon
      width - width
      height - height
      Returns:
      image icon
    • createImageIcon

      public static ImageIcon createImageIcon(ResizableIcon icon, int width, int height)
      Deprecated.
      Create image icon of given size from given icon
      Parameters:
      icon - icon
      width - width
      height - height
      Returns:
      image icon