@Override
	public void onApplyFilter(ApplyFilterEvent applyFilterEvent) {
		if (mLock.tryLock()) {
			switch (applyFilterEvent.getType()) {
			case "contrast":
				imageDisplay
						.setImage(model.functionalFilter(image, model
								.getContrast((float) applyFilterEvent
										.getFactor() / 200)));
				break;
			case "brightness":
				imageDisplay.setImage(model.functionalFilter(image,
						model.getBrightness((float) applyFilterEvent
								.getFactor() / 100)));
				break;
			case "gamma":
				imageDisplay.setImage(model.functionalFilter(image,
						model.getGamma((float) applyFilterEvent.getFactor())));
				break;
			case "averagedither":
				imageDisplay.setImage(model.thresholdingFilter(image, model
						.getAverageDither((int) applyFilterEvent.getFactor())));
				break;
			default:
				break;
			}
			mLock.unlock();
		}
	}