class DipoleSystem { int posx = 100; int posy = 86; ArrayList all; int rows = 18; int cols = 18; public float strength = 250; public float Inertia = 5000; public float friction = 150; float scanrange = 192.0; float distx = 20; float disty = 20; int gridmode = 1; boolean drawMagnets = true; boolean drawField = true; boolean drawForce = true; boolean playing = false; DipoleSystem() { all = new ArrayList(); init(); } void setGrid(int xx, int yy) { rows = yy; cols = xx; } void reassign() { for(int i=0; i=0; i--) { Dipole d = (Dipole) all.get(i); all.remove(d); } // create new magnets for(int r=0; r