Class ThemedCompoundIcon

  • All Implemented Interfaces:
    ThemedIcon, javax.swing.Icon
    Direct Known Subclasses:
    TaskIcon

    public class ThemedCompoundIcon
    extends java.lang.Object
    implements ThemedIcon
    Icon that paints a pair of icons overtop of each other.
    Author:
    Chris Jennings
    • Constructor Detail

      • ThemedCompoundIcon

        public ThemedCompoundIcon​(ThemedIcon bottom,
                                  ThemedIcon top)
        Create a compound icon from a pair of icons.
        Parameters:
        bottom - the icon to paint first
        top - the icon to paint over the bottom icon
      • ThemedCompoundIcon

        public ThemedCompoundIcon​(java.lang.String bottom,
                                  java.lang.String top)
        Create a compound icon from a pair of icon to be fetched with ResourceKit.getIcon(java.lang.String).
        Parameters:
        bottom - the icon to paint first
        top - the icon to paint over the bottom icon
    • Method Detail

      • derive

        public ThemedIcon derive​(int width,
                                 int height)
        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:
        width - the new width ≥ 1
        height - 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
      • paintIcon

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

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

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