/** * Intersection.java * * @author David Tran * @version 1.0 */ package background; import java.awt.Graphics2D; import java.awt.Color; import java.awt.Stroke; import java.awt.BasicStroke; import java.awt.Point; import java.awt.geom.*; /** * A background representing a road intersection. */ public class Intersection extends Background { /** * Initialize attributes for this Intersection * * @param x x-coordinate of this Intersection (leftmost position of background) * @param y y-coordinate of this Intersection (uppermost position of background) * @param w width of this Intersection * @param h height of this Intersection */ public Intersection(double x, double y, double w, double h) { super(x, y, w, h); super.externalName = "Intersection"; } /** * Use the graphics system to draw the shapes representing this Intersection * * @param g the graphics system to use */ public void draw(Graphics2D g) { g.setPaint(Color.GRAY); g.fill(new Rectangle2D.Double(xCoor, yCoor, width, height)); } }