package graphics; import java.awt.Color; class Flower { void blossom(EasyGraphics graph) { graph.set(10, 10, Color.RED.getRGB()); graph.repaint(); } } class Dandelion extends Flower { public void blossom(EasyGraphics graph) { for (int i=0; i<628; i+=5) { double s = Math.sin((double)i/100); double c= Math.cos((double)i/100); for (int ii=0; ii<100; ++ii) { graph.set((int)(300+ii*s), (int)(200+ii*c), Color.YELLOW.getRGB()); } } graph.repaint(); } } public class Demo { public static void main(String[] args) { EasyGraphics graph = new EasyGraphics(); Flower flower = new Dandelion(); flower.blossom(graph); } }