import java.util.*; import java.io.*; import javax.swing.Timer; import java.awt.event.*; public class MyWorld { private PrintStream out; private ArrayList elements; // array to hold everything in my world. private Timer passingTime; // NEW private double t; // simulation time private double delta_t; // in seconds private double refreshPeriod; // in seconds public MyWorld(){ this(System.out); } public MyWorld(PrintStream output){ out = output; t = 0; refreshPeriod = 0.05; // [s] delta_t = 0.005; // [s] elements = new ArrayList(); view = null; passingTime = // } public void addElement(PhysicsElement e) { elements.add(e); view.repaint(); } public void setView(MyWorldView view) { this.view = view; } public void start() { if(passingTime.isRunning()) return; passingTime.start(); } public void actionPerformed (ActionEvent event) { // like simulate method of Assignment 1, double nextStop=t+refreshPeriod; // the arguments are attributes here. for (; t