private void translateAtoms(BitSet bs) {
		int n = model.getAtomCount();
		if (n <= 0)
			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;
		if (bs.cardinality() > 1) {
			for (int i = 0; i < n; i++) {
				if (bs.get(i)) {
					translateAtom(model.getAtom(i), mx, my, mz, false, t);
				}
			}
			if (shouldRejectMoving(bs)) { // roll back the translation
				for (int i = 0; i < n; i++) {
					if (bs.get(i)) {
						translateAtom(model.getAtom(i), mx, my, mz, false, -t);
					}
				}
			}
		}
		else {
			int i = bs.nextSetBit(0);
			if (i >= 0) {
				translateAtom(model.getAtom(i), mx, my, mz, true, t);
				if (model.getMinimumDistance(bs) < 0 || model.overlapWithObstacles(bs)) {
					// roll back the translation
					translateAtom(model.getAtom(i), mx, my, mz, true, -t);
				}
			}
		}
		refresh();
	}