Package de.FeatureModellingTool.FeatureModel

Examples of de.FeatureModellingTool.FeatureModel.CompositeConstraint


      , Collection<Feature> fSources , Collection<Feature> fSinks , CompositeConstraintType cct
      , CompositeConstraintPortType ccptSource , CompositeConstraintPortType ccptSink
      , boolean revertSourceRelation , boolean revertSinkRelation) {
    Figure fOld = mFigure.get(cOld.getID());
   
    CompositeConstraint ccNew = cme.addCompositeConstraint();
    cce.setPLType(ccNew , cct);
    cce.setSourceType(ccNew , ccptSource);
    cce.setSinkType(ccNew , ccptSink);
   
    PLFigure plfNew = new PLFigure();
    plfNew.setAttribute("id" , ccNew.getID());
    plfNew.setAttribute("bounds" , fOld.getAttribute("bounds"));
    plfNew.setAttribute("frameColor" , fOld.getAttribute("frameColor"));
    if (CompositeConstraintType.L2R_Implication.equals(cct)) {
      plfNew.setAttribute("PLType" , PLFigure.L2R_REQUIRE);
    } else if (CompositeConstraintType.R2L_Implication.equals(cct)) {
View Full Code Here


   
    if (cm.getAllCompositeConstraint()!=null) {
      List<CompositeConstraint> ccs = new ArrayList<CompositeConstraint>();
      ccs.addAll(cm.getAllCompositeConstraint().values());
      for (int i=0 ; i<ccs.size() ; i++) {
        CompositeConstraint cc = ccs.get(i);
        Figure f = mFigure.get(cc.getID());
        DrawingView dv = mDrawingView.get(f);
        if (!checkCompositeConstraint(cc , cm , cme , cce , gce , dv , cv , mFigure)) {
//          return false;
        }
      }
View Full Code Here

 
  public static CompositeConstraint dupCompositeConstraint(CompositeConstraint ccSrc , ConstraintModel cmSrc
      , HashMap<String,String> mName , HashMap<String,Feature> mFeature
      , HashMap<String,Constraint> mConstraint , HashMap<String,CFRelation> mRelation
      , ConstraintModelEditor cmeDest , CompositeConstraintEditor cceDest) {
    CompositeConstraint result = cmeDest.addCompositeConstraint();
    cceDest.setPLType(result , ccSrc.getPLType());
    cceDest.setSourceType(result , ccSrc.getSourceType());
    cceDest.setSinkType(result , ccSrc.getSinkType());

    for (Iterator<Feature> itFeature=(Iterator<Feature>)ccSrc.getSourceFeatureSet().iterator() ; itFeature.hasNext() ; ) {
      Feature fSrc = itFeature.next();
      Feature fDest = mFeature.get(mName.get(fSrc.getID()));
      cceDest.addSourceFeature(result , fDest);
     
      CFRelation cfrSrc = cmSrc.getCFRelation(fSrc , ccSrc , true);
      CFRelation cfrDest = cmeDest.addCFRelation(fDest , result , true , cfrSrc.getModifier());
     
      mName.put(cfrSrc.getID() , cfrDest.getID());
      mRelation.put(cfrDest.getID() , cfrDest);
    }
   
    for (Iterator<Feature> itFeature=(Iterator<Feature>)ccSrc.getSinkFeatureSet().iterator() ; itFeature.hasNext() ; ) {
      Feature fSrc = itFeature.next();
      Feature fDest = mFeature.get(mName.get(fSrc.getID()));
      cceDest.addSinkFeature(result , fDest);
     
      CFRelation cfrSrc = cmSrc.getCFRelation(fSrc , ccSrc , false);
      CFRelation cfrDest = cmeDest.addCFRelation(fDest , result , false , cfrSrc.getModifier());
     
      mName.put(cfrSrc.getID() , cfrDest.getID());
      mRelation.put(cfrDest.getID() , cfrDest);
    }
   
    mName.put(ccSrc.getID() , result.getID());
    mConstraint.put(result.getID() , result);
   
    return result;
  }
View Full Code Here

                        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

                        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

TOP

Related Classes of de.FeatureModellingTool.FeatureModel.CompositeConstraint

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.