Example #1
0
 /** @generated */
 public static int getVisualID(View view) {
   if (view instanceof Diagram) {
     if (ModelRelEditPart.MODEL_ID.equals(view.getType())) {
       return ModelRelEditPart.VISUAL_ID;
     } else {
       return -1;
     }
   }
   return edu.toronto.cs.se.mmint.mid.relationship.diagram.part.MIDVisualIDRegistry.getVisualID(
       view.getType());
 }
Example #2
0
 /** @generated */
 public static boolean canCreateNode(View containerView, int nodeVisualID) {
   String containerModelID =
       edu.toronto.cs.se.mmint.mid.relationship.diagram.part.MIDVisualIDRegistry.getModelID(
           containerView);
   if (!ModelRelEditPart.MODEL_ID.equals(containerModelID)
       && !"relationship".equals(containerModelID)) { // $NON-NLS-1$
     return false;
   }
   int containerVisualID;
   if (ModelRelEditPart.MODEL_ID.equals(containerModelID)) {
     containerVisualID =
         edu.toronto.cs.se.mmint.mid.relationship.diagram.part.MIDVisualIDRegistry.getVisualID(
             containerView);
   } else {
     if (containerView instanceof Diagram) {
       containerVisualID = ModelRelEditPart.VISUAL_ID;
     } else {
       return false;
     }
   }
   switch (containerVisualID) {
     case ModelRelEditPart.VISUAL_ID:
       if (ModelEndpointReferenceEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (LinkReferenceEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (LinkReference2EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (ModelEndpointReference2EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case ModelEndpointReferenceEditPart.VISUAL_ID:
       if (WrappingLabelEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel16EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (ModelEndpointReferenceModelEndpointReferenceCompartmentEditPart.VISUAL_ID
           == nodeVisualID) {
         return true;
       }
       break;
     case LinkReferenceEditPart.VISUAL_ID:
       if (WrappingLabel2EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel17EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case LinkReference2EditPart.VISUAL_ID:
       if (WrappingLabel3EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel18EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case ModelEndpointReference2EditPart.VISUAL_ID:
       if (WrappingLabel4EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel19EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (ModelEndpointReferenceModelEndpointReferenceSuperCompartmentEditPart.VISUAL_ID
           == nodeVisualID) {
         return true;
       }
       break;
     case ModelElementReferenceEditPart.VISUAL_ID:
       if (WrappingLabel5EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel20EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case ModelElementReference2EditPart.VISUAL_ID:
       if (WrappingLabel6EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel21EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case ModelElementReference3EditPart.VISUAL_ID:
       if (WrappingLabel7EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel22EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case ModelEndpointReferenceModelEndpointReferenceCompartmentEditPart.VISUAL_ID:
       if (ModelElementReferenceEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case ModelEndpointReferenceModelEndpointReferenceSuperCompartmentEditPart.VISUAL_ID:
       if (ModelElementReference2EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (ModelElementReference3EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case ModelElementEndpointReferenceEditPart.VISUAL_ID:
       if (WrappingLabel8EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel23EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case BinaryLinkReferenceEditPart.VISUAL_ID:
       if (WrappingLabel9EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel10EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel11EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel24EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case BinaryLinkReference2EditPart.VISUAL_ID:
       if (WrappingLabel12EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel13EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel14EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel25EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case ModelElementEndpointReference2EditPart.VISUAL_ID:
       if (WrappingLabel15EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (WrappingLabel26EditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
   }
   return false;
 }
Example #3
0
 /** @generated */
 public static int getNodeVisualID(View containerView, EObject domainElement) {
   if (domainElement == null) {
     return -1;
   }
   String containerModelID =
       edu.toronto.cs.se.mmint.mid.relationship.diagram.part.MIDVisualIDRegistry.getModelID(
           containerView);
   if (!ModelRelEditPart.MODEL_ID.equals(containerModelID)
       && !"relationship".equals(containerModelID)) { // $NON-NLS-1$
     return -1;
   }
   int containerVisualID;
   if (ModelRelEditPart.MODEL_ID.equals(containerModelID)) {
     containerVisualID =
         edu.toronto.cs.se.mmint.mid.relationship.diagram.part.MIDVisualIDRegistry.getVisualID(
             containerView);
   } else {
     if (containerView instanceof Diagram) {
       containerVisualID = ModelRelEditPart.VISUAL_ID;
     } else {
       return -1;
     }
   }
   switch (containerVisualID) {
     case ModelRelEditPart.VISUAL_ID:
       if (RelationshipPackage.eINSTANCE
               .getModelEndpointReference()
               .isSuperTypeOf(domainElement.eClass())
           && isModelEndpointReference_2007((ModelEndpointReference) domainElement)) {
         return ModelEndpointReferenceEditPart.VISUAL_ID;
       }
       if (RelationshipPackage.eINSTANCE.getLinkReference().isSuperTypeOf(domainElement.eClass())
           && isLinkReference_2008((LinkReference) domainElement)) {
         return LinkReferenceEditPart.VISUAL_ID;
       }
       if (RelationshipPackage.eINSTANCE.getLinkReference().isSuperTypeOf(domainElement.eClass())
           && isLinkReference_2009((LinkReference) domainElement)) {
         return LinkReference2EditPart.VISUAL_ID;
       }
       if (RelationshipPackage.eINSTANCE
               .getModelEndpointReference()
               .isSuperTypeOf(domainElement.eClass())
           && isModelEndpointReference_2010((ModelEndpointReference) domainElement)) {
         return ModelEndpointReference2EditPart.VISUAL_ID;
       }
       break;
     case ModelEndpointReferenceModelEndpointReferenceCompartmentEditPart.VISUAL_ID:
       if (RelationshipPackage.eINSTANCE
               .getModelElementReference()
               .isSuperTypeOf(domainElement.eClass())
           && isModelElementReference_3005((ModelElementReference) domainElement)) {
         return ModelElementReferenceEditPart.VISUAL_ID;
       }
       break;
     case ModelEndpointReferenceModelEndpointReferenceSuperCompartmentEditPart.VISUAL_ID:
       if (RelationshipPackage.eINSTANCE
               .getModelElementReference()
               .isSuperTypeOf(domainElement.eClass())
           && isModelElementReference_3006((ModelElementReference) domainElement)) {
         return ModelElementReference2EditPart.VISUAL_ID;
       }
       if (RelationshipPackage.eINSTANCE
               .getModelElementReference()
               .isSuperTypeOf(domainElement.eClass())
           && isModelElementReference_3007((ModelElementReference) domainElement)) {
         return ModelElementReference3EditPart.VISUAL_ID;
       }
       break;
   }
   return -1;
 }