org.eclipse.swt.graphics.Rectangle contentRect = new org.eclipse.swt.graphics.Rectangle(0 + BASE_RECT_SPACE_X, 0 + BASE_RECT_SPACE_Y, content_width, image_height + label_height + IMAGE_LABEL_SPACE + TOP_BOTTOM_SPACE + TOP_BOTTOM_SPACE);
org.eclipse.swt.graphics.Rectangle imageRect = new org.eclipse.swt.graphics.Rectangle(0 + BASE_RECT_SPACE_X, 0 + BASE_RECT_SPACE_Y + TOP_BOTTOM_SPACE, content_width, image_height);
org.eclipse.swt.graphics.Rectangle labelRect = new org.eclipse.swt.graphics.Rectangle(0 + BASE_RECT_SPACE_X, 0 + BASE_RECT_SPACE_Y + image_height + IMAGE_LABEL_SPACE, content_width, label_height + TOP_BOTTOM_SPACE);
final IGaService gaService = Graphiti.getGaService();
final RoundedRectangle baseRectangle = gaService.createRoundedRectangle(containerShape, ROUNDED_RECTANGLE_WIDTH, ROUNDED_RECTANGLE_HEIGHT);
// create invisible outer rectangle expanded by
// the width needed for the anchor
gaService.setLocationAndSize(baseRectangle, baseRect.x, baseRect.y, baseRect.width, baseRect.height);
baseRectangle.setFilled(false);
baseRectangle.setLineVisible(false);
// shadow
RoundedRectangle shadowRectangle; // need to access it later
{
// create and set visible rectangle inside invisible rectangle
shadowRectangle = gaService.createRoundedRectangle(baseRectangle, ROUNDED_RECTANGLE_WIDTH, ROUNDED_RECTANGLE_HEIGHT);
shadowRectangle.setParentGraphicsAlgorithm(baseRectangle);
shadowRectangle.setStyle(StyleUtil.getShadowStyleForCamelClass(getDiagram()));
shadowRectangle.setLineVisible(false);
shadowRectangle.setFilled(true);
gaService.setLocationAndSize(shadowRectangle, shadowRect.x, shadowRect.y, shadowRect.width, shadowRect.height);
}
// the real figure
RoundedRectangle roundedRectangle; // need to access it later
{
// create and set visible rectangle inside invisible rectangle
roundedRectangle = gaService.createRoundedRectangle(baseRectangle, ROUNDED_RECTANGLE_WIDTH, ROUNDED_RECTANGLE_HEIGHT);
roundedRectangle.setParentGraphicsAlgorithm(baseRectangle);
roundedRectangle.setStyle(StyleUtil.getStyleForCamelClass(getDiagram()));
gaService.setLocationAndSize(roundedRectangle, contentRect.x, contentRect.y, contentRect.width, contentRect.height);
}
// image
{