e.doit = true; } }); shell.addDisposeListener(new DisposeListener() { public void widgetDisposed(DisposeEvent e) {
	public Shell open(Display dpy) {		// Create a window and set its title.		this.display = dpy;		shell = new Shell(display);		shell.setText(bundle.getString("Image_analyzer"));				// Hook resize and dispose listeners.		shell.addControlListener(new ControlAdapter() {			public void controlResized(ControlEvent event) {				resizeShell(event);			}		});		shell.addDisposeListener(new DisposeListener() {			public void widgetDisposed(DisposeEvent e) {				if (animate && animateThread != null) {					// Stop the animation and wait for the					// thread to die before disposing the shell.					animate = false;					while (animateThread.isAlive()) {						if (!display.readAndDispatch()) display.sleep();					}				}				// Clean up.				if (image != null)					image.dispose();				whiteColor.dispose();				blackColor.dispose();				redColor.dispose();				greenColor.dispose();				blueColor.dispose();				fixedWidthFont.dispose();				crossCursor.dispose();			}		});		// Create colors and fonts.		whiteColor = new Color(display, 255, 255, 255);		blackColor = new Color(display, 0, 0, 0);		redColor = new Color(display, 255, 0, 0);		greenColor = new Color(display, 0, 255, 0);		blueColor = new Color(display, 0, 0, 255);		fixedWidthFont = new Font(display, "courier", 10, 0);		crossCursor = new Cursor(display, SWT.CURSOR_CROSS);				// Add a menu bar and widgets.		Menu menuBar = createMenuBar();		createWidgets();		shell.pack();				// Create a GC for drawing, and hook the listener to dispose it.		imageCanvasGC = new GC(imageCanvas);		imageCanvas.addDisposeListener(new DisposeListener() {			public void widgetDisposed(DisposeEvent e) {				imageCanvasGC.dispose();			}		});				// Open the window		shell.open();		return shell;	}