public void actionPerformed(ActionEvent evt) {
		doneAnything = true;
		String str = evt.getActionCommand();
		if (state == BLENDING)
			return;
		if (str.equals(SELECT_REGION)) {
			//Clear previous selection
			selectionBorder.clear();
			selectionArea.clear();
			state = SELECTING;
		}
		else if (str.equals(BLEND_SELECTION)) {
			state = BLENDING;
			updateMask();
			solver = new MatrixSolver(mask, selectionArea, image, selectedImage,
									  xMin, yMin, Width, Height, false);
			IterationBlender blender = new IterationBlender();
			blendingThread = new Thread(blender);
			blendingThread.start();
		}
		else if (str.equals(FLATTEN_SELECTION)) {
			state = BLENDING;
			updateMask();
			solver = new MatrixSolver(mask, selectionArea, image, selectedImage,
									  xMin, yMin, Width, Height, true);
			IterationBlender blender = new IterationBlender();
			blendingThread = new Thread(blender);
			blendingThread.start();
		}
		else if (str.equals(SELECT_IMAGE1)) {
			ImageSelector selector = new ImageSelector();
			selector.addWindowListener(this);
			selectingLeft = true;
		}
		else if (str.equals(SELECT_IMAGE2)) {
			ImageSelector selector = new ImageSelector();
			selector.addWindowListener(this);
			selectingLeft = false;
		}
		else if (str.equals(STOP)) {
			if (state == BLENDING) {
				blendingThread.stop();
				state = NOTHING;
				finalizeBlending();
			}
		}
		canvas.repaint();
	}