Examples of CismodelNodeDescriptor


Examples of net.cis.common.model.diagram.shipdevice.part.CismodelNodeDescriptor

    // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
    // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
    // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
    for (Iterator<CismodelNodeDescriptor> descriptorsIterator = childDescriptors
        .iterator(); descriptorsIterator.hasNext();) {
      CismodelNodeDescriptor next = descriptorsIterator.next();
      String hint = CismodelVisualIDRegistry.getType(next.getVisualID());
      LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
      for (View childView : getViewChildren()) {
        EObject semanticElement = childView.getElement();
        if (next.getModelElement().equals(semanticElement)) {
          if (hint.equals(childView.getType())) {
            perfectMatch.add(childView);
            // actually, can stop iteration over view children here, but
            // may want to use not the first view but last one as a 'real' match (the way original CEP does
            // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
          }
        }
      }
      if (perfectMatch.size() > 0) {
        descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
        // use only one view (first or last?), keep rest as orphaned for further consideration
        knownViewChildren.remove(perfectMatch.getFirst());
      }
    }
    // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
    // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
    orphaned.addAll(knownViewChildren);
    //
    ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(
        childDescriptors.size());
    for (CismodelNodeDescriptor next : childDescriptors) {
      String hint = CismodelVisualIDRegistry.getType(next.getVisualID());
      IAdaptable elementAdapter = new CanonicalElementAdapter(
          next.getModelElement(), hint);
      CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(
          elementAdapter, Node.class, hint, ViewUtil.APPEND, false,
          host().getDiagramPreferencesHint());
      viewDescriptors.add(descriptor);
    }
View Full Code Here

Examples of net.cis.common.model.diagram.shiptype.part.CismodelNodeDescriptor

    // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
    // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
    // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
    for (Iterator<CismodelNodeDescriptor> descriptorsIterator = childDescriptors
        .iterator(); descriptorsIterator.hasNext();) {
      CismodelNodeDescriptor next = descriptorsIterator.next();
      String hint = CismodelVisualIDRegistry.getType(next.getVisualID());
      LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
      for (View childView : getViewChildren()) {
        EObject semanticElement = childView.getElement();
        if (next.getModelElement().equals(semanticElement)) {
          if (hint.equals(childView.getType())) {
            perfectMatch.add(childView);
            // actually, can stop iteration over view children here, but
            // may want to use not the first view but last one as a 'real' match (the way original CEP does
            // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
          }
        }
      }
      if (perfectMatch.size() > 0) {
        descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
        // use only one view (first or last?), keep rest as orphaned for further consideration
        knownViewChildren.remove(perfectMatch.getFirst());
      }
    }
    // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
    // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
    orphaned.addAll(knownViewChildren);
    //
    ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(
        childDescriptors.size());
    for (CismodelNodeDescriptor next : childDescriptors) {
      String hint = CismodelVisualIDRegistry.getType(next.getVisualID());
      IAdaptable elementAdapter = new CanonicalElementAdapter(
          next.getModelElement(), hint);
      CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(
          elementAdapter, Node.class, hint, ViewUtil.APPEND, false,
          host().getDiagramPreferencesHint());
      viewDescriptors.add(descriptor);
    }
View Full Code Here

Examples of net.cis.common.model.diagram.shiptype.part.CismodelNodeDescriptor

    // iteration happens over list of desired semantic elements, trying to find best matching View, while original CEP
    // iterates views, potentially losing view (size/bounds) information - i.e. if there are few views to reference same EObject, only last one
    // to answer isOrphaned == true will be used for the domain element representation, see #cleanCanonicalSemanticChildren()
    for (Iterator<CismodelNodeDescriptor> descriptorsIterator = childDescriptors
        .iterator(); descriptorsIterator.hasNext();) {
      CismodelNodeDescriptor next = descriptorsIterator.next();
      String hint = CismodelVisualIDRegistry.getType(next.getVisualID());
      LinkedList<View> perfectMatch = new LinkedList<View>(); // both semanticElement and hint match that of NodeDescriptor
      for (View childView : getViewChildren()) {
        EObject semanticElement = childView.getElement();
        if (next.getModelElement().equals(semanticElement)) {
          if (hint.equals(childView.getType())) {
            perfectMatch.add(childView);
            // actually, can stop iteration over view children here, but
            // may want to use not the first view but last one as a 'real' match (the way original CEP does
            // with its trick with viewToSemanticMap inside #cleanCanonicalSemanticChildren
          }
        }
      }
      if (perfectMatch.size() > 0) {
        descriptorsIterator.remove(); // precise match found no need to create anything for the NodeDescriptor
        // use only one view (first or last?), keep rest as orphaned for further consideration
        knownViewChildren.remove(perfectMatch.getFirst());
      }
    }
    // those left in knownViewChildren are subject to removal - they are our diagram elements we didn't find match to,
    // or those we have potential matches to, and thus need to be recreated, preserving size/location information.
    orphaned.addAll(knownViewChildren);
    //
    ArrayList<CreateViewRequest.ViewDescriptor> viewDescriptors = new ArrayList<CreateViewRequest.ViewDescriptor>(
        childDescriptors.size());
    for (CismodelNodeDescriptor next : childDescriptors) {
      String hint = CismodelVisualIDRegistry.getType(next.getVisualID());
      IAdaptable elementAdapter = new CanonicalElementAdapter(
          next.getModelElement(), hint);
      CreateViewRequest.ViewDescriptor descriptor = new CreateViewRequest.ViewDescriptor(
          elementAdapter, Node.class, hint, ViewUtil.APPEND, false,
          host().getDiagramPreferencesHint());
      viewDescriptors.add(descriptor);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.