public void handleEvent(Event event) { GC gc; Rectangle rect = canvas.getClientArea(); Image buffer = null; if (dbItem.getSelection()) { buffer = new Image(canvas.getDisplay(), rect); gc = new GC(buffer); } else { gc = event.gc; } paintBackground(gc, rect); GraphicsTab tab = getTab(); if (tab != null) tab.paint(gc, rect.width, rect.height); if (gc != event.gc) gc.dispose(); if (buffer != null) { event.gc.drawImage(buffer, 0, 0); buffer.dispose();
public void handleEvent (Event event) { Rectangle rect = vSash.getParent().getClientArea(); event.y = Math.min (Math.max (event.y, 40), rect.height - 40); if (event.detail != SWT.DRAG) { FormData data = (FormData)hSash.getLayoutData(); data.top.offset = event.y; parent.layout(true);
		public void handleEvent(Event event) {			GC gc;			Rectangle rect = canvas.getClientArea();			Image buffer = null;			if (dbItem.getSelection()) {				buffer = new Image(canvas.getDisplay(), rect);				gc = new GC(buffer);			} else {				gc = event.gc;			}			paintBackground(gc, rect);			GraphicsTab tab = getTab();			if (tab != null) tab.paint(gc, rect.width, rect.height);			if (gc != event.gc) gc.dispose();			if (buffer != null) {				event.gc.drawImage(buffer, 0, 0);				buffer.dispose();			}		}