Bounds bounds = getBounds();
canvas.drawRectangle(0, 0, bounds.getWidth(), bounds.getHeight(), Toolkit.getColor(0x0000ff));
canvas.drawText("Test Workspace", 10, 20, Toolkit.getColor(0x0000ff), Toolkit.getText(ColorsAndFonts.TEXT_TITLE));
for (int i = 0; i < views.size(); i++) {
View view = (View) views.elementAt(i);
if (showOutline()) {
final Size requiredSize = view.getSize();
final Location location = view.getLocation();
final int width = requiredSize.getWidth();
final int height = requiredSize.getHeight();
final int baseline = location.getY() + view.getBaseline();
final int left = location.getX() - 10;
final int top = location.getY() - 10;
final int right = left + 10 + width - 1 + 10;
final int bottom = top + 10 + height - 1 + 10;
// horizontal lines
canvas.drawLine(left, top + 10, right, top + 10, markerDark);
canvas.drawLine(left, bottom - 10, right, bottom - 10, markerDark);
// vertical lines
canvas.drawLine(left + 10, top, left + 10, bottom, markerDark);
canvas.drawLine(right - 10, top, right - 10, bottom, markerDark);
canvas.drawRectangle(left + 10, top + 10, width - 1, height - 1, markerLight);
canvas.drawLine(left, baseline, left + 10, baseline, markerDark);
canvas.drawLine(right - 10, baseline, right, baseline, markerDark);
canvas.drawLine(left + 10, baseline, right - 10, baseline, markerLight);
}
Canvas subcanvas = canvas.createSubcanvas(view.getBounds());
view.draw(subcanvas);
}
}