Rectangle rect = getClientArea();
x = (rect.width - 100) / 2;
y = (rect.height - 16) / 2;
Transform swtTransform = new Transform(e.gc.getDevice());
e.gc.getTransform(swtTransform);
swtTransform.translate(x, y);
e.gc.setTransform(swtTransform);
swtTransform.dispose();
e.gc.setBackground(getDisplay().getSystemColor(
SWT.COLOR_BLACK));
e.gc.setLineWidth((int) stroke.getLineWidth());