public static void maskRectangle(Graphics g, Rectangle rect, Color color) {
if (color == null) {
color = ColorConstants.blue;
}
int lineStyle = g.getLineStyle();
Color foregroundColor = g.getForegroundColor();
g.setLineStyle(SWT.LINE_SOLID);
g.setForegroundColor(color);
for (int i = 0, n = rect.height; i < n; i++, i++) {
for (int j = 0, m = rect.width; j < m; j++, j++) {
g.drawLine(rect.x + j, rect.y + i, rect.x + j, rect.y + i);
}
}
g.setLineStyle(lineStyle);
g.setForegroundColor(foregroundColor);
}