/** * Tree.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 tree */ public class Tree extends Background { /** * Initialize attributes for this Tree * * @param x x-coordinate of this Tree (leftmost position of background) * @param y y-coordinate of this Tree (uppermost position of background) * @param w width of this Tree * @param h height of this Tree */ public Tree(double x, double y, double w, double h) { super(x, y, w, h); super.externalName = "Tree"; } /** * Use the graphics system to draw the shapes representing this Tree * * @param g the graphics system to use */ public void draw(Graphics2D g) { g.setPaint((Color.GREEN).brighter()); g.fill(new Ellipse2D.Double(xCoor, yCoor, width, height)); } }