@Override
	public void tableChanged(TableModelEvent e) {
		if (e.getType() == TableModelEvent.UPDATE) {
			int col = e.getColumn();
			int row = e.getFirstRow();
			Object newObj = locationTableModel.getValueAt(row, col);
			Location location = getLocation(row);
			switch (col) {
			case 0:
				if (newObj != null) {
					String newValue = newObj.toString();
					if (newValue.length() > 0) {
						controller.setLocationName(location, newValue);
						break;
					}
				}
				locationTableModel.setValueAt(location.getName(), row, col);
				break;
			case 1:
				if (newObj != null) {
					String newValue = newObj.toString();
					if (newValue.length() > 0) {
						int cap = Integer.parseInt(newValue);
						if (cap < 0) {
							throw new RuntimeException("Location remaining capacity cannot be negative.");
						}
						controller.setLocationRemainingCapacity(location, cap);
						break;
					}
				}
				controller.removeLocationRemainingCapacity(location);
				break;
			}
		}
	}