Search in sources :

Example 1 with RotatableSVGWorkspaceImageFigure

use of org.palladiosimulator.editors.sirius.custom.style.rotatable.figure.RotatableSVGWorkspaceImageFigure 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));
    }
}
Also used : RotatableSVGWorkspaceImageFigure(org.palladiosimulator.editors.sirius.custom.style.rotatable.figure.RotatableSVGWorkspaceImageFigure) EObject(org.eclipse.emf.ecore.EObject) Rectangle(org.eclipse.draw2d.geometry.Rectangle) CustomStyle(org.eclipse.sirius.diagram.CustomStyle) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart)

Example 2 with RotatableSVGWorkspaceImageFigure

use of org.palladiosimulator.editors.sirius.custom.style.rotatable.figure.RotatableSVGWorkspaceImageFigure 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;
}
Also used : PropagateFigureListenerAtConnectionFigure(org.palladiosimulator.editors.sirius.custom.style.rotatable.editPart.listener.PropagateFigureListenerAtConnectionFigure) RotatableSVGWorkspaceImageFigure(org.palladiosimulator.editors.sirius.custom.style.rotatable.figure.RotatableSVGWorkspaceImageFigure) NodeListener(org.eclipse.gef.NodeListener) AbstractNotSelectableShapeNodeEditPart(org.eclipse.sirius.diagram.ui.edit.api.part.AbstractNotSelectableShapeNodeEditPart) IStyleEditPart(org.eclipse.sirius.diagram.ui.edit.api.part.IStyleEditPart) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) EditPart(org.eclipse.gef.EditPart) NodeImageExtension(org.palladiosimulator.editors.sirius.custom.style.rotatable.NodeImageExtension) CustomStyle(org.eclipse.sirius.diagram.CustomStyle) GraphicalEditPart(org.eclipse.gef.GraphicalEditPart) RotatableEditPartListener(org.palladiosimulator.editors.sirius.custom.style.rotatable.figure.listener.RotatableEditPartListener)

Aggregations

GraphicalEditPart (org.eclipse.gef.GraphicalEditPart)2 CustomStyle (org.eclipse.sirius.diagram.CustomStyle)2 RotatableSVGWorkspaceImageFigure (org.palladiosimulator.editors.sirius.custom.style.rotatable.figure.RotatableSVGWorkspaceImageFigure)2 Rectangle (org.eclipse.draw2d.geometry.Rectangle)1 EObject (org.eclipse.emf.ecore.EObject)1 EditPart (org.eclipse.gef.EditPart)1 NodeListener (org.eclipse.gef.NodeListener)1 AbstractNotSelectableShapeNodeEditPart (org.eclipse.sirius.diagram.ui.edit.api.part.AbstractNotSelectableShapeNodeEditPart)1 IStyleEditPart (org.eclipse.sirius.diagram.ui.edit.api.part.IStyleEditPart)1 NodeImageExtension (org.palladiosimulator.editors.sirius.custom.style.rotatable.NodeImageExtension)1 PropagateFigureListenerAtConnectionFigure (org.palladiosimulator.editors.sirius.custom.style.rotatable.editPart.listener.PropagateFigureListenerAtConnectionFigure)1 RotatableEditPartListener (org.palladiosimulator.editors.sirius.custom.style.rotatable.figure.listener.RotatableEditPartListener)1