Package org.emftrace.metamodel.QUARCModel.GSS

Examples of org.emftrace.metamodel.QUARCModel.GSS.Element


   * @param applicableElementsSet a Set of ApplicableElement/ Elements
   */
  private void pruneApplicableElements(
      Set<Entry<ApplicableElement, Element>> applicableElementsSet) {
    for (Entry<ApplicableElement, Element> entry : applicableElementsSet){
      Element element = entry.getValue();
      ApplicableElement applicableElement = entry.getKey();
      if (elementIsToPrune(element)){
        pruneApplicableElement(applicableElement);
      }
    }
View Full Code Here


   * @param applicableElement an ApplicableElement
   */
  private void pruneApplicableElement(ApplicableElement applicableElement) {

    for (Relation relation : cacheManager.getAllApplicableOutgoingRelations(applicableElement)){
      Element target = cacheManager.getTargetOfRelation(relation);
      if (!elementIsToPrune(target)){
       ApplicableElement applicableTargetElement = cacheManager.getApplicableElementForElement(target);
       if (relation instanceof Impact)
         applicableTargetElement.getIncomingImpactRelations().remove(relation);
       else
View Full Code Here

   * @param relation The relation to generate the label for.
   * @return A <class>String</class> with the label.
   * @generated NOT
   */
  protected String getLabel(Relation relation) {
    Element source = relation.getSource();
    String sourceName = source == null ? "" : source.getName();
    Element target = relation.getTarget();
    String targetName = target == null ? "" : target.getName();
   
    String label = "\"" + (sourceName == null || sourceName.isEmpty() && source != null ? source.eClass().getName() : sourceName) + "\" ";
    if (relation instanceof Impact) {
      Object weight = ((Impact)relation).getWeight();
      label += "-(" + (weight == null ? "" : weight.toString()) + ")";
    } else
    if (relation instanceof Offset) {
      Object offset = ((Offset)relation).getValue();
      label += "-(" + (offset == null ? "" : offset.toString()) + ")";
    }
    label += "-> \""+ (targetName == null || targetName.isEmpty() && target != null ? target.eClass().getName() : targetName) + "\"";
    return label;
  }
View Full Code Here

  @Override
  public String getText(Object object) {
   
    String label = getString("_UI_ApplicableElement_type");

    Element assignedElement = ((ApplicableElement)object).getElement();
    if (assignedElement != null){
      label += " \"" +assignedElement.getName()+"\"";
    }
    return   label;
  }
View Full Code Here

    }
    int size = outgoingRelations.size();
    int i = 0;
    for (Relation relation : outgoingRelations) {

      Element parentElement = cacheManager.getTargetOfRelation(relation);
      if (parentElement instanceof ConstrainedElement) {
        Precondition precondition = ((ConstrainedElement) parentElement)
            .getPrecondition();
        if (precondition != null)
        result += formatConditionString(precondition);
View Full Code Here

   * @see sharedcomponents.commands.AbstractCommand#doRun()
   */
  @Override
  protected void doRun() {
    super.doRun();
    Element element = priorizedElement.getElement();
    Set<Decomposition> existingPriorizedDecompositions = new HashSet<Decomposition>();
   
    for (PrioritizedDecomposition priorizedDecomposition : priorizedElementsSet.getPriorizedDecompositionRelations()){
      existingPriorizedDecompositions.add(priorizedDecomposition.getDecompostion());
    }
View Full Code Here

      return sublevelCache.get(element);
    }

    if (element instanceof SolutionInstrument)
       for (Relation outgoingRelation : getAllOutgoingRelationsForElement(element, "isA")){
          Element target = getTargetOfRelation(outgoingRelation);
          int sublevelOfTarget = getSublevel(target);
          result = result >= sublevelOfTarget ? result+1 : sublevelOfTarget+1;
         
         }else
       for (Relation outgoingRelation : getAllOutgoingRelationsForElement(element, "Decomposition")){
          Element target = getTargetOfRelation(outgoingRelation);
          int sublevelOfTarget = getSublevel(target);
          result = result >= sublevelOfTarget ? result+1 : sublevelOfTarget+1;
         
         }
    sublevelCache.put(element, result);
View Full Code Here

    for (EObject child : getAccessLayer().getDirectChildren(getGss())) {
      if (child instanceof Relation)
      {
        Relation relation = (Relation) child;
      Element target = relation.getTarget();
      Element source = relation.getSource();
      String weight = null;
      if (relation instanceof Offset) {
        weight = getAccessLayer().getAttributeValue(relation, "value");

      } else if (relation instanceof Impact) {
View Full Code Here

  @Override
  protected void doRun() {
    super.doRun();
    if (priorizedElement == null) return;
     
    Element element = priorizedElement.getElement();
    List<PrioritizedDecomposition> toRemoveList = new ArrayList<PrioritizedDecomposition>();
    for (PrioritizedDecomposition priorizedDecomposition : priorizedElementsSet
        .getPriorizedDecompositionRelations()) {
      if (priorizedDecomposition.getDecompostion().getTarget() == element
          || priorizedDecomposition.getDecompostion().getSource() == element)
View Full Code Here

   *
   * @param applicableElement
   *            an ApplicableElement
   */
  private void addApplicableElementToCache(ApplicableElement applicableElement) {
    Element element = applicableElement.getElement();
    addApplicableElementToCache(applicableElement, element);
  }
View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.QUARCModel.GSS.Element

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.