private void sortPatches(ArrayList<ColorPatch> patches) {
		
		setProgress("Sorting...", 0);
		worker = new ColorSorter(patches, controller.getParametersBean());
		worker.addPropertyChangeListener(new PropertyChangeListener() {
			@Override
			public void propertyChange(PropertyChangeEvent evt) {
				if ( evt.getPropertyName().equals("progress")) {
					setProgress("Sorting: "+(double)evt.getNewValue()*100+"%", (double)evt.getNewValue());
				}
				else if ( evt.getPropertyName().equals("done") && (boolean)evt.getNewValue() ) {
					try {
						dialog.setVisible(false);
						controller.setStatus("Done");
						controller.getColorsBean().setPatches(worker.get());
						controller.getImageBean().setStatus(ImageBean.LOADED);
					} catch (InterruptedException e) {
						controller.getImageBean().setStatus(ImageBean.LOADED);
					} catch (ExecutionException e) {
						e.printStackTrace();
					}
				}
			}
		});
		worker.execute();
	}