public void undo() {
			super.undo();
			switch (undoID) {
			case UndoAction.INSERT_A_PARTICLE:
				nAtom--;
				if (!model.getRecorderDisabled())
					atom[nAtom].initializeMovieQ(-1);
				if (atom[nAtom].isSelected())
					setSelectedComponent(null);
				model.setNumberOfParticles(nAtom);
				break;
			case ADOB_ID:
				RectangularObstacle ro = obstacles.get(obstacles.size() - 1);
				if (!model.getRecorderDisabled())
					ro.initializeMovieQ(-1);
				if (ro.isSelected())
					setSelectedComponent(null);
				obstacles.remove(ro);
				buffer = ro;
				break;
			case ADDI_ID:
				List<Integer> list = new ArrayList<Integer>();
				int n = model.getNumberOfParticles();
				list.add(n - 1);
				list.add(n - 2);
				removeMarkedAtoms(list);
				break;
			case WATE_ID:
				list = new ArrayList<Integer>();
				n = model.getNumberOfParticles();
				list.add(n - 1);
				list.add(n - 2);
				list.add(n - 3);
				removeMarkedAtoms(list);
				break;
			case BENZ_ID:
				list = new ArrayList<Integer>();
				n = model.getNumberOfParticles();
				for (int i = 0; i < 12; i++)
					list.add(n - 1 - i);
				removeMarkedAtoms(list);
				break;
			case ADCH_ID:
				list = new ArrayList<Integer>();
				n = model.getNumberOfParticles();
				for (int i = 0; i < ChainConfigure.number; i++)
					list.add(n - 1 - i);
				removeMarkedAtoms(list);
				break;
			case UndoAction.INSERT_A_MOLECULE:
				if (nInserted > 0) {
					list = new ArrayList<Integer>();
					n = model.getNumberOfParticles();
					Molecule mol = molecules.getMolecule(atom[n - 1]);
					if (mol.isSelected())
						setSelectedComponent(null);
					for (int i = 0; i < nInserted; i++)
						list.add(n - 1 - i);
					removeMarkedAtoms(list);
				}
				break;
			case UndoAction.FILL_AREA_WITH_PARTICLES:
				if (nInserted > 0) {
					list = new ArrayList<Integer>();
					n = model.getNumberOfParticles();
					for (int i = n - nInserted; i < n; i++)
						list.add(i);
					removeMarkedAtoms(list);
				}
				break;
			case DGBD_ID:
			case BBON_ID:
				buffer = bonds.get(bonds.size() - 1);
				bonds.remove((RadialBond) buffer);
				if (((RadialBond) buffer).isSelected())
					setSelectedComponent(null);
				MoleculeCollection.sort(model);
				break;
			case BBEN_ID:
				buffer = bends.get(bends.size() - 1);
				bends.remove((AngularBond) buffer);
				if (((AngularBond) buffer).isSelected())
					setSelectedComponent(null);
				break;
			case AACD_ID:
				list = new ArrayList<Integer>();
				list.add(model.getNumberOfParticles() - 1);
				removeMarkedAtoms(list);
				break;
			case ANTD_ID:
				list = new ArrayList<Integer>();
				list.add(model.getNumberOfParticles() - 1);
				list.add(model.getNumberOfParticles() - 2);
				removeMarkedAtoms(list);
				break;
			case SREC_ID:
			case SCUR_ID:
			case SCIR_ID:
			case SFRE_ID:
			case RREC_ID:
			case RCIR_ID:
			case RCUR_ID:
				list = new ArrayList<Integer>();
				n = model.getNumberOfParticles();
				Molecule mol = molecules.getMolecule(atom[n - 1]);
				if (mol.isSelected())
					setSelectedComponent(null);
				for (int i = 0; i < mol.size(); i++)
					list.add(n - 1 - i);
				removeMarkedAtoms(list);
				break;
			}
			model.notifyChange();
			repaint();
		}