public void createPopupMenu() {

		if (popupMenu != null)
			return;

		popupMenu = new JPopupMenu();
		popupMenu.setInvoker(this);

		String s = Modeler.getInternationalText("CustomizeThisSpectrometer");
		miCustom = new JMenuItem((s != null ? s : "Customize This "
				+ (getType() == PhotonSpectrometer.EMISSION ? "Emission" : "Absorption") + " Spectrometer")
				+ "...");
		miCustom.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				if (maker == null) {
					maker = new PagePhotonSpectrometerMaker(PagePhotonSpectrometer.this);
				}
				else {
					maker.setObject(PagePhotonSpectrometer.this);
				}
				maker.invoke(page);
			}
		});
		popupMenu.add(miCustom);

		s = Modeler.getInternationalText("RemoveThisSpectrometer");
		miRemove = new JMenuItem(s != null ? s : "Remove This "
				+ (getType() == PhotonSpectrometer.EMISSION ? "Emission" : "Absorption") + " Spectrometer");
		miRemove.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				page.removeComponent(PagePhotonSpectrometer.this);
			}
		});
		popupMenu.add(miRemove);

		s = Modeler.getInternationalText("CopyThisSpectrometer");
		JMenuItem mi = new JMenuItem(s != null ? s : "Copy This Spectrometer");
		mi.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				page.copyComponent(PagePhotonSpectrometer.this);
			}
		});
		popupMenu.add(mi);
		popupMenu.addSeparator();

		s = Modeler.getInternationalText("TakeSnapshot");
		mi = new JMenuItem((s != null ? s : "Take a Snapshot") + "...");
		mi.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				SnapshotGallery.sharedInstance().takeSnapshot(page.getAddress(), PagePhotonSpectrometer.this);
			}
		});
		popupMenu.add(mi);
		popupMenu.addSeparator();

		s = Modeler.getInternationalText("ClearLines");
		mi = new JMenuItem(s != null ? s : "Clear Lines");
		mi.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				clearLines();
			}
		});
		popupMenu.add(mi);

		final JMenuItem miIntensity = new JMenuItem("Show Line Intensity...");
		miIntensity.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				showLineIntensity();
			}
		});
		popupMenu.add(miIntensity);

		popupMenu.addPopupMenuListener(new PopupMenuListener() {
			public void popupMenuCanceled(PopupMenuEvent e) {
			}

			public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
				miCustom.setEnabled(changable);
				miRemove.setEnabled(changable);
				miIntensity.setEnabled(getNumberOfLines() > 0);
			}

			public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
			}
		});

		popupMenu.pack();

	}