Package resources

Class MultiIcon

  • All Implemented Interfaces:
    javax.swing.Icon

    public class MultiIcon
    extends java.lang.Object
    implements javax.swing.Icon
    Icon class for for displaying overlapping icons. Icons are drawn in the order they are added.
    • Constructor Summary

      Constructors 
      Constructor Description
      MultiIcon​(javax.swing.Icon baseIcon)
      Constructs a new MultiIcon with an initial base icon that will always be drawn first.
      MultiIcon​(javax.swing.Icon baseIcon, boolean disabled)
      Constructs a new MultiIcon with an initial base icon that will always be drawn first.
      MultiIcon​(javax.swing.Icon baseIcon, boolean disabled, int width, int height)
      Construct a new MultiIcon with a predetermined size
      MultiIcon​(javax.swing.Icon baseIcon, javax.swing.Icon... icons)
      Construct a new MultiIcon with the provided base image and subsequent images
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addIcon​(javax.swing.Icon icon)
      Adds an icon that is to be drawn on top of the base icon and any other icons that have been added.
      java.lang.String getDescription()  
      int getIconHeight()  
      javax.swing.Icon[] getIcons()
      Return array of Icons that were added to this MultIcon.
      int getIconWidth()  
      void paintIcon​(java.awt.Component c, java.awt.Graphics g, int x, int y)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MultiIcon

        public MultiIcon​(javax.swing.Icon baseIcon)
        Constructs a new MultiIcon with an initial base icon that will always be drawn first.
        Parameters:
        baseIcon - the base icon that will always be drawn first.
      • MultiIcon

        public MultiIcon​(javax.swing.Icon baseIcon,
                         boolean disabled)
        Constructs a new MultiIcon with an initial base icon that will always be drawn first.
        Parameters:
        baseIcon - the base icon that will always be drawn first.
      • MultiIcon

        public MultiIcon​(javax.swing.Icon baseIcon,
                         javax.swing.Icon... icons)
        Construct a new MultiIcon with the provided base image and subsequent images
        Parameters:
        baseIcon - base image always drawn first
        icons - images drawn atop the base
      • MultiIcon

        public MultiIcon​(javax.swing.Icon baseIcon,
                         boolean disabled,
                         int width,
                         int height)
        Construct a new MultiIcon with a predetermined size
        Parameters:
        baseIcon - Primary icon that is always drawn first
        disabled - flag to draw this icon in a disabled state
        width - horizontal dimension of this icon
        height - vertical dimension of this icon
    • Method Detail

      • addIcon

        public void addIcon​(javax.swing.Icon icon)
        Adds an icon that is to be drawn on top of the base icon and any other icons that have been added.
        Parameters:
        icon - the icon to be added.
      • getDescription

        public java.lang.String getDescription()
      • getIconHeight

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

        public int getIconWidth()
        Specified by:
        getIconWidth in interface javax.swing.Icon
        See Also:
        Icon.getIconWidth()
      • paintIcon

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

        public javax.swing.Icon[] getIcons()
        Return array of Icons that were added to this MultIcon.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object