EditPart part = getViewer().getContents();
if (part instanceof ActivityDiagramPart) {
ActivityDiagramPart diagramPart = (ActivityDiagramPart) part;
direction = diagramPart.getDirection();
}
BorderedContainerFigure figure = new BorderedContainerFigure(createHeaderFigure(direction), direction);
figure.addActionListener(this);
return figure;
}