Class BlankIcon

  • All Implemented Interfaces:
    ThemedIcon, javax.swing.Icon

    public class BlankIcon
    extends java.lang.Object
    implements ThemedIcon
    An icon that takes up space but paints nothing.
    Author:
    Chris Jennings
    • Constructor Detail

      • BlankIcon

        public BlankIcon()
        Creates a 16x16 blank icon.
      • BlankIcon

        public BlankIcon​(int size)
        Creates a blank icon with equal width and height.
        Parameters:
        size - the width and height of the icon
      • BlankIcon

        public BlankIcon​(int width,
                         int height)
        Creates a blank icon with the given width and height.
        Parameters:
        width - the width of the icon
        height - the height of the icon
    • Method Detail

      • getIconHeight

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

        public int getIconWidth()
        Specified by:
        getIconWidth in interface javax.swing.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
      • derive

        public ThemedIcon derive​(int newWidth,
                                 int newHeight)
        Description copied from interface: ThemedIcon
        Returns a new icon that renders the same image as this icon, but at a different size.
        Specified by:
        derive in interface ThemedIcon
        Parameters:
        newWidth - the new width ≥ 1
        newHeight - the new height ≥ 1
        Returns:
        an icon with the revised dimensions
      • disabled

        public ThemedIcon disabled()
        Description copied from interface: ThemedIcon
        Returns a new icon that renders the same image as this icon, but as if for a permanently disabled component.
        Specified by:
        disabled in interface ThemedIcon
        Returns:
        a disabled verison of the icon