Examples of CFRelation


Examples of de.FeatureModellingTool.FeatureModel.CFRelation

        }

        constraints.clear();
        constraints.addAll(constraintModel.getAllCFRelation().values());
        for (Iterator<CFRelation> itConstraint = constraints.iterator(); itConstraint.hasNext();) {
            CFRelation gc = itConstraint.next();

            boolean newFeature = false;
            Feature cfFeature = gc.getFeature();
            if (htNameMap.containsKey(gc.getFeature().getID())) {
                cfFeature = featureModel.getFeature(htNameMap.get(gc.getFeature().getID()));
                newFeature = true;
            }
            Constraint cfConstraint = gc.getConstraint();
            if (htNameMap.containsKey(gc.getConstraint().getID())) {
                cfConstraint = constraintModel.getConstraint(htNameMap.get(gc.getConstraint().getID()));
                newFeature = true;
            }
            if (newFeature) {
                CFRelation newConstraint = constraintModelEditor.addCFRelation(cfFeature, cfConstraint, gc.isSource(), gc.getModifier());
                htNameMap.put(gc.getID(), newConstraint.getID());
            }
        }
    }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.CFRelation

        }

        constraints.clear();
        constraints.addAll(constraintModel.getAllCFRelation().values());
        for (Iterator<CFRelation> itRelation = constraints.iterator(); itRelation.hasNext();) {
            CFRelation relation = itRelation.next();
            if (hsSubFeatureIDs.contains(relation.getFeature())) {
                constraintModelEditor.removeCFRelation(relation.getID());
            }
        }


View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.CFRelation

            FeatureNode root = (FeatureNode) treeTable.getTreeTableModel().getRoot();

            if (propertyName.equals(ConstraintModelProperties.RELATION_ADDED)) {
                //--���������VPConstraint�ϵĹ�ϵ��
                CFRelation relation = (CFRelation) evt.getNewValue();
                Constraint constraint = relation.getConstraint();

                if (constraint instanceof VPConstraint) {
                    VPConstraint vpc = (VPConstraint) constraint;
                    Feature feature = relation.getFeature();
                    FeatureNode featureNode = getTreeNode(root, feature);

                    boolean isSource = relation.isSource();
                    if (isSource) { //--������source��ϵ: ���е�sink��Ϊsource���ӽڵ�
                        Iterator<Feature> it = vpc.getSinkFeatureSet().iterator();
                        while (it.hasNext()) {
                            Feature sink = it.next();
                            FeatureNode child = getTreeNode(root, sink);
                            ///---���û��һ�������ϵ�Ľڵ㣬������һ�������Ľڵ�
                            FeatureNode specNode = featureNode.getSpecilizationNode();
                            if (specNode == null) {
                                specNode = new FeatureNode(context, FeatureNode.NODE_TYPE_SPECILIZATION);
                                //featureNode.add(specNode);
                                treeTableModel.insertNodeInto(specNode, featureNode, featureNode.getChildCount());
                            }
                            //specNode.add(child);
                            treeTableModel.removeNodeFromParent(child);
                            treeTableModel.insertNodeInto(child, specNode, specNode.getChildCount());
                        }
                    } else { //--������sink��ϵ: ������sink��Ϊsource��specNode���ӽڵ�
                        Iterator<Feature> it = vpc.getSourceFeatureSet().iterator();
                        if (it.hasNext()) {
                            Feature source = it.next();
                            FeatureNode parent = getTreeNode(root, source);
                            FeatureNode specNode = parent.getSpecilizationNode();
                            if (specNode == null) {
                                specNode = new FeatureNode(context, FeatureNode.NODE_TYPE_SPECILIZATION);
                                //parent.add(specNode);
                                treeTableModel.insertNodeInto(specNode, parent, parent.getChildCount());
                            }
                            //specNode.add(featureNode);
                            treeTableModel.removeNodeFromParent(featureNode);
                            treeTableModel.insertNodeInto(featureNode, specNode, specNode.getChildCount());
                        }
                    }
                }
            } else if (propertyName.equals(ConstraintModelProperties.RELATION_REMOVED)) {
                //--���������VPConstraint�ϵĹ�ϵ��
                CFRelation relation = (CFRelation) evt.getOldValue();
                Constraint constraint = relation.getConstraint();

                if (constraint instanceof VPConstraint) {
                    VPConstraint vpc = (VPConstraint) constraint;
                    Feature feature = relation.getFeature();
                    FeatureNode featureNode = getTreeNode(root, feature);

                    boolean isSource = relation.isSource();
                    if (isSource) { //--ɾ����source��ϵ: ���е�sink��Ϊ���ڵ㣬��������������Ƿ�ɾ��������ϵ�ڵ�
                        Iterator<Feature> it = vpc.getSinkFeatureSet().iterator();
                        FeatureNode specNode = null;
                        while (it.hasNext()) {
                            Feature sink = it.next();
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.CFRelation

      if (undecidedOnly && !cvSrc.getFinalCustomizationById(f.getID()).equals(Customization.Undecided)) {
        continue;
      }
      gceDest.addFeature(gcDest , f);
     
      CFRelation cfrSrc = cmSrc.getCFRelation(f , cSrc , true);
      if (cfrSrc==null) {
        cfrSrc = cmSrc.getCFRelation(f , cSrc , false);
      }
     
      CFRModifier modifier = cfrSrc.getModifier();
      if (revertCFRelation) {
        if (modifier.equals(CFRModifier.Affirmation)) {
          modifier = CFRModifier.Negation;
        } else {
          modifier = CFRModifier.Affirmation;
        }
      }
      CFRelation cfrDest = cmeDest.addCFRelation(f , gcDest , false , modifier);
     
      PLConnection plc = new PLConnection();
      plc.setAttribute("id" , cfrDest.getID());
//      result.setAttribute("frameColor" , cfSrc.getAttribute("frameColor"));
//      plc.setAttribute("type" , cfSrc.getAttribute("type"));
      plc.setAttribute("CFRModifier" , modifier.getName());
      plc.startPoint(gcfDest.getDisplayBox().x , gcfDest.getDisplayBox().y);
      Figure figureSrc = mFigure.get(f.getID());
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.CFRelation

   
    for (Iterator<Feature> itFeature=features.iterator() ; itFeature.hasNext() ; ) {
      Feature f = itFeature.next();
      gce.addFeature(gcDest , f);
     
      CFRelation cfrSrc = cm.getCFRelation(f , c , true);
      if (cfrSrc==null) {
        cfrSrc = cm.getCFRelation(f , c , false);
      }
     
      CFRModifier modifier = cfrSrc.getModifier();
      if (revertCFRelation) {
        if (modifier.equals(CFRModifier.Affirmation)) {
          modifier = CFRModifier.Negation;
        } else {
          modifier = CFRModifier.Affirmation;
        }
      }
      CFRelation cfrDest = cme.addCFRelation(f , gcDest , false , modifier);
      PLConnection plcOld = (PLConnection)mFigure.get(cfrSrc.getID());
     
     
      PLConnection plcNew = new PLConnection();
      plcNew.setAttribute("id" , cfrDest.getID());
      plcNew.setAttribute("frameColor" , plcOld.getAttribute("frameColor"));
      plcNew.setAttribute("type" , plcOld.getAttribute("type"));
      plcNew.setAttribute("CFRModifier" , modifier.getName());
     
      for (int i=0 ; i<plcOld.pointCount() ; i++) {
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.CFRelation

      , DrawingView dv , HashMap<String,Figure> mFigure) {
    List<CFRelation> relations = new ArrayList<CFRelation>();
    List<Figure> figures = new ArrayList<Figure>();
    for (Iterator<Feature> itFeature=gc.getFeatureSet().iterator() ; itFeature.hasNext() ; ) {
      Feature f = itFeature.next();
      CFRelation relation = cm.getCFRelation(f , gc , true);
      if (relation==null) {
        relation = cm.getCFRelation(f , gc , false);
      }
      relations.add(relation);
      figures.add(mFigure.get(relation.getID()));
    }
   
    for (int i=0 ; i<relations.size() ; i++) {
      CFRelation relation = relations.get(i);
      Figure figure = figures.get(i);
     
      dv.remove(figure);
      cme.removeCFRelation(relation.getID());
    }
    dv.remove(mFigure.get(gc.getID()));
    cme.removeGroupConstraint(gc);
  }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.CFRelation

      , DrawingView dv , HashMap<String,Figure> mFigure , CustomizationVersion cv) {
    List<Feature> features = new ArrayList<Feature>(gc.getFeatureSet());
    for (int i=0 ; i<features.size() ; i++) {
      Feature feature = features.get(i);
      if (!cv.getFinalCustomizationById(feature.getID()).equals(Customization.Undecided)) {
        CFRelation fr = cm.getCFRelation(feature , gc , false);
        Figure figure = mFigure.get(fr.getID());
        dv.remove(figure);
        cme.removeCFRelation(fr.getID());
      }
    }
  }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.CFRelation

      , HashMap<String,Figure> mFigure) {
    for (Iterator<Feature> itFeature=features.iterator() ; itFeature.hasNext() ; ) {
      Feature feature = itFeature.next();
     
      boolean isSource = true;
      CFRelation rOld = cm.getCFRelation(feature , cc , true);
      if (rOld==null) {
        isSource = false;
        rOld = cm.getCFRelation(feature , cc , false);
      }
     
      cme.removeCFRelation(rOld.getID());
     
      CFRelation rNew = cme.addCFRelation(rOld.getID() , feature , cc , isSource, CFRModifier.Affirmation.equals(rOld.getModifier()) ? CFRModifier.Negation : CFRModifier.Affirmation);
     
      PLConnection fOld = (PLConnection)mFigure.get(rOld.getID());
      fOld.setAttribute("CFRModifier" , rNew.getModifier().getName());
    }
  }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.CFRelation

    features.addAll(cc.getSinkFeatureSet());
   
    List<CFRelation> relations = new ArrayList<CFRelation>();
    for (Iterator<Feature> itFeature=features.iterator() ; itFeature.hasNext() ; ) {
      Feature feature = itFeature.next();
      CFRelation relation = cm.getCFRelation(feature , cc , true);
      if (relation==null) {
        relation = cm.getCFRelation(feature , cc , false);
      }
    }
   
    for (int i=0 ; i<relations.size() ; i++) {
      CFRelation relation = relations.get(i);
      Figure figure = mFigure.get(relation.getID());
     
      dv.remove(figure);
      cme.removeCFRelation(relation.getID());
    }
    dv.remove(mFigure.get(cc.getID()));
    cme.removeCompositeConstraint(cc);
  }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.CFRelation

    features.addAll(cc.getSinkFeatureSet());
   
    for (int i=0 ; i<features.size() ; i++) {
      Feature feature = features.get(i);
      if (!Customization.Undecided.equals(cv.getFinalCustomizationById(feature.getID()))) {
        CFRelation relation = cm.getCFRelation(feature , cc , true);
        if (relation==null) {
          relation = cm.getCFRelation(feature , cc , false);
        }
        dv.remove(mFigure.get(relation.getID()));
        cme.removeCFRelation(relation.getID());
      }
    }
  }
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.