Package org.eclipse.uml2.uml.profile.standard

Examples of org.eclipse.uml2.uml.profile.standard.Trace


   */
  public void deleteAssociatedStereotype(Element e, String steQualified) {
    final Element element = e;

    if (element != null && steQualified != null) {
      final Stereotype stereotype = element.getAppliedStereotype(steQualified);
      if (stereotype != null) {
        element.unapplyStereotype(stereotype);
      }
    } else {
      final String message = "Can't delete the stereotype application because the element or the stereotypeName keys are not correct";
View Full Code Here


   * @param is
   *            : the new Dimension (an InstanceSpecification stereotyped with a Dimension).
   */
  public void setDimensionForPrimitiveType(Element pt, InstanceSpecification is) {
    if (is != null && pt != null) {
      final Stereotype valueType = pt.getAppliedStereotype("SysML::Blocks::ValueType");
      final Dimension newDimension = (Dimension)is.getStereotypeApplication(is
          .getAppliedStereotype("SysML::Blocks::Dimension"));
      pt.setValue(valueType, "dimension", newDimension);
    }
  }
View Full Code Here

   * @param is
   *            : the new Unit (an InstanceSpecification stereotyped with a Unit).
   */
  public void setUnitForPrimitiveType(Element pt, InstanceSpecification is) {
    if (is != null && pt != null) {
      final Stereotype valueType = pt.getAppliedStereotype("SysML::Blocks::ValueType");
      final Unit newUnit = (Unit)is.getStereotypeApplication(is
          .getAppliedStereotype("SysML::Blocks::Unit"));
      pt.setValue(valueType, "unit", newUnit);
    }
  }
View Full Code Here

   * @param id
   *            : the new id (a string).
   */
  public void setIdForRequirement(Element r, String id) {
    if (r != null && id != null) {
      final Stereotype requirement = r.getAppliedStereotype(SYSML_REQUIREMENT);
      r.setValue(requirement, "id", id);
    }
  }
View Full Code Here

   * @param text
   *            : the new text (a string).
   */
  public void setTextForRequirement(Element r, String text) {
    if (r != null && text != null) {
      final Stereotype requirement = r.getAppliedStereotype(SYSML_REQUIREMENT);
      r.setValue(requirement, "text", text);
    }
  }
View Full Code Here

    for (final Iterator<EObject> iterator = root.eAllContents(); iterator.hasNext();) {
      final EObject object = iterator.next();
      if (object instanceof Abstraction) {
        final Element supplier = ((Abstraction)object).getSupplier(e.getName());
        if (supplier != null) {
          Stereotype s = ((Abstraction)object).getAppliedStereotype("SysML::Requirements::Satisfy");
          if (s != null) {
            deleteAssociatedStereotype((Abstraction)object, "SysML::Requirements::Satisfy");
          } else {
            s = ((Abstraction)object).getAppliedStereotype("SysML::Requirements::DeriveReqt");
            if (s != null) {
View Full Code Here

   *            the given Element.
   * @return th element updated.
   */
  public Element updateStereotype(Element element) {
    if (element instanceof Property) {
      final Type type = ((Property)element).getType();
      if (type != null) {
        final Collection<EObject> elementStereotypes = element.getStereotypeApplications();
        final Collection<EObject> typeStereotypes = type.getStereotypeApplications();
        for (EObject typeStereotype : typeStereotypes) {
          if (typeStereotype instanceof ConstraintBlock) {
            if (elementStereotypes == null || elementStereotypes.isEmpty()) {
              createAssociatedStereotype(element, "SysML::Constraints", "ConstraintProperty");
              break;
View Full Code Here

    setNsPrefix(eNS_PREFIX);
    setNsURI(eNS_URI);

    // Obtain other dependent packages
    BlocksPackage theBlocksPackage = (BlocksPackage)EPackage.Registry.INSTANCE.getEPackage(BlocksPackage.eNS_URI);
    UMLPackage theUMLPackage = (UMLPackage)EPackage.Registry.INSTANCE.getEPackage(UMLPackage.eNS_URI);

    // Create type parameters

    // Set bounds for type parameters

    // Add supertypes to classes
    constraintBlockEClass.getESuperTypes().add(theBlocksPackage.getBlock());

    // Initialize classes, features, and operations; add parameters
    initEClass(constraintBlockEClass, ConstraintBlock.class, "ConstraintBlock", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);

    initEClass(constraintPropertyEClass, ConstraintProperty.class, "ConstraintProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
    initEReference(getConstraintProperty_Base_Property(), theUMLPackage.getProperty(), null, "base_Property", null, 1, 1, ConstraintProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
  }
View Full Code Here

    // Derived from all requirements that are supplier of a "trace"
    // relationship for
    // which this element is a client.
    // "trace" subtypes are not included (see bug #352563).
    EList<Requirement> tracedFrom = new BasicEList<Requirement>();
    Trace currentTrace = null;

    if(getBase_NamedElement() != null) {
      // Find Trace link
      EList<DirectedRelationship> relationships = getBase_NamedElement().getSourceDirectedRelationships();
      Iterator<DirectedRelationship> itDep = relationships.iterator();

      while(itDep.hasNext()) {
        DirectedRelationship currentDRelationship = itDep.next();
        currentTrace = UMLUtil.getStereotypeApplication(currentDRelationship, Trace.class);

        // Must be a Trace not a subtype (see bug #352563).
        if((currentTrace != null) && (currentTrace.eClass() == StandardPackage.eINSTANCE.getTrace())) {
          EList<NamedElement> clients = currentTrace.getBase_Abstraction().getSuppliers();
          Iterator<NamedElement> it = clients.iterator();
          while(it.hasNext()) {
            Requirement currentRequirement = UMLUtil.getStereotypeApplication(it.next(), Requirement.class);
            if(currentRequirement != null) {
              tracedFrom.add(currentRequirement);
View Full Code Here

    // This should return the NamedElement(s) traced by current Requirement
    // SysML spec. : Derived from all elements that are the client of a
    // �trace� relationship
    // for which this requirement is a supplier.
    EList<NamedElement> tracedTo = new BasicEList<NamedElement>();
    Trace currentTrace = null;

    if(getBase_Class() != null) {
      Iterator<DirectedRelationship> itDep = getBase_Class().getTargetDirectedRelationships().iterator();

      // Find Trace link
      while(itDep.hasNext()) {
        DirectedRelationship currentDR = itDep.next();
        currentTrace = UMLUtil.getStereotypeApplication(currentDR, Trace.class);

        // Must be a Trace not a subtype (see bug #352563).
        if((currentTrace != null) && (currentTrace.eClass() == StandardPackage.eINSTANCE.getTrace())) {
          EList<NamedElement> suppliers = currentTrace.getBase_Abstraction().getClients();
          tracedTo.addAll(suppliers);
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.uml2.uml.profile.standard.Trace

Copyright © 2018 www.massapicom. 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.