Package de.FeatureModellingTool.FeatureModel

Examples of de.FeatureModellingTool.FeatureModel.GroupConstraint


      }
    }
    if (this.constraintModel.getAllGroupConstraint()!=null) {
      for (Iterator<GroupConstraint> itGC=this.constraintModel.getAllGroupConstraint().values().iterator()
          ; itGC.hasNext() ; ) {
        GroupConstraint gc = itGC.next();
        List<Feature> featureList = new ArrayList<Feature>(gc.getFeatureSet());
        for (int i=0 ; i<featureList.size() ; i++) {
          for (int j=i+1 ; j<featureList.size() ; j++) {
            NNode startNode = builtFeatures.get(featureList.get(i));
            NNode endNode = builtFeatures.get(featureList.get(j));
            startNode.addEdge(endNode);
View Full Code Here


        }
      }
    }
   
    for (Iterator<GroupConstraint> itGC=this.cm.getAllGroupConstraint().values().iterator() ; itGC.hasNext() ; ) {
      GroupConstraint gc = itGC.next();
      if (gc.getType().equals(GroupConstraintType.SingleGroup)) {
        List<Feature> features = new ArrayList<Feature>(gc.getFeatureSet());
        for (int i=0 ; i<features.size() ; i++) {
          for (int j=0 ; j<features.size() ; j++) {
            if (i!=j) {
              CFRModifier c;
              this.graph.addEdge(features.get(i) , cm.getCFRelation(features.get(i),gc,false).getModifier().equals(CFRModifier.Affirmation)
                  , features.get(j) , !cm.getCFRelation(features.get(j),gc,false).getModifier().equals(CFRModifier.Affirmation));
            }
          }
        }
      } else if (gc.getType().equals(GroupConstraintType.AllGroup)) {
        List<Feature> features = new ArrayList<Feature>(gc.getFeatureSet());
        for (int i=0 ; i<features.size() ; i++) {
          for (int j=0 ; j<features.size() ; j++) {
            if (i!=j) {
              this.graph.addEdge(features.get(i) , cm.getCFRelation(features.get(i),gc,false).getModifier().equals(CFRModifier.Affirmation)
                  , features.get(j) , cm.getCFRelation(features.get(j),gc,false).getModifier().equals(CFRModifier.Affirmation));
View Full Code Here

      this.constraintModelEditor.addCFRelation(feature , constraint , isSource , CFRModifier.Affirmation);
    }
  }
  protected void addGroupConstraint(int groupCount , int featurePerGroup , GroupConstraintType gct) {
    for (int i=0 ; i<groupCount ; i++) {
      GroupConstraint gc = this.constraintModelEditor.addGroupConstraint();
      this.groupConstraintEditor.setType(gc , gct);

      List<Feature> features = this.getRandomFeatures(featurePerGroup);
      for (int j=0 ; j<features.size() ; j++) {
        this.groupConstraintEditor.addFeature(gc , features.get(j));
View Full Code Here

        return false;
      }
      if (!(constraint instanceof GroupConstraint)) {
        return false;
      }
      GroupConstraint gc = (GroupConstraint)constraint;
      if (!gc.getFeatureSet().contains(node.getFeature())) {
        return false;
      }
      label.setIcon(getNodeIcon(node));
      render.setHorizontalAlignment(SwingConstants.CENTER);
      return true;
View Full Code Here

   
    public String getConstraintName(Object cons) {
      if (!(cons instanceof GroupConstraint)) {
        return "";
      }
      GroupConstraint constraint = (GroupConstraint)cons;
      return constraint.getType().getName();
    }
View Full Code Here

    public ImageIcon getConstraintIcon(Object cons , ConstraintModel constraintModel , CustomizationVersion cv) {
      if (!(cons instanceof GroupConstraint)) {
        return null;
      }
      GroupConstraint gc = (GroupConstraint)cons;
      if (cv==null) {
          return ImageManager.getInstance().getGroupConstraintHeader(gc.getType() , null , ImageManager.ConstraintStat.csNone);
      } else {
          List<Customization> sCustomization = new ArrayList<Customization>();
          for (Iterator<Feature> itFeature=gc.getFeatureSet().iterator() ; itFeature.hasNext() ; ) {
            Feature feature = itFeature.next();
            CFRelation cf = constraintModel.getCFRelation(feature , gc , true);
            if (cf==null) {
                cf = constraintModel.getCFRelation(feature , gc , false);
            }
            sCustomization.add(super.convertCustomization(cv.getFinalCustomizationById(feature.getID()) , cf));
          }
         
          Customization value = Customization.Undecided;
          if (gc.getType().getName().equals(GroupConstraintType.SingleGroup.getName())) {
            if (super.getCustomizationCount(sCustomization , Customization.Selected)>1) {
              value = Customization.Unselected;
            } else if (super.getCustomizationCount(sCustomization , Customization.Undecided)==0) {
              value = Customization.Selected;
            } else {
              value = Customization.Undecided;
            }
          } else if (gc.getType().getName().equals(GroupConstraintType.AllGroup.getName())) {
            if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
              value = Customization.Undecided;
            } else if (super.getCustomizationCount(sCustomization , Customization.Unselected)==0) {
              value = Customization.Selected;
            } else {
              value = Customization.Unselected;
            }
          } else /*if (gc.getType().getName().equals(GroupConstraintType.SingleGroup))*/ {
            value = Customization.Selected;
          }
          return ImageManager.getInstance().getGroupConstraintHeader(gc.getType() , value , ImageManager.ConstraintStat.csNone);
        }
    }
View Full Code Here

    public boolean isRelatedFeature(Object cons , Feature feature) {
      if (!(cons instanceof GroupConstraint)) {
        return false;
      }
      GroupConstraint gc = (GroupConstraint)cons;
      return gc.getFeatureSet().contains(feature);
    }
View Full Code Here

   
    public Set<Feature> getRelatedFeatures(Object cons) {
      if (!(cons instanceof GroupConstraint)) {
        return null;
      }
      GroupConstraint gc = (GroupConstraint)cons;
      return gc.getFeatureSet();
    }
View Full Code Here

//    Map<Feature,  AtomedFeature>  allAtomedFeature  =  atomSet.getAllAtomedFeatures();
    Map  groupConstraint  =  constraintModel.getAllGroupConstraint();
    Iterator  e  =  groupConstraint.keySet().iterator();
    while(e.hasNext()){
    //  System.out.println("**********Building_GroupConstraint");
      GroupConstraint  c  =  (GroupConstraint)groupConstraint.get(e.next());
      Set  featureSet  =  c.getFeatureSet();
      if(featureSet.isEmpty())
        continue;
      GroupConstraintType  type  =  c.getType();
      int  tempBdd  =  1;
       
      if      (type  ==  GroupConstraintType.AllGroup){
        Iterator  i  =  featureSet.iterator();
        tempBdd  =  1;
 
View Full Code Here

      Collection<Feature> fsSrc , boolean undecidedOnly , CustomizationVersion cvSrc , HashMap<String,Figure> mFigure
      , boolean revertCFRelation , Constraint cSrc , ConstraintModel cmSrc
      , Figure fSrc
      , GroupConstraintType gctDest
      , ConstraintModelEditor cmeDest , GroupConstraintEditor gceDest , DrawingView dvDest) {
    GroupConstraint gcDest = cmeDest.addGroupConstraint();
    gceDest.setType(gcDest , gctDest);
   
    GroupConstraintFigure gcfDest = new GroupConstraintFigure();
    gcfDest.setAttribute("id" , gcDest.getID());
    gcfDest.setAttribute("GroupType" , gcDest.getType().getName());
//    gcfDest.setAttribute("PortPosition" , gcfSrc.getAttribute("PortPosition"));
    gcfDest.setAttribute("bounds" , fSrc.getAttribute("bounds"));
    gcfDest.setAttribute("frameColor" , fSrc.getAttribute("frameColor"));
    gcfDest.moveBy(fSrc.getDisplayBox().x , fSrc.getDisplayBox().y);
   
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.