Package de.FeatureModellingTool.FeatureModel

Examples of de.FeatureModellingTool.FeatureModel.GroupConstraint


      , Collection<Feature> features , boolean revertCFRelation  , GroupConstraintType gct
      , ConstraintModel cm , ConstraintModelEditor cme , GroupConstraintEditor gce
      , DrawingView dv , HashMap<String,Figure> mFigure) {
    Figure constraintFigure = mFigure.get(c.getID());
   
    GroupConstraint gcDest = cme.addGroupConstraint();
    gce.setType(gcDest , gct);
   
    GroupConstraintFigure gcf = new GroupConstraintFigure();
    gcf.setAttribute("id" , gcDest.getID());
    if (GroupConstraintType.SingleGroup.equals(gct)) {
      gcf.setAttribute("GroupType" , GroupConstraintFigure.Single);
    } else if (GroupConstraintType.MultiGroup.equals(gct)) {
      gcf.setAttribute("GroupType" , GroupConstraintFigure.Multi);
    } else {
View Full Code Here


   
    if (cm.getAllGroupConstraint()!=null) {
      List<GroupConstraint> gcs = new ArrayList<GroupConstraint>();
      gcs.addAll(cm.getAllGroupConstraint().values());
      for (int i=0 ; i<gcs.size() ; i++) {
        GroupConstraint gc = gcs.get(i);
        Figure f = mFigure.get(gc.getID());
        DrawingView dv = mDrawingView.get(f);
        if (!checkGroupConstraint(gc , cm , cme , dv , cv , mFigure)) {
//          return false;
        }
      }
View Full Code Here

        }

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

            boolean newFeature = false;
            boolean allNewFeature = true;
            for (Iterator<Feature> itFeature = gc.getFeatureSet().iterator(); itFeature.hasNext();) {
                Feature constraintFeature = itFeature.next();
                if (htNameMap.containsKey(constraintFeature.getID())) {
                    newFeature = true;
                } else {
                    allNewFeature = false;
                }
            }

            GroupConstraint newConstraint = null;
            if (newFeature) {
                if (allNewFeature) {
                    newConstraint = constraintModelEditor.addGroupConstraint();
                    groupConstraintEditor.setType(newConstraint, gc.getType());
                    htNameMap.put(gc.getID(), newConstraint.getID());
                } else {
                    newConstraint = gc;
                }

                for (Iterator<Feature> itFeature = gc.getFeatureSet().iterator(); itFeature.hasNext();) {
                    Feature constraintFeature = itFeature.next();
                    if (allNewFeature || htNameMap.containsKey(constraintFeature.getID())) {
                        constraintFeature = featureModel.getFeature(htNameMap.get(constraintFeature.getID()));
                        groupConstraintEditor.addFeature(newConstraint, constraintFeature);
                    }
                }
            }
        }

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

            boolean newFeature = false;
            boolean allNewFeature = true;
            for (Iterator<Feature> itFeature = gc.getSinkFeatureSet().iterator(); itFeature.hasNext();) {
                Feature constraintFeature = itFeature.next();
                if (htNameMap.containsKey(constraintFeature.getID())) {
                    newFeature = true;
                } else {
                    allNewFeature = false;
                }
            }
            for (Iterator<Feature> itFeature = gc.getSourceFeatureSet().iterator(); itFeature.hasNext();) {
                Feature constraintFeature = itFeature.next();
                if (htNameMap.containsKey(constraintFeature.getID())) {
                    newFeature = true;
                } else {
                    allNewFeature = false;
                }
            }

            if (newFeature) {
                CompositeConstraint newConstraint = null;
                if (allNewFeature) {
                    newConstraint = constraintModelEditor.addCompositeConstraint();
                    compositeConstraintEditor.setPLType(newConstraint, gc.getPLType());
                    compositeConstraintEditor.setSinkType(newConstraint, gc.getSinkType());
                    compositeConstraintEditor.setSourceType(newConstraint, gc.getSourceType());
                    htNameMap.put(gc.getID(), newConstraint.getID());
                } else {
                    newConstraint = gc;
                }

                for (Iterator<Feature> itFeature = gc.getSourceFeatureSet().iterator(); itFeature.hasNext();) {
                    Feature constraintFeature = itFeature.next();
                    if (allNewFeature || htNameMap.containsKey(constraintFeature.getID())) {
                        constraintFeature = featureModel.getFeature(htNameMap.get(constraintFeature.getID()));
                        compositeConstraintEditor.addSourceFeature(newConstraint, constraintFeature);
                    }
                }

                for (Iterator<Feature> itFeature = gc.getSinkFeatureSet().iterator(); itFeature.hasNext();) {
                    Feature constraintFeature = itFeature.next();
                    if (allNewFeature || htNameMap.containsKey(constraintFeature.getID())) {
                        constraintFeature = featureModel.getFeature(htNameMap.get(constraintFeature.getID()));
                        compositeConstraintEditor.addSinkFeature(newConstraint, constraintFeature);
                    }
                }
            }
        }

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

            boolean newFeature = false;
            boolean allNewFeature = true;
            for (Iterator<Feature> itFeature = gc.getSinkFeatureSet().iterator(); itFeature.hasNext();) {
                Feature constraintFeature = itFeature.next();
                if (htNameMap.containsKey(constraintFeature.getID())) {
                    newFeature = true;
                } else {
                    allNewFeature = false;
                }
            }
            for (Iterator<Feature> itFeature = gc.getSourceFeatureSet().iterator(); itFeature.hasNext();) {
                Feature constraintFeature = itFeature.next();
                if (htNameMap.containsKey(constraintFeature.getID())) {
                    newFeature = true;
                } else {
                    allNewFeature = false;
                }
            }

            if (newFeature) {
                VPConstraint newConstraint = null;
                if (allNewFeature) {
                    newConstraint = constraintModelEditor.addVPConstraint();
                    vpConstraintEditor.setType(newConstraint, gc.getType());
                    htNameMap.put(gc.getID(), newConstraint.getID());
                } else {
                    newConstraint = gc;
                }

                for (Iterator<Feature> itFeature = gc.getSourceFeatureSet().iterator(); itFeature.hasNext();) {
                    Feature constraintFeature = itFeature.next();
                    if (allNewFeature || htNameMap.containsKey(constraintFeature.getID())) {
                        constraintFeature = featureModel.getFeature(htNameMap.get(constraintFeature.getID()));
                        vpConstraintEditor.addSourceFeature(newConstraint, constraintFeature);
                    }
                }

                for (Iterator<Feature> itFeature = gc.getSinkFeatureSet().iterator(); itFeature.hasNext();) {
                    Feature constraintFeature = itFeature.next();
                    if (allNewFeature || htNameMap.containsKey(constraintFeature.getID())) {
                        constraintFeature = featureModel.getFeature(htNameMap.get(constraintFeature.getID()));
                        vpConstraintEditor.addSinkFeature(newConstraint, constraintFeature);
                    }
                }
            }
        }

        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

 
  public static GroupConstraint dupGroupConstraint(GroupConstraint gcSrc , ConstraintModel cmSrc
      , HashMap<String,String> mName , HashMap<String,Feature> mFeature
      , HashMap<String,Constraint> mConstraint , HashMap<String,CFRelation> mRelation
      , ConstraintModelEditor cmeDest , GroupConstraintEditor gceDest) {
    GroupConstraint result = cmeDest.addGroupConstraint();
    gceDest.setType(result , gcSrc.getType());
    for (Iterator<Feature> itFeature=(Iterator<Feature>)gcSrc.getFeatureSet().iterator() ; itFeature.hasNext() ; ) {
      Feature fSrc = itFeature.next();
      Feature fDest = mFeature.get(mName.get(fSrc.getID()));
      gceDest.addFeature(result , fDest);
     
      boolean isSource = true;
      CFRelation cfrSrc = cmSrc.getCFRelation(fSrc , gcSrc , isSource);
      if (cfrSrc==null) {
        isSource = false;
        cfrSrc = cmSrc.getCFRelation(fSrc , gcSrc , isSource);
      }
      CFRelation cfrDest = cmeDest.addCFRelation(fDest , result , isSource , cfrSrc.getModifier());
     
      mName.put(cfrSrc.getID() , cfrDest.getID());
      mRelation.put(cfrDest.getID() , cfrDest);
    }
   
    mName.put(gcSrc.getID() , result.getID());
    mConstraint.put(result.getID() , result);
   
    return result;
  }
View Full Code Here

            if (!(src instanceof Constraint))
                return;

            if (src instanceof GroupConstraint) {
                GroupConstraint target = (GroupConstraint) src;
                String propertyName = evt.getPropertyName();

                if (propertyName.equals(GroupConstraintProperties.TYPE)) {
                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    GroupConstraintType gType = target.getType();

                    String value = null;

                    if (GroupConstraintType.SingleGroup.equals(gType)) {
                        value = GroupConstraintFigure.Single;
                    } else if (GroupConstraintType.MultiGroup.equals(gType)) {
                        value = GroupConstraintFigure.Multi;
                    } else if (GroupConstraintType.AllGroup.equals(gType)) {
                        value = GroupConstraintFigure.All;
                    }

                    Iterator iterator = set.iterator();
                    while (iterator.hasNext()) {
                        Figure fig = (Figure) iterator.next();
                        fig.setAttribute(GroupConstraintFigure.GroupType, value);
                        fig.invalidate();
                    }
                }
            } else if (src instanceof VPConstraint) {
                VPConstraint target = (VPConstraint) src;
                String propertyName = evt.getPropertyName();

                if (propertyName.equals(VPConstraintProperties.TYPE)) {
                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    VPConstraintType gType = target.getType();

                    String value = null;

                    if (VPConstraintType.SingleVP.equals(gType)) {
                        value = VPConstraintFigure.Single;
                    } else if (VPConstraintType.MultiVP.equals(gType)) {
                        value = VPConstraintFigure.Multi;
                    } else if (VPConstraintType.AllVP.equals(gType)) {
                        value = VPConstraintFigure.All;
                    }

                    Iterator iterator = set.iterator();
                    while (iterator.hasNext()) {
                        Figure fig = (Figure) iterator.next();
                        fig.setAttribute(VPConstraintFigure.VPType, value);
                        fig.invalidate();
                    }
                }
            } else if (src instanceof CompositeConstraint) {

                CompositeConstraint target = (CompositeConstraint) src;
                String propertyName = evt.getPropertyName();

                if (propertyName.equals(CompositeConstraintProperties.PL_TYPE)) {
                    //find the figure
                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    CompositeConstraintType plType = target.getPLType();

                    Integer value = null;

                    if (CompositeConstraintType.L2R_Implication.equals(plType)) {
                        value = PLFigure.L2R_REQUIRE;
                    } else if (CompositeConstraintType.R2L_Implication.equals(plType)) {
                        value = PLFigure.R2L_REQUIRE;
                    } else if (CompositeConstraintType.Mutex.equals(plType)) {
                        value = PLFigure.MUTEX;
                    } else if (CompositeConstraintType.Equivalence.equals(plType)) {
                        value = PLFigure.EQUIVALENCE;
                    }

                    Iterator iterator = set.iterator();
                    while (iterator.hasNext()) {
                        Figure fig = (Figure) iterator.next();
                        fig.setAttribute(PLFigure.PLType, value);
                        fig.invalidate();
                    }
                } else if (propertyName.equals(CompositeConstraintProperties.SOURCE_TYPE)) {
                    //find the figure
                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    CompositeConstraintPortType sourceType = target.getSourceType();

                    String value = null;

                    if (CompositeConstraintPortType.Single.equals(sourceType)) {
                        value = PLFigure.Single;
                    } else if (CompositeConstraintPortType.Multi.equals(sourceType)) {
                        value = PLFigure.Multi;
                    } else {
                        value = PLFigure.All;
                    }

                    Iterator iterator = set.iterator();
                    while (iterator.hasNext()) {
                        Figure fig = (Figure) iterator.next();
                        fig.setAttribute(PLFigure.SourceType, value);
                        fig.invalidate();
                    }
                } else if (propertyName.equals(CompositeConstraintProperties.SINK_TYPE)) {
                    //find the figure
                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    CompositeConstraintPortType sinkType = target.getSinkType();

                    String value = null;

                    if (CompositeConstraintPortType.Single.equals(sinkType)) {
                        value = PLFigure.Single;
View Full Code Here

            if (!(src instanceof Constraint))
                return;

            if (src instanceof GroupConstraint) {
                GroupConstraint target = (GroupConstraint) src;
                String propertyName = evt.getPropertyName();

                if (propertyName.equals(GroupConstraintProperties.TYPE)) {
                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    GroupConstraintType gType = target.getType();

                    String value = null;

                    if (GroupConstraintType.SingleGroup.equals(gType)) {
                        value = GroupConstraintFigure.Single;
                    } else if (GroupConstraintType.MultiGroup.equals(gType)) {
                        value = GroupConstraintFigure.Multi;
                    } else if (GroupConstraintType.AllGroup.equals(gType)) {
                        value = GroupConstraintFigure.All;
                    }

                    Iterator iterator = set.iterator();
                    while (iterator.hasNext()) {
                        Figure fig = (Figure) iterator.next();
                        fig.setAttribute(GroupConstraintFigure.GroupType, value);
                        fig.invalidate();
                    }
                }
            } else if (src instanceof VPConstraint) {
                VPConstraint target = (VPConstraint) src;
                String propertyName = evt.getPropertyName();

                if (propertyName.equals(VPConstraintProperties.TYPE)) {
                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    VPConstraintType gType = target.getType();

                    String value = null;

                    if (VPConstraintType.SingleVP.equals(gType)) {
                        value = VPConstraintFigure.Single;
                    } else if (VPConstraintType.MultiVP.equals(gType)) {
                        value = VPConstraintFigure.Multi;
                    } else if (VPConstraintType.AllVP.equals(gType)) {
                        value = VPConstraintFigure.All;
                    }

                    Iterator iterator = set.iterator();
                    while (iterator.hasNext()) {
                        Figure fig = (Figure) iterator.next();
                        fig.setAttribute(VPConstraintFigure.VPType, value);
                        fig.invalidate();
                    }
                }
            } else if (src instanceof CompositeConstraint) {

                CompositeConstraint target = (CompositeConstraint) src;
                String propertyName = evt.getPropertyName();

                if (propertyName.equals(CompositeConstraintProperties.PL_TYPE)) {
                    //find the figure
                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    CompositeConstraintType plType = target.getPLType();

                    Integer value = null;

                    if (CompositeConstraintType.L2R_Implication.equals(plType)) {
                        value = PLFigure.L2R_REQUIRE;
                    } else if (CompositeConstraintType.R2L_Implication.equals(plType)) {
                        value = PLFigure.R2L_REQUIRE;
                    } else if (CompositeConstraintType.Mutex.equals(plType)) {
                        value = PLFigure.MUTEX;
                    } else if (CompositeConstraintType.Equivalence.equals(plType)) {
                        value = PLFigure.EQUIVALENCE;
                    }

                    Iterator iterator = set.iterator();
                    while (iterator.hasNext()) {
                        Figure fig = (Figure) iterator.next();
                        fig.setAttribute(PLFigure.PLType, value);
                        fig.invalidate();
                    }
                } else if (propertyName.equals(CompositeConstraintProperties.SOURCE_TYPE)) {
                    //find the figure
                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    CompositeConstraintPortType sourceType = target.getSourceType();

                    String value = null;

                    if (CompositeConstraintPortType.Single.equals(sourceType)) {
                        value = PLFigure.Single;
                    } else if (CompositeConstraintPortType.Multi.equals(sourceType)) {
                        value = PLFigure.Multi;
                    } else {
                        value = PLFigure.All;
                    }

                    Iterator iterator = set.iterator();
                    while (iterator.hasNext()) {
                        Figure fig = (Figure) iterator.next();
                        fig.setAttribute(PLFigure.SourceType, value);
                        fig.invalidate();
                    }
                } else if (propertyName.equals(CompositeConstraintProperties.SINK_TYPE)) {
                    //find the figure
                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    CompositeConstraintPortType sinkType = target.getSinkType();

                    String value = null;

                    if (CompositeConstraintPortType.Single.equals(sinkType)) {
                        value = PLFigure.Single;
View Full Code Here

    }
   
    constraints.clear();
    constraints.addAll(constraintModel.getAllGroupConstraint().values());
    for (Iterator<GroupConstraint> itConstraint = constraints.iterator() ; itConstraint.hasNext() ; ) {
      GroupConstraint gc = itConstraint.next();
     
      boolean newFeature = false;
      boolean allNewFeature = true;
      for (Iterator<Feature> itFeature = gc.getFeatureSet().iterator() ; itFeature.hasNext() ; ) {
        Feature constraintFeature = itFeature.next();
        if (htNameMap.containsKey(constraintFeature.getID())) {
          newFeature = true;
        } else {
          allNewFeature = false;
        }
      }
     
      GroupConstraint newConstraint = null;
      if (newFeature) {
        if (allNewFeature) {
          newConstraint = constraintModelEditor.addGroupConstraint();
          groupConstraintEditor.setType(newConstraint , gc.getType());
          htNameMap.put(gc.getID() , newConstraint.getID());
        } else {
          newConstraint = gc;
        }
       
        for (Iterator<Feature> itFeature = gc.getFeatureSet().iterator() ; itFeature.hasNext() ; ) {
          Feature constraintFeature = itFeature.next();
          if (allNewFeature || htNameMap.containsKey(constraintFeature.getID())) {
            constraintFeature = featureModel.getFeature(htNameMap.get(constraintFeature.getID()));
            groupConstraintEditor.addFeature(newConstraint , constraintFeature);
          }
        }
      }
    }
   
    constraints.clear();
    constraints.addAll(constraintModel.getAllCompositeConstraint().values());
    for (Iterator<CompositeConstraint> itConstraint = constraints.iterator() ; itConstraint.hasNext() ; ) {
      CompositeConstraint gc = itConstraint.next();
     
      boolean newFeature = false;
      boolean allNewFeature = true;
      for (Iterator<Feature> itFeature = gc.getSinkFeatureSet().iterator() ; itFeature.hasNext() ; ) {
        Feature constraintFeature = itFeature.next();
        if (htNameMap.containsKey(constraintFeature.getID())) {
          newFeature = true;
        } else {
          allNewFeature = false;
        }
      }
      for (Iterator<Feature> itFeature = gc.getSourceFeatureSet().iterator() ; itFeature.hasNext() ; ) {
        Feature constraintFeature = itFeature.next();
        if (htNameMap.containsKey(constraintFeature.getID())) {
          newFeature = true;
        } else {
          allNewFeature = false;
        }
      }

      if (newFeature) {
        CompositeConstraint newConstraint = null;
        if (allNewFeature) {
          newConstraint = constraintModelEditor.addCompositeConstraint();
          compositeConstraintEditor.setPLType(newConstraint , gc.getPLType());
          compositeConstraintEditor.setSinkType(newConstraint , gc.getSinkType());
          compositeConstraintEditor.setSourceType(newConstraint , gc.getSourceType());
          htNameMap.put(gc.getID() , newConstraint.getID());
        } else {
          newConstraint = gc;
        }
       
        for (Iterator<Feature> itFeature = gc.getSourceFeatureSet().iterator() ; itFeature.hasNext() ; ) {
          Feature constraintFeature = itFeature.next();
          if (allNewFeature || htNameMap.containsKey(constraintFeature.getID())) {
            constraintFeature = featureModel.getFeature(htNameMap.get(constraintFeature.getID()));
            compositeConstraintEditor.addSourceFeature(newConstraint , constraintFeature);
          }
        }
       
        for (Iterator<Feature> itFeature = gc.getSinkFeatureSet().iterator() ; itFeature.hasNext() ; ) {
          Feature constraintFeature = itFeature.next();
          if (allNewFeature || htNameMap.containsKey(constraintFeature.getID())) {
            constraintFeature = featureModel.getFeature(htNameMap.get(constraintFeature.getID()));
            compositeConstraintEditor.addSinkFeature(newConstraint , constraintFeature);
          }
        }
      }
    }
   
    constraints.clear();
    constraints.addAll(constraintModel.getAllVPConstraint().values());
    for (Iterator<VPConstraint> itConstraint = constraints.iterator() ; itConstraint.hasNext() ; ) {
      VPConstraint gc = itConstraint.next();
     
      boolean newFeature = false;
      boolean allNewFeature = true;
      for (Iterator<Feature> itFeature = gc.getSinkFeatureSet().iterator() ; itFeature.hasNext() ; ) {
        Feature constraintFeature = itFeature.next();
        if (htNameMap.containsKey(constraintFeature.getID())) {
          newFeature = true;
        } else {
          allNewFeature = false;
        }
      }
      for (Iterator<Feature> itFeature = gc.getSourceFeatureSet().iterator() ; itFeature.hasNext() ; ) {
        Feature constraintFeature = itFeature.next();
        if (htNameMap.containsKey(constraintFeature.getID())) {
          newFeature = true;
        } else {
          allNewFeature = false;
        }
      }

      if (newFeature) {
        VPConstraint newConstraint = null;
        if (allNewFeature) {
          newConstraint = constraintModelEditor.addVPConstraint();
          vpConstraintEditor.setType(newConstraint , gc.getType());
          htNameMap.put(gc.getID() , newConstraint.getID());
        } else {
          newConstraint = gc;
        }
       
        for (Iterator<Feature> itFeature = gc.getSourceFeatureSet().iterator() ; itFeature.hasNext() ; ) {
          Feature constraintFeature = itFeature.next();
          if (allNewFeature || htNameMap.containsKey(constraintFeature.getID())) {
            constraintFeature = featureModel.getFeature(htNameMap.get(constraintFeature.getID()));
            vpConstraintEditor.addSourceFeature(newConstraint , constraintFeature);
          }
        }
       
        for (Iterator<Feature> itFeature = gc.getSinkFeatureSet().iterator() ; itFeature.hasNext() ; ) {
          Feature constraintFeature = itFeature.next();
          if (allNewFeature || htNameMap.containsKey(constraintFeature.getID())) {
            constraintFeature = featureModel.getFeature(htNameMap.get(constraintFeature.getID()));
            vpConstraintEditor.addSinkFeature(newConstraint , constraintFeature);
          }
        }
      }
    }
   
    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

TOP

Related Classes of de.FeatureModellingTool.FeatureModel.GroupConstraint

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.