Class PaintSampleIcon

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

    public class PaintSampleIcon
    extends AbstractThemedIcon
    Icon that shows what a paint looks like by using it to fill a shape.
    Author:
    Chris Jennings
    • Constructor Detail

      • PaintSampleIcon

        public PaintSampleIcon​(java.awt.Paint paint)
    • Method Detail

      • derive

        public PaintSampleIcon 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.
        Parameters:
        newWidth - the new width ≥ 1
        newHeight - the new height ≥ 1
        Returns:
        an icon with the revised dimensions
      • paintIcon

        protected void paintIcon​(java.awt.Component c,
                                 java.awt.Graphics2D g,
                                 int x,
                                 int y)
        Specified by:
        paintIcon in class AbstractThemedIcon