private void pasteComponent(final Component c) {
		if (c == null)
			return;
		if (c instanceof Engine) {
			if (c instanceof ModelCanvas) {
				if (((ModelCanvas) c).getPage() == this) {
					if (!((ModelCanvas) c).isUsed()) {
						insertComponent(c);
					}
				} else {
					EventQueue.invokeLater(new Runnable() {
						public void run() {
							JOptionPane.showMessageDialog(JOptionPane.getFrameForComponent(Page.this), "Sorry, currently a model container cannot be transfered to a new window.", "Model Container", JOptionPane.INFORMATION_MESSAGE);
						}
					});
				}
			} else {
				if (c instanceof PageMolecularViewer) {
					new SwingWorker("Page:pasteComponent():copy molecular viewer") {
						public Object construct() {
							PageMolecularViewer mv = ((PageMolecularViewer) c).getCopy();
							mv.loadCurrentResource();
							return mv;
						}

						public void finished() {
							final PageMolecularViewer mv = (PageMolecularViewer) get();
							insertComponent(mv);
							EventQueue.invokeLater(new Runnable() {
								public void run() {
									mv.loadCurrentResource(); // FIXME:why need to call this twice?
								}
							});
						}
					}.start();
				}
			}
		} else {
			if (c instanceof AudioPlayer) {
				insertComponent(new AudioPlayer((AudioPlayer) c, this));
			}
			if (c instanceof PageApplet) {
				insertComponent(new PageApplet((PageApplet) c, this));
			}
			if (c instanceof PageJContainer) {
				insertComponent(new PageJContainer((PageJContainer) c, this));
			} else if (c instanceof PageButton) {
				insertComponent(new PageButton((PageButton) c, this));
			} else if (c instanceof PageCheckBox) {
				insertComponent(new PageCheckBox((PageCheckBox) c, this));
			} else if (c instanceof PageRadioButton) {
				insertComponent(new PageRadioButton((PageRadioButton) c, this));
			} else if (c instanceof PageComboBox) {
				insertComponent(new PageComboBox((PageComboBox) c, this));
			} else if (c instanceof PageSpinner) {
				insertComponent(new PageSpinner((PageSpinner) c, this));
			} else if (c instanceof PageSlider) {
				insertComponent(new PageSlider((PageSlider) c, this));
			} else if (c instanceof PageDNAScroller) {
				insertComponent(new PageDNAScroller((PageDNAScroller) c, this));
			} else if (c instanceof PagePotentialWell) {
				insertComponent(new PagePotentialWell((PagePotentialWell) c, this));
			} else if (c instanceof PagePotentialHill) {
				insertComponent(new PagePotentialHill((PagePotentialHill) c, this));
			} else if (c instanceof PageNumericBox) {
				insertComponent(new PageNumericBox((PageNumericBox) c, this));
			} else if (c instanceof PageBarGraph) {
				insertComponent(new PageBarGraph((PageBarGraph) c, this));
			} else if (c instanceof PageGauge) {
				insertComponent(new PageGauge((PageGauge) c, this));
			} else if (c instanceof PageXYGraph) {
				insertComponent(new PageXYGraph((PageXYGraph) c, this));
			} else if (c instanceof PageElectronicStructureViewer) {
				insertComponent(new PageElectronicStructureViewer((PageElectronicStructureViewer) c, this));
			} else if (c instanceof PageDiffractionInstrument) {
				insertComponent(new PageDiffractionInstrument((PageDiffractionInstrument) c, this));
			} else if (c instanceof PagePhotonSpectrometer) {
				insertComponent(new PagePhotonSpectrometer((PagePhotonSpectrometer) c, this));
			} else if (c instanceof PageTable) {
				insertComponent(new PageTable((PageTable) c, this));
			} else if (c instanceof PageTextField) {
				insertComponent(new PageTextField((PageTextField) c, this));
			} else if (c instanceof PageTextArea) {
				insertComponent(new PageTextArea((PageTextArea) c, this));
			} else if (c instanceof PageTextBox) {
				insertComponent(new PageTextBox((PageTextBox) c, this));
			} else if (c instanceof PageMultipleChoice) {
				insertComponent(new PageMultipleChoice((PageMultipleChoice) c, this));
			} else if (c instanceof ImageQuestion) {
				insertComponent(new ImageQuestion((ImageQuestion) c, this));
			} else if (c instanceof SearchTextField) {
				insertComponent(new SearchTextField((SearchTextField) c, this));
			} else if (c instanceof ActivityButton) {
				insertComponent(new ActivityButton((ActivityButton) c, this));
			} else if (c instanceof PageFeedbackArea) {
				insertComponent(new PageFeedbackArea((PageFeedbackArea) c, this));
			} else if (c instanceof PageScriptConsole) {
				insertComponent(new PageScriptConsole((PageScriptConsole) c, this));
			} else if (c instanceof PagePeriodicTable) {
				insertComponent(new PagePeriodicTable((PagePeriodicTable) c, this));
			} else if (c instanceof PageFunctionGraph) {
				insertComponent(new PageFunctionGraph((PageFunctionGraph) c, this));
			} else if (c instanceof IconWrapper) {
				insertComponent(IconWrapper.newInstance(((IconWrapper) c).getIcon(), this));
			}
		}
	}