private void showDialog(DrawingElement e) {
		if (!EventQueue.isDispatchThread())
			throw new RuntimeException("must be called by the Event Dispatch Thread");
		JDialog d = null;
		if (e instanceof AbstractLine)
			d = createDialog((AbstractLine) e);
		else if (e instanceof AbstractRectangle)
			d = createDialog((AbstractRectangle) e);
		else if (e instanceof AbstractEllipse)
			d = createDialog((AbstractEllipse) e);
		else if (e instanceof AbstractTriangle)
			d = createDialog((AbstractTriangle) e);
		else if (e instanceof TextContainer)
			d = createDialog((TextContainer) e);
		if (d != null)
			d.setVisible(true);
	}