コード例 #1
0
    /** @generated */
    private static boolean buildElement2ViewMap(
        View parentView, Map<EObject, View> element2ViewMap, Set<? extends EObject> elements) {
      if (elements.size() == element2ViewMap.size()) {
        return true;
      }

      if (parentView.isSetElement()
          && !element2ViewMap.containsKey(parentView.getElement())
          && elements.contains(parentView.getElement())) {
        element2ViewMap.put(parentView.getElement(), parentView);
        if (elements.size() == element2ViewMap.size()) {
          return true;
        }
      }
      boolean complete = false;
      for (Iterator<?> it = parentView.getChildren().iterator(); it.hasNext() && !complete; ) {
        complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
      }
      for (Iterator<?> it = parentView.getSourceEdges().iterator(); it.hasNext() && !complete; ) {
        complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
      }
      for (Iterator<?> it = parentView.getTargetEdges().iterator(); it.hasNext() && !complete; ) {
        complete = buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
      }
      return complete;
    }
 /** @generated */
 public static List getOclet_1002SemanticChildren(View view) {
   if (!view.isSetElement()) {
     return Collections.EMPTY_LIST;
   }
   hub.top.adaptiveSystem.Oclet modelElement = (hub.top.adaptiveSystem.Oclet) view.getElement();
   List result = new LinkedList();
   {
     hub.top.adaptiveSystem.PreNet childElement = modelElement.getPreNet();
     int visualID =
         hub.top.adaptiveSystem.diagram.part.AdaptiveSystemVisualIDRegistry.getNodeVisualID(
             view, childElement);
     if (visualID == hub.top.adaptiveSystem.diagram.edit.parts.PreNetEditPart.VISUAL_ID) {
       result.add(
           new hub.top.adaptiveSystem.diagram.part.AdaptiveSystemNodeDescriptor(
               childElement, visualID));
     }
   }
   {
     hub.top.adaptiveSystem.DoNet childElement = modelElement.getDoNet();
     int visualID =
         hub.top.adaptiveSystem.diagram.part.AdaptiveSystemVisualIDRegistry.getNodeVisualID(
             view, childElement);
     if (visualID == hub.top.adaptiveSystem.diagram.edit.parts.DoNetEditPart.VISUAL_ID) {
       result.add(
           new hub.top.adaptiveSystem.diagram.part.AdaptiveSystemNodeDescriptor(
               childElement, visualID));
     }
   }
   return result;
 }
 /** @generated */
 public static List getAdaptiveProcessAdaptiveProcessCompartment_5001SemanticChildren(View view) {
   if (false == view.eContainer() instanceof View) {
     return Collections.EMPTY_LIST;
   }
   View containerView = (View) view.eContainer();
   if (!containerView.isSetElement()) {
     return Collections.EMPTY_LIST;
   }
   hub.top.adaptiveSystem.AdaptiveProcess modelElement =
       (hub.top.adaptiveSystem.AdaptiveProcess) containerView.getElement();
   List result = new LinkedList();
   for (Iterator it = modelElement.getNodes().iterator(); it.hasNext(); ) {
     hub.top.adaptiveSystem.Node childElement = (hub.top.adaptiveSystem.Node) it.next();
     int visualID =
         hub.top.adaptiveSystem.diagram.part.AdaptiveSystemVisualIDRegistry.getNodeVisualID(
             view, childElement);
     if (visualID == hub.top.adaptiveSystem.diagram.edit.parts.ConditionAPEditPart.VISUAL_ID) {
       result.add(
           new hub.top.adaptiveSystem.diagram.part.AdaptiveSystemNodeDescriptor(
               childElement, visualID));
       continue;
     }
     if (visualID == hub.top.adaptiveSystem.diagram.edit.parts.EventAPEditPart.VISUAL_ID) {
       result.add(
           new hub.top.adaptiveSystem.diagram.part.AdaptiveSystemNodeDescriptor(
               childElement, visualID));
       continue;
     }
   }
   return result;
 }
コード例 #4
0
 /** @generated */
 protected void registerModel() {
   super.registerModel();
   View view = (View) getModel();
   if (view != null && view.isSetElement() && view.getElement() != null) {
     getViewer().getEditPartRegistry().put(view.getElement(), this);
   }
 }
 /** @generated */
 public static List getAdaptiveSystem_79SemanticChildren(View view) {
   if (!view.isSetElement()) {
     return Collections.EMPTY_LIST;
   }
   hub.top.adaptiveSystem.AdaptiveSystem modelElement =
       (hub.top.adaptiveSystem.AdaptiveSystem) view.getElement();
   List result = new LinkedList();
   {
     hub.top.adaptiveSystem.AdaptiveProcess childElement = modelElement.getAdaptiveProcess();
     int visualID =
         hub.top.adaptiveSystem.diagram.part.AdaptiveSystemVisualIDRegistry.getNodeVisualID(
             view, childElement);
     if (visualID == hub.top.adaptiveSystem.diagram.edit.parts.AdaptiveProcessEditPart.VISUAL_ID) {
       result.add(
           new hub.top.adaptiveSystem.diagram.part.AdaptiveSystemNodeDescriptor(
               childElement, visualID));
     }
   }
   for (Iterator it = modelElement.getOclets().iterator(); it.hasNext(); ) {
     hub.top.adaptiveSystem.Oclet childElement = (hub.top.adaptiveSystem.Oclet) it.next();
     int visualID =
         hub.top.adaptiveSystem.diagram.part.AdaptiveSystemVisualIDRegistry.getNodeVisualID(
             view, childElement);
     if (visualID == hub.top.adaptiveSystem.diagram.edit.parts.OcletEditPart.VISUAL_ID) {
       result.add(
           new hub.top.adaptiveSystem.diagram.part.AdaptiveSystemNodeDescriptor(
               childElement, visualID));
       continue;
     }
   }
   return result;
 }
コード例 #6
0
 /** @generated */
 protected void unregisterModel() {
   super.unregisterModel();
   View view = (View) getModel();
   if (view != null
       && view.isSetElement()
       && view.getElement() != null
       && getViewer().getEditPartRegistry().get(view.getElement()) == this) {
     getViewer().getEditPartRegistry().remove(view.getElement());
   }
 }
コード例 #7
0
 /** @generated */
 protected List getNotationalChildLinks() {
   List result = new LinkedList();
   List allLinks = getDiagram().getEdges();
   for (Iterator it = allLinks.iterator(); it.hasNext(); ) {
     Edge next = (Edge) it.next();
     if (next.isSetElement()
         && next.getElement() != null
         && next.getElement().eResource() == null) {
       result.add(next);
       continue;
     }
     View source = next.getSource();
     if (source == null
         || (source.isSetElement()
             && source.getElement() != null
             && source.getElement().eResource() == null)) {
       result.add(next);
       continue;
     }
     View target = next.getTarget();
     if (target == null
         || (target.isSetElement()
             && target.getElement() != null
             && target.getElement().eResource() == null)) {
       result.add(next);
       continue;
     }
     if (next.isSetElement() && next.getElement() != null) {
       if (next.getElement().eContainer() == getDiagram().getElement()) {
         int linkVID = MindmapVisualIDRegistry.getVisualID(next);
         switch (linkVID) {
           case RelationshipEditPart.VISUAL_ID:
           case Relationship2EditPart.VISUAL_ID:
           case Relationship3EditPart.VISUAL_ID:
             result.add(next);
             break;
         }
       }
     }
   }
   return result;
 }
 /**
  * Clean all shortcuts to the host element from the same diagram
  *
  * @generated
  */
 protected void addDestroyShortcutsCommand(ICompositeCommand cmd, View view) {
   assert view.getEAnnotation("Shortcut") == null; // $NON-NLS-1$
   for (Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext(); ) {
     View nextView = (View) it.next();
     if (nextView.getEAnnotation("Shortcut") == null
         || !nextView.isSetElement()
         || nextView.getElement() != view.getElement()) { // $NON-NLS-1$
       continue;
     }
     cmd.add(new DeleteCommand(getEditingDomain(), nextView));
   }
 }
コード例 #9
0
 /** @generated */
 protected void addDestroyShortcutsCommand(CompoundCommand command) {
   View view = (View) getHost().getModel();
   if (view.getEAnnotation("Shortcut") != null) { // $NON-NLS-1$
     return;
   }
   for (Iterator it = view.getDiagram().getChildren().iterator(); it.hasNext(); ) {
     View nextView = (View) it.next();
     if (nextView.getEAnnotation("Shortcut") == null
         || !nextView.isSetElement()
         || nextView.getElement() != view.getElement()) { // $NON-NLS-1$
       continue;
     }
     command.add(getDestroyElementCommand(nextView));
   }
 }
コード例 #10
0
 /** @generated */
 public void createDecorators(IDecoratorTarget decoratorTarget) {
   EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
   if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
     Object model = editPart.getModel();
     if ((model instanceof View)) {
       View view = (View) model;
       if (!(view instanceof Edge) && !view.isSetElement()) {
         return;
       }
     }
     EditDomain ed = editPart.getViewer().getEditDomain();
     if (!(ed instanceof DiagramEditDomain)) {
       return;
     }
     if (((DiagramEditDomain) ed).getEditorPart() instanceof GSN1DiagramEditor) {
       decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
     }
   }
 }
コード例 #11
0
    /** @generated */
    static Map buildElement2ViewMap(View parentView, Map element2ViewMap, Set elements) {
      if (elements.size() == element2ViewMap.size()) return element2ViewMap;

      if (parentView.isSetElement()
          && !element2ViewMap.containsKey(parentView.getElement())
          && elements.contains(parentView.getElement())) {
        element2ViewMap.put(parentView.getElement(), parentView);
        if (elements.size() == element2ViewMap.size()) return element2ViewMap;
      }

      for (Iterator it = parentView.getChildren().iterator(); it.hasNext(); ) {
        buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
        if (elements.size() == element2ViewMap.size()) return element2ViewMap;
      }
      for (Iterator it = parentView.getSourceEdges().iterator(); it.hasNext(); ) {
        buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
        if (elements.size() == element2ViewMap.size()) return element2ViewMap;
      }
      for (Iterator it = parentView.getSourceEdges().iterator(); it.hasNext(); ) {
        buildElement2ViewMap((View) it.next(), element2ViewMap, elements);
        if (elements.size() == element2ViewMap.size()) return element2ViewMap;
      }
      return element2ViewMap;
    }