private void moveOrSteerObjectUsingKeys(int keyID) {

		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;
		}
		byte dx = 0, dy = 0;
		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;

		if (selectedComponent != null) {
			if (!isEditable() && !selectedComponent.isDraggable()) {
				showActionTip("<html><font color=red>The selected object is not nudgable!</font></html>", 10, 10);
			} else {
				if (selectedComponent instanceof Atom) {
					Atom a = (Atom) selectedComponent;
					if (!a.isBonded()) {
						a.storeCurrentState();
						a.translateBy(dx, dy);
						int x = (int) a.getRx();
						int y = (int) a.getRy();
						if (a.getRestraint() != null) {
							int amp = (int) (400.0 / a.getRestraint().getK());
							Vector2D loc = moveSpring(x, y, (int) a.getRestraint().getX0(), (int) a.getRestraint().getY0(), 0, amp);
							if (loc == null)
								return;
							a.translateTo(loc.getX(), loc.getY());
						}
						finalizeAtomLocation(a, false);
					}
				} else if (selectedComponent instanceof Molecule) {
					Molecule mol = (Molecule) selectedComponent;
					mol.storeCurrentState();
					mol.translateBy(dx, dy);
					finalizeMoleculeLocation((Molecule) selectedComponent);
					refreshForces();
				} else if (selectedComponent instanceof RectangularObstacle) {
					RectangularObstacle r = (RectangularObstacle) selectedComponent;
					r.storeCurrentState();
					r.translateBy(dx, dy);
					finalizeObstacleLocation(r);
				} else if (selectedComponent instanceof Layered) {
					selectedComponent.storeCurrentState();
					((Layered) selectedComponent).translateBy(dx, dy);
				}
				model.notifyChange();
			}
		} else {
			UserField uf = null;
			for (int i = 0; i < nAtom; i++) {
				uf = atom[i].getUserField();
				if (uf != null) {
					uf.setAngle(dx, dy);
					switch (uf.getMode()) {
					case UserField.FORCE_MODE:
						uf.setIntensity(UserField.INCREMENT * uf.getGear());
						break;
					case UserField.IMPULSE1_MODE:
						uf.increaseGear(1);
						break;
					}
				}
			}
			if (obstacles != null && !obstacles.isEmpty()) {
				RectangularObstacle obs = null;
				synchronized (obstacles.getSynchronizationLock()) {
					for (Iterator it = obstacles.iterator(); it.hasNext();) {
						obs = (RectangularObstacle) it.next();
						uf = obs.getUserField();
						if (uf != null) {
							uf.setAngle(dx, dy);
							switch (uf.getMode()) {
							case UserField.FORCE_MODE:
								uf.setIntensity(UserField.INCREMENT * uf.getGear());
								break;
							case UserField.IMPULSE1_MODE:
								uf.increaseGear(1);
								break;
							}
						}
					}
				}
			}
			refreshForces();
		}

		if (useJmol)
			refreshJmol();

	}