Class ColorRadianceIcon

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

    public class ColorRadianceIcon
    extends java.lang.Object
    implements RadianceIcon
    Implementation of RadianceIcon that fills the icon with a solid color.
    • Field Detail

      • width

        protected int width
        The current icon width.
      • height

        protected int height
        The current icon height.
      • color

        private final java.awt.Color color
        Fill color
    • Constructor Detail

      • ColorRadianceIcon

        public ColorRadianceIcon​(java.awt.Dimension initialDim,
                                 java.awt.Color color)
        Creates a new empty color icon of the specified size and color.
        Parameters:
        initialDim - Initial dimension of the icon.
        color - fill color.
      • ColorRadianceIcon

        public ColorRadianceIcon​(int initialDim,
                                 java.awt.Color color)
        Creates a new empty color icon of the specified size and color.
        Parameters:
        initialDim - Initial dimension of the icon.
        color - fill color.
    • Method Detail

      • setDimension

        public void setDimension​(java.awt.Dimension newDimension)
        Description copied from interface: RadianceIcon
        Changes the dimension of this icon.
        Specified by:
        setDimension in interface RadianceIcon
        Parameters:
        newDimension - New dimension for this icon.
      • 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