client/ClientWindow.java
/**
		 * Update the basket by synchronising the basket on the backend with the GUI
		 */
Update the basket by synchronising the basket on the backend with the GUI
Update the basket by synchronising the basket on the backend with the GUI
private void updateBasket() {
			HashMap<Dish,Number> modifications = new HashMap<Dish,Number>();
			for(Entry<Dish, JSpinner> basketMapItem : basketMap.entrySet()) {
				Dish basketDish = basketMapItem.getKey();
				JSpinner basketSpinner = basketMapItem.getValue();
				Number basketQuantity = (Number) basketSpinner.getValue();
				modifications.put(basketDish, basketQuantity);
			}
			for(Entry<Dish,Number> modification : modifications.entrySet()) {
				client.updateDishInBasket(user, modification.getKey(), modification.getValue());
			}
			refreshBasket();
		}
private void updateBasket ( ) { HashMap < Dish , Number > modifications = new HashMap < Dish , Number > ( ) ; for ( Entry < Dish , JSpinner > basketMapItem : basketMap . entrySet ( ) ) { Dish basketDish = basketMapItem . getKey ( ) ; JSpinner basketSpinner = basketMapItem . getValue ( ) ; Number basketQuantity = ( Number ) basketSpinner . getValue ( ) ; modifications . put ( basketDish , basketQuantity ) ; } for ( Entry < Dish , Number > modification : modifications . entrySet ( ) ) { client . updateDishInBasket ( user , modification . getKey ( ) , modification . getValue ( ) ) ; } refreshBasket ( ) ; }
Update the basket by synchronising the basket on the backend with the GUI
Update the basket by synchronising the basket on the backend with the GUI
//Identify items in the basket that need updating //Perform update