Class DrawSquares


  • public class DrawSquares
    extends java.lang.Object
    Common utility to draw colored rectangular Image.
    • Constructor Summary

      Constructors 
      Constructor Description
      DrawSquares()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.awt.image.BufferedImage getImage​(int width, int height, int dim, java.awt.Color color1, java.awt.Color color2)
      Produce a grid of contrasting squares.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getImage

        public static java.awt.image.BufferedImage getImage​(int width,
                                                            int height,
                                                            int dim,
                                                            java.awt.Color color1,
                                                            java.awt.Color color2)
        Produce a grid of contrasting squares. Ideally the width and height match the parent frame size.
        Parameters:
        width - image width in pixels
        height - image height in pixels
        dim - length of sides of squares in pixels
        color1 - background color
        color2 - contrasting fill color
        Returns:
        the image with a grid of squares