private void transformObstacle(int index) {
		if (index < 0 || index >= model.getObstacleCount())
			return;
		boolean pgUp = (keyCode & Navigator.PGUP_PRESSED) == Navigator.PGUP_PRESSED;
		boolean pgDn = (keyCode & Navigator.PGDN_PRESSED) == Navigator.PGDN_PRESSED;
		boolean up = pgUp ? true : (keyCode & Navigator.UP_PRESSED) == Navigator.UP_PRESSED;
		boolean dn = pgDn ? true : (keyCode & Navigator.DOWN_PRESSED) == Navigator.DOWN_PRESSED;
		if (!up)
			up = (keyCode & Navigator.RIGHT_PRESSED) == Navigator.RIGHT_PRESSED;
		if (!dn)
			dn = (keyCode & Navigator.LEFT_PRESSED) == Navigator.LEFT_PRESSED;
		boolean mx = (keyCode & Navigator.X_PRESSED) == Navigator.X_PRESSED;
		boolean my = (keyCode & Navigator.Y_PRESSED) == Navigator.Y_PRESSED;
		boolean mz = (keyCode & Navigator.Z_PRESSED) == Navigator.Z_PRESSED;
		float t = KeyboardParameterManager.sharedInstance().getAtomDisplacement(
				pgUp || pgDn ? KeyboardParameterManager.FAST : KeyboardParameterManager.SLOW);
		if (!up)
			t = -t;
		Obstacle obs = model.getObstacle(index);
		if (mx) {
			obs.getCenter().x += t;
			if (!obs.isContained('x') || obs.overlapWithAtoms()) {
				obs.getCenter().x -= t;
			}
			else {
				viewer.setObstacleLocation(index, obs.getCenter());
			}
		}
		if (my) {
			obs.getCenter().y += t;
			if (!obs.isContained('y') || obs.overlapWithAtoms()) {
				obs.getCenter().y -= t;
			}
			else {
				viewer.setObstacleLocation(index, obs.getCenter());
			}
		}
		if (mz) {
			obs.getCenter().z += t;
			if (!obs.isContained('z') || obs.overlapWithAtoms()) {
				obs.getCenter().z -= t;
			}
			else {
				viewer.setObstacleLocation(index, obs.getCenter());
			}
		}
		repaint();
	}