//This is a last minute modification to the code which simplifies the control scheme for web application //Saving Loading and Exporting are disabled, as well as some of the short cuts. For full functionality please download the full version on the course webpage /* Please feel free to modify this code in any way you like and/or send me your thoughts/comments/improvements. If there is a feature you would like me to implement, let me know and I can see what I can do. Play around with the buttons, but hopefully the titles are relatively self explanatory. Mainly: toggle between particle/wall draw modes. take "one step" at a time or "run" continuously.Changing the file name can be a pain since the text entry method is not the best - press the change file button, type your new working file name, and then press enter. You can then load that file or press save to create/overwrite it. There is not a set file extension(not even needed), but using .txt(or a text editor extension) saves some time. Exporting spits out a text file with self.lga.drawpoint based lines that you need to copy/paste into an lga py file. Toggle continuous save when you have your file name set to get a running save of your work (overwrites same file). Again, send me any comments you might have! Thanks! Limitations **take care to set your r1 and c1 values to match your refl walls based on your drawing. setting r1/c1 to odd numbers usually works if the top wall is a refl wall. if the top is a rev wall or a particle, this may change */ int scale = 40; // hexagonal lattice with lines "scale" px long, toggled in code but toggle values can be changed directly Particles ps = new Particles(); //global class set defining particles Walls ws = new Walls(); //global class set defining reflective walls revWalls rws = new revWalls(); //global class set defining REV walls AND SINKS Sources srcs = new Sources(); //global class set defining sources int modeToggle = 0; // 0 wall mode, 1 particle mode, 2 rwalls, 3 sources PFont font; //font class for gui output GUI gui; // global gui class; includes specific buttons and grid drawing String workingFile = "default.txt"; //starting save/load file, can be changed here or in program boolean runContinuously = false; //boolean flag for draw() loop. can be changed in program. updates particles continuously based on frame limiter void setup() { size(800,600); //change here to find a display that works for you! divisible by 20 seems to keep grid alligned, but may be different font = createFont("Arial",16,true); //setting up fontsize and type, 16 designates default font size which is normally overwritten in code ps.setup2parMatrix(); // calls the Particles() function that sets up the 2 dimensional state matrix for 2 particle collisions gui = new GUI(); //initializes Gui } void draw() { background(255); //set background color to white(also serves to refresh the frame) gui.updateGUI(); //calls check buttons and show buttons in gui class, if button is pressed near function call will execute function of button ps.drawDrawingParameters(); // draws the template particle in top left corner ws.drawDrawingParameters(); // draws the template wall in top left corner if(runContinuously && frameCount % gui.runSpeed == 0) //runs continuously if enabled { ps.updateParticles(); //move particles, check for collisions, drawparticles } //if not continuous then just draw everything: ps.drawParticles(); ws.drawWalls(); rws.drawWalls(); srcs.drawSources(); handleInput(); } //this file(GUI1.pde) defines the graphical user interface seen by the program class GUI { ArrayList