void processKeyPressed(KeyEvent e) {

		super.processKeyPressed(e);

		int keyID = e.getKeyCode();

		if (selectedComponent != null) {
			if (!isEditable() && !selectedComponent.isDraggable()) {
				showActionTip("<html><font color=red>The selected object is not nudgable!</font></html>", 10, 10);
			} else {
				int dx = 0, dy = 0;
				switch (keyID) {
				case KeyEvent.VK_UP:
					keyPressedCode = keyPressedCode | UP_PRESSED;
					break;
				case KeyEvent.VK_DOWN:
					keyPressedCode = keyPressedCode | DOWN_PRESSED;
					break;
				case KeyEvent.VK_LEFT:
					keyPressedCode = keyPressedCode | LEFT_PRESSED;
					break;
				case KeyEvent.VK_RIGHT:
					keyPressedCode = keyPressedCode | RIGHT_PRESSED;
					break;
				}
				if ((keyPressedCode & UP_PRESSED) == UP_PRESSED)
					dy--;
				if ((keyPressedCode & DOWN_PRESSED) == DOWN_PRESSED)
					dy++;
				if ((keyPressedCode & LEFT_PRESSED) == LEFT_PRESSED)
					dx--;
				if ((keyPressedCode & RIGHT_PRESSED) == RIGHT_PRESSED)
					dx++;
				if (dx == 0 && dy == 0)
					return;
				model.notifyChange();
				if (selectedComponent instanceof GayBerneParticle) {
					GayBerneParticle p = (GayBerneParticle) selectedComponent;
					p.storeCurrentState();
					p.translateBy(dx, dy);
					boundary.setRBC(p, RectangularBoundary.TRANSLATION);
					finalizeLocation(p);
				} else if (selectedComponent instanceof Layered) {
					selectedComponent.storeCurrentState();
					((Layered) selectedComponent).translateBy(dx, dy);
				}
			}

		} else {
			boolean keyIsRight = false;
			UserField uf = null;
			for (int i = 0; i < nParticle; i++) {
				uf = gb[i].getUserField();
				if (uf != null) {
					keyIsRight = false;
					switch (keyID) {
					case KeyEvent.VK_UP:
						uf.setAngle(0, -1);
						keyIsRight = true;
						break;
					case KeyEvent.VK_DOWN:
						uf.setAngle(0, 1);
						keyIsRight = true;
						break;
					case KeyEvent.VK_LEFT:
						uf.setAngle(-1, 0);
						keyIsRight = true;
						break;
					case KeyEvent.VK_RIGHT:
						uf.setAngle(1, 0);
						keyIsRight = true;
						break;
					case KeyEvent.VK_OPEN_BRACKET:
						// uf.setOrientation(UserField.INWARD);
						keyIsRight = true;
						break;
					case KeyEvent.VK_CLOSE_BRACKET:
						// uf.setOrientation(UserField.OUTWARD);
						keyIsRight = true;
						break;
					}
					if (keyIsRight) {
						switch (uf.getMode()) {
						case UserField.FORCE_MODE:
							uf.setIntensity(UserField.INCREMENT * uf.getGear());
							break;
						case UserField.IMPULSE1_MODE:
							uf.increaseGear(1);
							break;
						}
					}
				}
			}
		}

		if (model.getJob() == null || model.getJob().isStopped())
			repaint();

		// KeyEvent must be consumed, otherwise the keyboard manager will be confused when the KeyEvent
		// should be applied to this view or to its parent component. WARNING!!! This treatment can cause
		// key binding to fail. You MUST set the onKeyRelease flag to be true when setting the key stroke
		// for a binding.
		if (hasFocus())
			e.consume();

	}