public void undo() {
			super.undo();
			doNotFireUndoEvent = true;
			switch (undoID) {
			case UndoAction.INSERT_LAYERED_COMPONENT:
				layerBasket.remove(lc);
				if (((ModelComponent) lc).isSelected())
					setSelectedComponent(null);
				break;
			case UndoAction.REMOVE_LAYERED_COMPONENT:
				layerBasket.add(lc);
				((ModelComponent) lc).setSelected(true);
				break;
			case UndoAction.SEND_BACK_LAYERED_COMPONENT:
				layerForward(lc);
				break;
			case UndoAction.BRING_FORWARD_LAYERED_COMPONENT:
				layerBack(lc);
				break;
			case UndoAction.FRONT_LAYERED_COMPONENT:
				lc.setLayer(Layered.BEHIND_PARTICLES);
				break;
			case UndoAction.BACK_LAYERED_COMPONENT:
				lc.setLayer(Layered.IN_FRONT_OF_PARTICLES);
				break;
			case UndoAction.DETACH_LAYERED_COMPONENT:
				lc.setHost(mc);
				break;
			case UndoAction.ATTACH_LAYERED_COMPONENT:
				lc.setHost(null);
				if (lc instanceof ModelComponent)
					((ModelComponent) lc).restoreState();
				break;
			case UndoAction.RESIZE_LINE:
				if (lc instanceof LineComponent)
					((LineComponent) lc).restoreState();
				break;
			case UndoAction.RESIZE_RECTANGLE:
				if (lc instanceof RectangleComponent)
					((RectangleComponent) lc).restoreState();
				break;
			case UndoAction.RESIZE_TRIANGLE:
				if (lc instanceof TriangleComponent)
					((TriangleComponent) lc).restoreState();
				break;
			case UndoAction.RESIZE_ELLIPSE:
				if (lc instanceof EllipseComponent)
					((EllipseComponent) lc).restoreState();
				break;
			}
			doNotFireUndoEvent = false;
			getModel().notifyChange();
			repaint();
		}