private boolean finalizeRotation() {
		if (!(selectedComponent instanceof Rotatable))
			throw new RuntimeException("The selected component is not rotatable");
		if (selectedComponent instanceof Molecule) {
			/* check if atoms are out of bound */
			Molecule mol = (Molecule) selectedComponent;
			return finalizeMoleculeRotation(mol);
		} else if (selectedComponent instanceof ImageComponent) {
			ImageComponent ic = (ImageComponent) selectedComponent;
			ModelComponent host = ic.getHost();
			if (host instanceof RadialBond) {
				Molecule mol = ((RadialBond) host).getMolecule();
				boolean b = finalizeMoleculeRotation(mol);
				if (!b)
					ic.restoreState();
				return b;
			}
		}
		return true;
	}