void processMouseReleased(MouseEvent e) {

		super.processMouseReleased(e);
		if (model.getJob() != null && !model.getJob().isStopped()) {
			processUserFieldsUponKeyOrMouseReleased();
			return;
		}
		if (ModelerUtilities.isRightClick(e)) {
			popup(e);
			return;
		}

		int x = e.getX();
		int y = e.getY();

		switch (actionID) {

		case HEAT_ID:
			pointHeater.doWork(model, true);
			break;

		case COOL_ID:
			pointHeater.doWork(model, false);
			break;

		case ADGB_ID:
			addGBIndicator.x = addGBIndicator.y = -1;
			repaint();
			break;

		case RESI_ID:
			if (selectedComponent instanceof GayBerneParticle) {
				if (resizeHandle >= 0) {
					resizeHandle = -1;
					if (finalizeSize((GayBerneParticle) selectedComponent)) {
						model.notifyChange();
					}
					if (!doNotFireUndoEvent) {
						model.getUndoManager().undoableEditHappened(new UndoableEditEvent(model, new UndoableResizing(selectedComponent)));
						updateUndoUIComponents();
					}
				}
			}
			break;

		case ROTA_ID:
			if (selectedComponent instanceof GayBerneParticle) {
				if (rotationHandle >= 0) {
					rotationHandle = -1;
					finalizeOrientation((GayBerneParticle) selectedComponent);
					model.notifyChange();
					if (selectedComponent != null && !doNotFireUndoEvent) {
						model.getUndoManager().undoableEditHappened(new UndoableEditEvent(model, new UndoableMoving(selectedComponent)));
						updateUndoUIComponents();
					}
				}
			}
			break;

		case DELE_ID:
			removeSelectedArea();
			break;

		case COUN_ID:
			int n = 0;
			for (int k = 0; k < nParticle; k++) {
				if (selectedArea.contains(gb[k].getRx(), gb[k].getRy()))
					n++;
			}
			if (n != 0) {
				String s = MDView.getInternationalText("CountingResult");
				JOptionPane.showMessageDialog(JOptionPane.getFrameForComponent(this), "The selected area contains the center of mass of " + n + " particles.", s != null ? s : "Counting result", JOptionPane.INFORMATION_MESSAGE);
			}
			selectedArea.setSize(0, 0);
			repaint();
			break;

		case MARK_ID:
			for (int k = 0; k < nParticle; k++)
				gb[k].setMarked(selectedArea.contains(gb[k].getRx(), gb[k].getRy()));
			selectedArea.setSize(0, 0);
			repaint();
			break;

		case SELE_ID:
			if (dragSelected) {
				boolean b = false;
				if (selectedComponent instanceof GayBerneParticle) {
					if (finalizeLocation((GayBerneParticle) selectedComponent)) {
						b = true;
					} else {
						errorReminder.show(ErrorReminder.OBJECT_OVERLAP);
					}
				} else if (selectedComponent instanceof Layered) {
					b = true;
					ModelComponent host = ((Layered) selectedComponent).getHost();
					if (host instanceof GayBerneParticle) {
						b = finalizeLocation((GayBerneParticle) host);
						if (!b)
							errorReminder.show(ErrorReminder.OBJECT_OVERLAP);
					}
				}
				if (b) {
					model.notifyChange();
					setCursor(UserAction.getCursor(actionID));
					if (selectedComponent != null) {
						if (!doNotFireUndoEvent) {
							model.getUndoManager().undoableEditHappened(new UndoableEditEvent(model, new UndoableMoving(selectedComponent)));
							updateUndoUIComponents();
						}
					}
				}
				dragSelected = false;
			}
			break;

		case VELO_ID:
			if (readyToAdjustVelocityVector) {
				if (selectedComponent instanceof GayBerneParticle) {
					GayBerneParticle p = (GayBerneParticle) selectedComponent;
					p.storeCurrentState();
					p.setVx((x - p.getRx()) / velocityFlavor.getLength());
					p.setVy((y - p.getRy()) / velocityFlavor.getLength());
					setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
					repaint();
					model.notifyChange();
					if (!doNotFireUndoEvent) {
						model.getUndoManager().undoableEditHappened(new UndoableEditEvent(model, new UndoableResizing(selectedComponent)));
						updateUndoUIComponents();
					}
				}
				readyToAdjustVelocityVector = false;
			}
			break;

		case OMEG_ID:
			if (selectedComponent instanceof GayBerneParticle) {
				GayBerneParticle p = (GayBerneParticle) selectedComponent;
				p.storeCurrentState();
				if (readyToAdjustOmegaVector) {
					double angle = Math.acos((x - p.getRx()) / Math.hypot(x - p.getRx(), y - p.getRy()));
					if (p.getOmega() < 0.0) {
						if (y > p.getRy()) {
							angle = 2.0 * Math.PI - angle;
						}
					} else {
						if (y > p.getRy()) {
							angle = -angle;
						} else {
							angle -= 2.0 * Math.PI;
						}
					}
					angle *= 180.0 / Math.PI;
					p.setOmega((p.getOmega() < 0.0 ? -1.0 : 1.0) * Math.sqrt(Math.abs(angle) / (p.getInertia() * 20000)));
					readyToAdjustOmegaVector = false;
					setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
					model.notifyChange();
					if (!doNotFireUndoEvent) {
						model.getUndoManager().undoableEditHappened(new UndoableEditEvent(model, new UndoableResizing(selectedComponent)));
						updateUndoUIComponents();
					}
				}
			}
			break;

		case MEAS_ID:
			if (readyToAdjustDistanceVector) {
				if (selectedComponent instanceof GayBerneParticle && indexOfSelectedMeasurement >= 0) {
					if (x < 0 || x > getWidth() || y < 0 || y > getHeight()) {
						((GayBerneParticle) selectedComponent).removeMeasurement(indexOfSelectedMeasurement);
						indexOfSelectedMeasurement = -1;
						setCursor(previousCursor);
						repaint();
					}
				}
				readyToAdjustDistanceVector = false;
			}
			break;

		case DUPL_ID:
			if (selectedComponent instanceof GayBerneParticle) {
				if (finalizeDuplication()) {
					model.setNumberOfParticles(nParticle);
					model.notifyChange();
					if (!doNotFireUndoEvent) {
						model.getUndoManager().undoableEditHappened(new UndoableEditEvent(model, new UndoableInsertion(UndoAction.INSERT_A_PARTICLE, x, y)));
						updateUndoUIComponents();
					}
				}
			} else if (selectedComponent instanceof Layered) {
				model.notifyChange();
				if (!doNotFireUndoEvent) {
					model.getUndoManager().undoableEditHappened(new UndoableEditEvent(model, new UndoableLayeredComponentOperation(UndoAction.INSERT_LAYERED_COMPONENT, (Layered) selectedComponent)));
					updateUndoUIComponents();
				}
			}
			break;

		}

		repaint();
		e.consume();

	}