Beispiel #1
0
 /** @generated */
 public static int getNodeVisualID(View containerView, EObject domainElement) {
   if (domainElement == null) {
     return -1;
   }
   String containerModelID = SUC.diagram.part.SUCVisualIDRegistry.getModelID(containerView);
   if (!SUCmodelEditPart.MODEL_ID.equals(containerModelID)) {
     return -1;
   }
   int containerVisualID;
   if (SUCmodelEditPart.MODEL_ID.equals(containerModelID)) {
     containerVisualID = SUC.diagram.part.SUCVisualIDRegistry.getVisualID(containerView);
   } else {
     if (containerView instanceof Diagram) {
       containerVisualID = SUCmodelEditPart.VISUAL_ID;
     } else {
       return -1;
     }
   }
   switch (containerVisualID) {
     case SUCmodelEditPart.VISUAL_ID:
       if (SUCPackage.eINSTANCE.getRole().isSuperTypeOf(domainElement.eClass())) {
         return RoleEditPart.VISUAL_ID;
       }
       if (SUCPackage.eINSTANCE.getUseCase().isSuperTypeOf(domainElement.eClass())) {
         return UseCaseEditPart.VISUAL_ID;
       }
       break;
   }
   return -1;
 }
Beispiel #2
0
 /** @generated */
 public static boolean canCreateNode(View containerView, int nodeVisualID) {
   String containerModelID = SUC.diagram.part.SUCVisualIDRegistry.getModelID(containerView);
   if (!SUCmodelEditPart.MODEL_ID.equals(containerModelID)) {
     return false;
   }
   int containerVisualID;
   if (SUCmodelEditPart.MODEL_ID.equals(containerModelID)) {
     containerVisualID = SUC.diagram.part.SUCVisualIDRegistry.getVisualID(containerView);
   } else {
     if (containerView instanceof Diagram) {
       containerVisualID = SUCmodelEditPart.VISUAL_ID;
     } else {
       return false;
     }
   }
   switch (containerVisualID) {
     case SUCmodelEditPart.VISUAL_ID:
       if (RoleEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (UseCaseEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case RoleEditPart.VISUAL_ID:
       if (RoleNameEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case UseCaseEditPart.VISUAL_ID:
       if (UseCaseNameEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (UseCaseSpecified_byEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case UseCaseIncludeEditPart.VISUAL_ID:
       if (LabelEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
   }
   return false;
 }
Beispiel #3
0
 /** @generated */
 public static int getVisualID(View view) {
   if (view instanceof Diagram) {
     if (SUCmodelEditPart.MODEL_ID.equals(view.getType())) {
       return SUCmodelEditPart.VISUAL_ID;
     } else {
       return -1;
     }
   }
   return SUC.diagram.part.SUCVisualIDRegistry.getVisualID(view.getType());
 }