import java.awt.Font; // I imported this to change fonts, hope that's okay
import java.awt.Graphics;
/**
* CS312 Assignment 3.
*
* On my honor, Michelle Shao, this programming assignment is my own work and I
have
* not shared my solution with any other student in the class.
*
* A program to print out various scintillation grids and a student designed
drawing.
*
* email address:
* UTEID: ms76365
* Unique 5 digit course ID: 51415
* Grader name: Carla
* Number of slip days used on this assignment: 0
*/
public class ScintillationGrid
{
// Main method that creates the DrawingPanel with scintillation grids.
// Restricted to chapters 1 - 3 of Building Java Programs
public static void main(String[] args)
{
/* In the final version of the program DO NOT call method drawingOne
from main or anywhere else in the program */
// Creates the DrawingPanel and changes the background
// color to cyan for the scintillation grids background.
DrawingPanel scintillation = new DrawingPanel(900, 650);
scintillation.setBackground(Color.CYAN);
Graphics g1 = scintillation.getGraphics();
// Method call for my own drawing:
// drawingOne();
// Draws the 4 scintillation grids
drawAll(g1, 0, 0, 348, 75, 3, 16);
drawAll(g1, 400, 50, 422, 50, 6, 12);
drawAll(g1, 50, 400, 220, 100, 1, 20);
drawAll(g1, 500, 500, 148, 15, 7, 4);
}
/*
* Draws the black background with x and y coordinates,
* and the width and height of the rectangle, which
* correlates to the size of the large square.
*/
public static void drawGrid(Graphics g1, int x, int y, int sizeLarge)
{
g1.setColor(Color.BLACK);
g1.fillRect(x, y, sizeLarge, sizeLarge);
}
/*
* Draws the vertical lines with parameters
* Graphics g1, x and y coordinates,
* sizeLarge size of the large square,
* sizeSmall size of the smaller squares,
* numLines for the number of vertical lines,
* and thickness of the lines.
This study source was downloaded by 100000858936669 from CourseHero.com on 02-02-2023 23:23:32 GMT -06:00
https://www.coursehero.com/file/25949396/ScintillationGridjava/