@Override
	public void actionPerformed(ActionEvent e) {
		
		if(e.getSource().equals(sensorList)) {
			AdminClient.signout.setEnabled(false);
			sensorList.setEnabled(false);
			setupSensor.setEnabled(false);
			setupGPS.setEnabled(false);
			photo.setEnabled(false);
			signout.setEnabled(false);
			rc.setVisible(false);
			sp.setVisible(true);
			new Thread(new Runnable() {
				
				@Override
				public void run() {
					ArrayList<Sensor> sensorListArray;
					try {
						sensorListArray = AdminClient.client.getSensorList();
						sensorList.setEnabled(true);
						setupSensor.setEnabled(true);
						setupGPS.setEnabled(true);
						photo.setEnabled(true);
						signout.setEnabled(true);
						sp.setVisible(false);
						rc.setVisible(true);
						AdminClient.signout.setEnabled(true);
						SensorList s = new SensorList(sensorListArray);
						s.requestFocus();
					} catch (SocketTimeoutException e) {
						JOptionPane.showMessageDialog(Menu.this, "The connection is down.", "Error", JOptionPane.ERROR_MESSAGE);
						Authentication authentication = new Authentication(parent);
						authentication.setLocation(Menu.this.getX() - Menu.this.getWidth(), Menu.this.getY());
						parent.getContentPane().add(authentication, 0);
						Utilities.transitionEffect(Menu.this, authentication, parent, true);
						SwitchServerWindow s = new SwitchServerWindow();
						s.requestFocus();
					}
				}
			}).start();
		} else if(e.getSource().equals(setupSensor)) {
			AdminClient.signout.setEnabled(false);
			sensorList.setEnabled(false);
			setupSensor.setEnabled(false);
			setupGPS.setEnabled(false);
			photo.setEnabled(false);
			signout.setEnabled(false);
			rc.setVisible(false);
			sp.setVisible(true);
			
			sensorList.setEnabled(true);
			setupSensor.setEnabled(true);
			setupGPS.setEnabled(true);
			photo.setEnabled(true);
			signout.setEnabled(true);
			sp.setVisible(false);
			rc.setVisible(true);
			AdminClient.signout.setEnabled(true);
			SetupSensor s = new SetupSensor(parent, this);
			s.requestFocus();
		} else if(e.getSource().equals(setupGPS)) {
			SetupGPS s = new SetupGPS(parent);
			s.setLocation(Menu.this.getX() + Menu.this.getWidth(), Menu.this.getY());
			parent.getContentPane().add(s, 0);
			Utilities.transitionEffect(Menu.this, s, parent, false);
			AdminClient.signout.setEnabled(true);
		} else if(e.getSource().equals(photo)) {
			PhotoLoc s = new PhotoLoc(parent);
			s.setLocation(Menu.this.getX() + Menu.this.getWidth(), Menu.this.getY());
			parent.getContentPane().add(s, 0);
			Utilities.transitionEffect(Menu.this, s, parent, false);
		} else if(e.getSource().equals(signout)) {
			AdminClient.signout.setEnabled(false);
			sensorList.setEnabled(false);
			setupSensor.setEnabled(false);
			setupGPS.setEnabled(false);
			photo.setEnabled(false);
			signout.setEnabled(false);
			rc.setVisible(false);
			sp.setVisible(true);
			new Thread(new Runnable() {
				
				@Override
				public void run() {
					try {
						AdminClient.client.signOut();
						AdminClient.client = null;
						sensorList.setEnabled(true);
						setupSensor.setEnabled(true);
						setupGPS.setEnabled(true);
						photo.setEnabled(true);
						signout.setEnabled(true);
						sp.setVisible(false);
						rc.setVisible(true);
						Authentication authentication = new Authentication(parent);
						authentication.setLocation(Menu.this.getX() - Menu.this.getWidth(), Menu.this.getY());
						parent.getContentPane().add(authentication, 0);
						Utilities.transitionEffect(Menu.this, authentication, parent, true);
					} catch (SocketTimeoutException e) {
						JOptionPane.showMessageDialog(Menu.this, "The connection is down.", "Error", JOptionPane.ERROR_MESSAGE);
						Authentication authentication = new Authentication(parent);
						authentication.setLocation(Menu.this.getX() - Menu.this.getWidth(), Menu.this.getY());
						parent.getContentPane().add(authentication, 0);
						Utilities.transitionEffect(Menu.this, authentication, parent, true);
						SwitchServerWindow s = new SwitchServerWindow();
						s.requestFocus();
					}
				}
			}).start();
		}
	}