Пример #1
0
  @Override
  protected void decorateView(
      View containerView,
      View view,
      IAdaptable semanticAdapter,
      String semanticHint,
      int index,
      boolean persisted) {

    super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);

    // Create the region compartment
    IAdaptable eObjectAdapter = null;
    EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
    if (eObject != null) {
      eObjectAdapter = new EObjectAdapter(eObject);
    }
    FactoryUtils.createLabel(view, SemanticHints.REGION_NAME);

    getViewService()
        .createNode(
            eObjectAdapter,
            view,
            SemanticHints.REGION_COMPARTMENT,
            ViewUtil.APPEND,
            true,
            getPreferencesHint());
  }
Пример #2
0
  /** @generated NOT */
  protected void decorateView(
      View containerView,
      View view,
      IAdaptable semanticAdapter,
      String semanticHint,
      int index,
      boolean persisted) {
    if (semanticHint == null) {
      semanticHint = OepcVisualIDRegistry.getType(XORConnectorEditPart.VISUAL_ID);
      view.setType(semanticHint);
    }
    super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
    if (!OEPCEditPart.MODEL_ID.equals(OepcVisualIDRegistry.getModelID(containerView))) {
      EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
      shortcutAnnotation.setSource("Shortcut"); // $NON-NLS-1$
      shortcutAnnotation.getDetails().put("modelID", OEPCEditPart.MODEL_ID); // $NON-NLS-1$
      view.getEAnnotations().add(shortcutAnnotation);
    }

    // setting up default color background to view style
    NotationPackage NOTATION = NotationPackage.eINSTANCE;
    EClass shapeStyle = NOTATION.getShapeStyle();
    ShapeStyle style = (ShapeStyle) view.getStyle(shapeStyle);
    if (style == null) {
      style = (ShapeStyle) view.createStyle(shapeStyle);
    }
    BflowDiagramEditPart.apply(XORConnectorEditPart.class, style);
  }
 /** @generated */
 protected void decorateView(
     View containerView,
     View view,
     IAdaptable semanticAdapter,
     String semanticHint,
     int index,
     boolean persisted) {
   if (semanticHint == null) {
     semanticHint =
         BusinessVisualIDRegistry.getType(
             org.talend.designer.business.model.business.diagram.edit.parts
                 .DataBusinessItemEditPart.VISUAL_ID);
     view.setType(semanticHint);
   }
   super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
   if (!BusinessProcessEditPart.MODEL_ID.equals(
       BusinessVisualIDRegistry.getModelID(containerView))) {
     EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
     shortcutAnnotation.setSource("Shortcut"); // $NON-NLS-1$
     shortcutAnnotation
         .getDetails()
         .put("modelID", BusinessProcessEditPart.MODEL_ID); // $NON-NLS-1$
     view.getEAnnotations().add(shortcutAnnotation);
   }
   getViewService()
       .createNode(
           semanticAdapter,
           view,
           BusinessVisualIDRegistry.getType(DataBusinessItemNameEditPart.VISUAL_ID),
           ViewUtil.APPEND,
           true,
           getPreferencesHint());
 }
Пример #4
0
 /** @generated */
 protected void decorateView(
     View containerView,
     View view,
     IAdaptable semanticAdapter,
     String semanticHint,
     int index,
     boolean persisted) {
   if (semanticHint == null) {
     semanticHint =
         OntoUML.diagram.part.OntoUMLVisualIDRegistry.getType(
             OntoUML.diagram.edit.parts.RoleEditPart.VISUAL_ID);
     view.setType(semanticHint);
   }
   super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
   if (!OntoUML.diagram.edit.parts.ContainerEditPart.MODEL_ID.equals(
       OntoUML.diagram.part.OntoUMLVisualIDRegistry.getModelID(containerView))) {
     EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
     shortcutAnnotation.setSource("Shortcut"); // $NON-NLS-1$
     shortcutAnnotation
         .getDetails()
         .put("modelID", OntoUML.diagram.edit.parts.ContainerEditPart.MODEL_ID); // $NON-NLS-1$
     view.getEAnnotations().add(shortcutAnnotation);
   }
   IAdaptable eObjectAdapter = null;
   EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
   if (eObject != null) {
     eObjectAdapter = new EObjectAdapter(eObject);
   }
   getViewService()
       .createNode(
           eObjectAdapter,
           view,
           OntoUML.diagram.part.OntoUMLVisualIDRegistry.getType(
               OntoUML.diagram.edit.parts.WrappingLabel9EditPart.VISUAL_ID),
           ViewUtil.APPEND,
           true,
           getPreferencesHint());
   getViewService()
       .createNode(
           eObjectAdapter,
           view,
           OntoUML.diagram.part.OntoUMLVisualIDRegistry.getType(
               OntoUML.diagram.edit.parts.RoleNameEditPart.VISUAL_ID),
           ViewUtil.APPEND,
           true,
           getPreferencesHint());
   getViewService()
       .createNode(
           eObjectAdapter,
           view,
           OntoUML.diagram.part.OntoUMLVisualIDRegistry.getType(
               OntoUML.diagram.edit.parts.RoleAttributeCompartmentEditPart.VISUAL_ID),
           ViewUtil.APPEND,
           true,
           getPreferencesHint());
 }
Пример #5
0
  @Override
  protected void initializeFromPreferences(View view) {
    super.initializeFromPreferences(view);
    IPreferenceStore store = (IPreferenceStore) getPreferencesHint().getPreferenceStore();
    if (store == null) {
      return;
    }

    // Create region default styles
    ShapeStyle style = (ShapeStyle) view.getStyle(NotationPackage.Literals.SHAPE_STYLE);
    RGB fillRGB =
        PreferenceConverter.getColor(store, StatechartPreferenceConstants.PREF_REGION_BACKGROUND);
    style.setFillColor(FigureUtilities.RGBToInteger(fillRGB));
    RGB lineRGB =
        PreferenceConverter.getColor(store, StatechartPreferenceConstants.PREF_REGION_LINE);
    style.setLineColor(FigureUtilities.RGBToInteger(lineRGB));
  }
Пример #6
0
 /** @generated */
 protected void decorateView(
     View containerView,
     View view,
     IAdaptable semanticAdapter,
     String semanticHint,
     int index,
     boolean persisted) {
   if (semanticHint == null) {
     semanticHint = MolicVisualIDRegistry.getType(UbiquitousAccessEditPart.VISUAL_ID);
     view.setType(semanticHint);
   }
   super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
   if (!DiagramEditPart.MODEL_ID.equals(MolicVisualIDRegistry.getModelID(containerView))) {
     EAnnotation shortcutAnnotation = EcoreFactory.eINSTANCE.createEAnnotation();
     shortcutAnnotation.setSource("Shortcut"); // $NON-NLS-1$
     shortcutAnnotation.getDetails().put("modelID", DiagramEditPart.MODEL_ID); // $NON-NLS-1$
     view.getEAnnotations().add(shortcutAnnotation);
   }
 }
Пример #7
0
 /** @generated */
 protected void decorateView(
     View containerView,
     View view,
     IAdaptable semanticAdapter,
     String semanticHint,
     int index,
     boolean persisted) {
   if (semanticHint == null) {
     semanticHint =
         edu.toronto.cs.openome_model.diagram.part.Openome_modelVisualIDRegistry.getType(
             edu.toronto.cs.openome_model.diagram.edit.parts.Softgoal3EditPart.VISUAL_ID);
     view.setType(semanticHint);
   }
   super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
   IAdaptable eObjectAdapter = null;
   EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
   if (eObject != null) {
     eObjectAdapter = new EObjectAdapter(eObject);
   }
   getViewService()
       .createNode(
           eObjectAdapter,
           view,
           edu.toronto.cs.openome_model.diagram.part.Openome_modelVisualIDRegistry.getType(
               edu.toronto.cs.openome_model.diagram.edit.parts.SoftgoalName3EditPart.VISUAL_ID),
           ViewUtil.APPEND,
           true,
           getPreferencesHint());
   getViewService()
       .createNode(
           eObjectAdapter,
           view,
           edu.toronto.cs.openome_model.diagram.part.Openome_modelVisualIDRegistry.getType(
               edu.toronto.cs.openome_model.diagram.edit.parts
                   .SoftgoalQualitativeReasoningCom3EditPart.VISUAL_ID),
           ViewUtil.APPEND,
           true,
           getPreferencesHint());
 }
 /** @generated */
 protected void decorateView(
     View containerView,
     View view,
     IAdaptable semanticAdapter,
     String semanticHint,
     int index,
     boolean persisted) {
   if (semanticHint == null) {
     semanticHint =
         UMLVisualIDRegistry.getType(
             StructuredActivityNode_StructuredActivityNode_OutputPinEditPart.VISUAL_ID);
     view.setType(semanticHint);
   }
   super.decorateView(containerView, view, semanticAdapter, semanticHint, index, persisted);
   IAdaptable eObjectAdapter = null;
   EObject eObject = (EObject) semanticAdapter.getAdapter(EObject.class);
   if (eObject != null) {
     eObjectAdapter = new EObjectAdapter(eObject);
   }
   getViewService()
       .createNode(
           eObjectAdapter,
           view,
           UMLVisualIDRegistry.getType(
               StructuredActivityNode_StructuredActivityNode_OutputPinNameEditPart.VISUAL_ID),
           ViewUtil.APPEND,
           true,
           getPreferencesHint());
   getViewService()
       .createNode(
           eObjectAdapter,
           view,
           UMLVisualIDRegistry.getType(
               StructuredActivityNode_StructuredActivityNode_OutputPinOrderingEditPart.VISUAL_ID),
           ViewUtil.APPEND,
           true,
           getPreferencesHint());
 }
 /** @generated NOT */
 protected void initializeFromPreferences(View view) {
   super.initializeFromPreferences(view);
   ((FillStyle) view.getStyle(NotationPackage.Literals.FILL_STYLE))
       .setFillColor(FigureUtilities.colorToInteger(DEFAULT_COLOR));
 }