Class DoubleSizeImageIcon

All Implemented Interfaces:
ResizableIcon, Serializable, Cloneable, Accessible, Icon

@OpenApiAll public class DoubleSizeImageIcon extends ScalableImageIcon
Icon combines two other icons and chooses which one to paint depending on graphics scaling. Large icon will be used if painting rectangle size is larger than size of small icon.
See Also:
  • Constructor Details

    • DoubleSizeImageIcon

      public DoubleSizeImageIcon(Icon smallIcon, @CheckForNull ResizableIcon largeIcon)
      Constructor.
      Parameters:
      smallIcon - small icon
      largeIcon - large icon
  • Method Details

    • paintIcon

      public void paintIcon(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
      Overrides:
      paintIcon in class ScalableImageIcon
      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.
    • getLargeIcon

      @CheckForNull public ResizableIcon getLargeIcon()
    • getSmallIcon

      public Icon getSmallIcon()
    • paintIcon

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