src/Menu.java
/**
	 * MousePressed method to determine users' mouse operations
	 */
MousePressed method to determine users' mouse operations
MousePressed method to determine users ' mouse operations
public void mousePressed(MouseEvent e) {
		int mx = e.getX();
		int my = e.getY();
		if(vss.runState == STATE.Menu) {
			if(mouseOver(mx, my, 405, 150, 200, 64)) {
				vss.runState = STATE.Run;
				location.setCurrTime(System.currentTimeMillis());
				return;
			}
			if(mouseOver(mx, my, 405, 250, 200, 64)) {
				vss.runState = STATE.Set;
				return;
			}
			if(mouseOver(mx, my, 405, 350, 200, 64)) {
				System.exit(1);
			}
		}
		if(vss.runState == STATE.Set) {
			if(mouseOver(mx, my, 240, 100, 70, 70)) {
				vss.city.setState(true);	
			}
			if(mouseOver(mx, my, 310, 100, 70, 70)) {
				vss.city.setState(false);
			}
			if(vss.city.getState()) {
				if(mouseOver(mx, my, 540, 115, 50, 50))
					vss.city.setQLevel("low");
				if(mouseOver(mx, my, 590, 115, 50, 50))
					vss.city.setQLevel("medium");
				if(mouseOver(mx, my, 640, 115, 50, 50))
					vss.city.setQLevel("high");
			}
			if(mouseOver(mx, my, 240, 200, 70, 70))
				pSize = 50; 
			if(mouseOver(mx, my, 310, 200, 70, 70))
				pSize = 100; 
			if(mouseOver(mx, my, 380, 200, 70, 70))
				pSize = 150; 
			if(mouseOver(mx, my, 450, 200, 70, 70))
				pSize = 200; 
			if(mouseOver(mx, my, 520, 200, 70, 70))
				pSize = 250; 
			/*
			if(mouseOver(mx, my, 240, 200, 350, 70)) {
				vss.city = new Location(vss.getWidth(), vss.getHeight(), new Hospital(), vss.city.getState(), vss.city.getPsize());
				System.out.println("Size: " + vss.city.getPsize());
			}
			*/
			if(mouseOver(mx, my, 340, 300, 70, 70))
				vss.city.getHospital().setcapacity(20);
			if(mouseOver(mx, my, 410, 300, 70, 70))
				vss.city.getHospital().setcapacity(40);
			if(mouseOver(mx, my, 480, 300, 70, 70))
				vss.city.getHospital().setcapacity(50);
			if(mouseOver(mx, my, 550, 300, 70, 70))
				vss.city.getHospital().setcapacity(60);
			if(mouseOver(mx, my, 620, 300, 70, 70))
				vss.city.getHospital().setcapacity(80);
			if(mouseOver(mx, my, 435, 465, 140, 50)) {
				if(pSize != vss.city.getPsize()) {
					int capacity = vss.city.getHospital().getcapacity();
					vss.city = new Location(vss.getWidth(), vss.getHeight(), new Hospital(), vss.city.getState(), pSize);
					vss.city.getHospital().setcapacity(capacity);
					location.setCurrTime(System.currentTimeMillis());
				}
				vss.runState = STATE.Run;
				return;
			}
		}
	}
public void mousePressed ( MouseEvent e ) { int mx = e . getX ( ) ; int my = e . getY ( ) ; if ( vss . runState == STATE . Menu ) { if ( mouseOver ( mx , my , 405 , 150 , 200 , 64 ) ) { vss . runState = STATE . Run ; location . setCurrTime ( System . currentTimeMillis ( ) ) ; return ; } if ( mouseOver ( mx , my , 405 , 250 , 200 , 64 ) ) { vss . runState = STATE . Set ; return ; } if ( mouseOver ( mx , my , 405 , 350 , 200 , 64 ) ) { System . exit ( 1 ) ; } } if ( vss . runState == STATE . Set ) { if ( mouseOver ( mx , my , 240 , 100 , 70 , 70 ) ) { vss . city . setState ( true ) ; } if ( mouseOver ( mx , my , 310 , 100 , 70 , 70 ) ) { vss . city . setState ( false ) ; } if ( vss . city . getState ( ) ) { if ( mouseOver ( mx , my , 540 , 115 , 50 , 50 ) ) vss . city . setQLevel ( "low" ) ; if ( mouseOver ( mx , my , 590 , 115 , 50 , 50 ) ) vss . city . setQLevel ( "medium" ) ; if ( mouseOver ( mx , my , 640 , 115 , 50 , 50 ) ) vss . city . setQLevel ( "high" ) ; } if ( mouseOver ( mx , my , 240 , 200 , 70 , 70 ) ) pSize = 50 ; if ( mouseOver ( mx , my , 310 , 200 , 70 , 70 ) ) pSize = 100 ; if ( mouseOver ( mx , my , 380 , 200 , 70 , 70 ) ) pSize = 150 ; if ( mouseOver ( mx , my , 450 , 200 , 70 , 70 ) ) pSize = 200 ; if ( mouseOver ( mx , my , 520 , 200 , 70 , 70 ) ) pSize = 250 ; /*
			if(mouseOver(mx, my, 240, 200, 350, 70)) {
				vss.city = new Location(vss.getWidth(), vss.getHeight(), new Hospital(), vss.city.getState(), vss.city.getPsize());
				System.out.println("Size: " + vss.city.getPsize());
			}
			*/ if ( mouseOver ( mx , my , 340 , 300 , 70 , 70 ) ) vss . city . getHospital ( ) . setcapacity ( 20 ) ; if ( mouseOver ( mx , my , 410 , 300 , 70 , 70 ) ) vss . city . getHospital ( ) . setcapacity ( 40 ) ; if ( mouseOver ( mx , my , 480 , 300 , 70 , 70 ) ) vss . city . getHospital ( ) . setcapacity ( 50 ) ; if ( mouseOver ( mx , my , 550 , 300 , 70 , 70 ) ) vss . city . getHospital ( ) . setcapacity ( 60 ) ; if ( mouseOver ( mx , my , 620 , 300 , 70 , 70 ) ) vss . city . getHospital ( ) . setcapacity ( 80 ) ; if ( mouseOver ( mx , my , 435 , 465 , 140 , 50 ) ) { if ( pSize != vss . city . getPsize ( ) ) { int capacity = vss . city . getHospital ( ) . getcapacity ( ) ; vss . city = new Location ( vss . getWidth ( ) , vss . getHeight ( ) , new Hospital ( ) , vss . city . getState ( ) , pSize ) ; vss . city . getHospital ( ) . setcapacity ( capacity ) ; location . setCurrTime ( System . currentTimeMillis ( ) ) ; } vss . runState = STATE . Run ; return ; } } }
MousePressed method to determine users' mouse operations
MousePressed method to determine users ' mouse operations
// Menu State // Start button // Setup button // Quit button // Setup State // Quarantine setup // True button // False button // Select qLevel //Population setup //vss.city.setPsize(50); //vss.city.setPsize(100); //vss.city.setPsize(150); //vss.city.setPsize(200); //vss.city.setPsize(250); // Hospital setup // Apply button