public void removeSelectedComponent() {
		if (selectedComponent == null)
			return;
		super.removeSelectedComponent();
		if (selectedComponent instanceof Atom) {
			List<Integer> list = new ArrayList<Integer>();
			list.add(((Atom) selectedComponent).getIndex());
			selectedComponent.setSelected(false);
			removeMarkedAtoms(list);
			pasteBuffer = atomBufferArray[atomBufferArray.length - 1];
			repaint();
			model.setNumberOfParticles(nAtom);
			if (!doNotFireUndoEvent) {
				int id = UndoAction.BLOCK_REMOVE;
				if (actionID == SACD_ID)
					id = actionID;
				model.getUndoManager().undoableEditHappened(new UndoableEditEvent(model, new UndoableDeletion(id, 1)));
				updateUndoUIComponents();
			}
		} else if (selectedComponent instanceof Molecule) {
			restoreMolecule = true;
			Molecule mol = (Molecule) selectedComponent;
			int imol = molecules.indexOf(mol);
			molecules.remove(mol);
			List<Integer> list = new ArrayList<Integer>();
			synchronized (mol.getSynchronizedLock()) {
				for (Iterator it = mol.iterator(); it.hasNext();) {
					list.add(((Atom) it.next()).getIndex());
				}
			}
			if (selectedComponent instanceof Polypeptide) {
				model.notifyModelListeners(new ModelEvent(selectedComponent, ModelEvent.COMPONENT_REMOVED, null, new Integer(imol)));
			}
			removeMarkedAtoms(list);
			if (!list.isEmpty()) {
				pasteBuffer = mol;
				molecules.clearSelection();
				repaint();
				model.setNumberOfParticles(nAtom);
			}
			if (!doNotFireUndoEvent) {
				model.getUndoManager().undoableEditHappened(new UndoableEditEvent(model, new UndoableDeletion(UndoAction.BLOCK_REMOVE, list.size())));
				updateUndoUIComponents();
			}
		} else if (selectedComponent instanceof RectangularObstacle) {
			RectangularObstacle r = (RectangularObstacle) selectedComponent;
			obstacles.remove(r);
			if (!model.getRecorderDisabled())
				r.initializeMovieQ(-1);
			pasteBuffer = selectedComponent;
			if (!doNotFireUndoEvent) {
				model.getUndoManager().undoableEditHappened(new UndoableEditEvent(model, new UndoableDeletion(UndoAction.REMOVE_OBSTACLE, selectedComponent)));
				updateUndoUIComponents();
			}
		} else if (selectedComponent instanceof RadialBond) {
			bonds.remove((RadialBond) selectedComponent);
			bondChanged(null);
			List ab = removeAssociatedBends((RadialBond) selectedComponent);
			MoleculeCollection.sort(model);
			if (!doNotFireUndoEvent) {
				model.getUndoManager().undoableEditHappened(new UndoableEditEvent(model, new UndoableDeletion(UndoAction.REMOVE_RADIAL_BOND, new Object[] { selectedComponent, ab })));
				updateUndoUIComponents();
			}
		} else if (selectedComponent instanceof AngularBond) {
			bends.remove((AngularBond) selectedComponent);
			if (!doNotFireUndoEvent) {
				model.getUndoManager().undoableEditHappened(new UndoableEditEvent(model, new UndoableDeletion(UndoAction.REMOVE_ANGULAR_BOND, selectedComponent)));
				updateUndoUIComponents();
			}
		}
		if (selectedComponent != null) {
			selectedComponent.setSelected(false);
			selectedComponent = null;
		}
		repaint();
		model.notifyChange();
	}