コード例 #1
0
ファイル: UMLVisualIDRegistry.java プロジェクト: go2zo/ju4pa
  /** @generated */
  public static int getNodeVisualID(View containerView, EObject domainElement) {
    if (domainElement == null) {
      return -1;
    }
    String containerModelID =
        org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getModelID(
            containerView);
    if (!ModelEditPart.MODEL_ID.equals(containerModelID)) {
      return -1;
    }
    int containerVisualID;
    if (ModelEditPart.MODEL_ID.equals(containerModelID)) {
      containerVisualID =
          org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(
              containerView);
    } else {
      if (containerView instanceof Diagram) {
        containerVisualID = ModelEditPart.VISUAL_ID;
      } else {
        return -1;
      }
    }
    switch (containerVisualID) {
      case ModelEditPart.VISUAL_ID:
        if (UMLPackage.eINSTANCE.getInteraction().isSuperTypeOf(domainElement.eClass())) {

          return InteractionEditPart.VISUAL_ID;
        }
        if (NotationPackage.eINSTANCE.getDiagram().isSuperTypeOf(domainElement.eClass())) {

          return ShortCutDiagramEditPart.VISUAL_ID;
        }
        break;
      case InteractionCompartmentEditPart.VISUAL_ID:
        if (UMLPackage.eINSTANCE.getLifeline().isSuperTypeOf(domainElement.eClass())) {

          return LifelineEditPartCN.VISUAL_ID;
        }
        if (UMLPackage.eINSTANCE.getComment().isSuperTypeOf(domainElement.eClass())) {

          return CommentEditPartCN.VISUAL_ID;
        }
        if (UMLPackage.eINSTANCE.getConstraint().isSuperTypeOf(domainElement.eClass())) {

          return ConstraintEditPartCN.VISUAL_ID;
        }
        if (UMLPackage.eINSTANCE.getTimeObservation().isSuperTypeOf(domainElement.eClass())) {

          return TimeObservationEditPartCN.VISUAL_ID;
        }
        if (UMLPackage.eINSTANCE.getDurationObservation().isSuperTypeOf(domainElement.eClass())) {

          return DurationObservationEditPartCN.VISUAL_ID;
        }
        break;
    }
    return -1;
  }
コード例 #2
0
ファイル: UMLVisualIDRegistry.java プロジェクト: go2zo/ju4pa
 /** @generated */
 public static int getVisualID(View view) {
   if (view instanceof Diagram) {
     if (ModelEditPart.MODEL_ID.equals(view.getType())) {
       return ModelEditPart.VISUAL_ID;
     } else {
       return -1;
     }
   }
   return org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(
       view.getType());
 }
コード例 #3
0
ファイル: UMLVisualIDRegistry.java プロジェクト: go2zo/ju4pa
 /** @generated */
 public static boolean canCreateNode(View containerView, int nodeVisualID) {
   String containerModelID =
       org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getModelID(
           containerView);
   if (!ModelEditPart.MODEL_ID.equals(containerModelID)) {
     return false;
   }
   int containerVisualID;
   if (ModelEditPart.MODEL_ID.equals(containerModelID)) {
     containerVisualID =
         org.eclipse.papyrus.uml.diagram.communication.part.UMLVisualIDRegistry.getVisualID(
             containerView);
   } else {
     if (containerView instanceof Diagram) {
       containerVisualID = ModelEditPart.VISUAL_ID;
     } else {
       return false;
     }
   }
   switch (containerVisualID) {
     case ModelEditPart.VISUAL_ID:
       if (InteractionEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (ShortCutDiagramEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case InteractionEditPart.VISUAL_ID:
       if (InteractionNameEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (InteractionCompartmentEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case ShortCutDiagramEditPart.VISUAL_ID:
       if (DiagramNameEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case LifelineEditPartCN.VISUAL_ID:
       if (LifelineNameEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case ConstraintEditPartCN.VISUAL_ID:
       if (ConstraintNameEditPartCN.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (ConstraintBodyEditPartCN.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case CommentEditPartCN.VISUAL_ID:
       if (CommentBodyEditPartCN.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case TimeObservationEditPartCN.VISUAL_ID:
       if (TimeObservationNameEditPartCN.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (TimeObservationStereotypeLabelEditPartCN.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case DurationObservationEditPartCN.VISUAL_ID:
       if (DurationObservationLabelEditPartCN.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (DurationObservationStereotypeLabelEditPartCN.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case InteractionCompartmentEditPart.VISUAL_ID:
       if (LifelineEditPartCN.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (CommentEditPartCN.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (ConstraintEditPartCN.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (TimeObservationEditPartCN.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (DurationObservationEditPartCN.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
     case MessageEditPart.VISUAL_ID:
       if (MessageNameEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       if (AppliedStereotypeMessageEditPart.VISUAL_ID == nodeVisualID) {
         return true;
       }
       break;
   }
   return false;
 }