use of org.eclipse.sirius.diagram.CustomStyle in project Palladio-Editors-Sirius by PalladioSimulator.
the class AbstractRotatableImageEditPart method refreshVisuals.
/**
* {@inheritDoc}
*
* @see org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeEditPart#refreshVisuals()
*/
protected void refreshVisuals() {
super.refreshVisuals();
RotatableSVGWorkspaceImageFigure figure = this.getPrimaryShape();
getSourceConnections();
EObject element = this.resolveSemanticElement();
if (element instanceof CustomStyle) {
CustomStyle imageStyle = (CustomStyle) element;
figure.refreshFigure(imageStyle);
((GraphicalEditPart) this.getParent()).setLayoutConstraint(this, this.getFigure(), new Rectangle(0, 0, figure.getPreferredSize().width, figure.getPreferredSize().height));
}
}
use of org.eclipse.sirius.diagram.CustomStyle in project Palladio-Editors-Sirius by PalladioSimulator.
the class AbstractRotatableImageEditPart method createNodeShape.
/**
* @generated
*/
protected IFigure createNodeShape() {
CustomStyle imageStyle = (CustomStyle) resolveSemanticElement();
NodeImageExtension imageExtension = ExtensionActivator.getDefault().getBestImageExtension(imageStyle.getId());
primaryShape = new RotatableSVGWorkspaceImageFigure(imageExtension.getMode(), imageExtension.getTopImage(), imageExtension.getLeftImage(), imageExtension.getBottomImage(), imageExtension.getRightImage());
listener = new RotatableEditPartListener(this);
primaryShape.addFigureListener(listener);
EditPart parentEditPart = getParent();
if (parentEditPart instanceof GraphicalEditPart) {
GraphicalEditPart parentGraphicalEditPart = (GraphicalEditPart) parentEditPart;
NodeListener dEdgeEditPartListener = new PropagateFigureListenerAtConnectionFigure(listener);
parentGraphicalEditPart.addNodeListener(dEdgeEditPartListener);
}
return primaryShape;
}
Aggregations