Class DrawSquares

java.lang.Object
jmri.util.swing.DrawSquares

public class DrawSquares extends Object
Common utility to draw colored rectangular Image.
  • Constructor Details

  • Method Details

    • getImage

      public static BufferedImage getImage(int width, int height, int dim, Color color1, 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