Class ColorResizableIcon

  • All Implemented Interfaces:
    javax.swing.Icon, org.pushingpixels.neon.api.icon.ResizableIcon


    public class ColorResizableIcon
    extends java.lang.Object
    implements org.pushingpixels.neon.api.icon.ResizableIcon
    Implementation of ResizableIcon that fills the icon with a solid color.
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.pushingpixels.neon.api.icon.ResizableIcon

        org.pushingpixels.neon.api.icon.ResizableIcon.Factory
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected int height
      The current icon height.
      protected int width
      The current icon width.
    • Constructor Summary

      Constructors 
      Constructor Description
      ColorResizableIcon​(int initialDim, java.awt.Color color)
      Creates a new empty color icon of the specified size and color.
      ColorResizableIcon​(java.awt.Dimension initialDim, java.awt.Color color)
      Creates a new empty color icon of the specified size and color.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static org.pushingpixels.neon.api.icon.ResizableIcon.Factory factory​(java.awt.Color color)  
      int getIconHeight​()  
      int getIconWidth​()  
      void paintIcon​(java.awt.Component c, java.awt.Graphics g, int x, int y)  
      void setDimension​(java.awt.Dimension newDimension)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.pushingpixels.neon.api.icon.ResizableIcon

        toImage
    • Field Detail

      • width

        protected int width
        The current icon width.
      • height

        protected int height
        The current icon height.
    • Constructor Detail

      • ColorResizableIcon

        public ColorResizableIcon​(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.
      • ColorResizableIcon

        public ColorResizableIcon​(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)
        Specified by:
        setDimension in interface org.pushingpixels.neon.api.icon.ResizableIcon
      • 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
      • factory

        public static org.pushingpixels.neon.api.icon.ResizableIcon.Factory factory​(java.awt.Color color)