Package de.FeatureModellingTool.GraphicalEditor

Examples of de.FeatureModellingTool.GraphicalEditor.GroupConstraintFigure


      , 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);
   
    for (Iterator<Feature> itFeature=fsSrc.iterator() ; itFeature.hasNext() ; ) {
      Feature f = itFeature.next();
      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());
      plc.endPoint(figureSrc.getDisplayBox().x , figureSrc.getDisplayBox().y);
    }
  }
View Full Code Here


    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 {
      gcf.setAttribute("GroupType" , GroupConstraintFigure.All);
    }
//    gcfDest.setAttribute("PortPosition" , gcfSrc.getAttribute("PortPosition"));
    gcf.setAttribute("bounds" , constraintFigure.getAttribute("bounds"));
    gcf.setAttribute("frameColor" , constraintFigure.getAttribute("frameColor"));
    dv.add(gcf);
    gcf.setDisplayBox(constraintFigure.getDisplayBox());
   
    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++) {
        plcNew.addPoint(plcOld.pointAt(i).x , plcOld.pointAt(i).y);
      }
      plcNew.startPoint(gcf.getConnectors()[0].getDisplayBox().x , gcf.getConnectors()[0].getDisplayBox().y);
      plcNew.connectStart(gcf.getConnectors()[0]);
      Figure featureFigure = mFigure.get(f.getID());
      plcNew.endPoint(featureFigure.getConnectors()[3].getDisplayBox().x , featureFigure.getConnectors()[3].getDisplayBox().y);
      plcNew.connectEnd(featureFigure.getConnectors()[3]);
     
      dv.add(plcNew);
View Full Code Here

  }
 
  public static GroupConstraintFigure dupGroupConstraintFigure(GroupConstraintFigure gcfSrc
      , HashMap<String,String> mName , HashMap<String,Figure> mFigure
      , DrawingView dvDest) {
    GroupConstraintFigure result = new GroupConstraintFigure();
   
    result.setAttribute("id" , mName.get(gcfSrc.getAttribute("id")));
    result.setAttribute("GroupType" , gcfSrc.getAttribute("GroupType"));
    result.setAttribute("PortPosition" , gcfSrc.getAttribute("PortPosition"));
    result.setAttribute("bounds" , gcfSrc.getAttribute("bounds"));
    result.setAttribute("frameColor" , gcfSrc.getAttribute("frameColor"));

    dvDest.add(result);
    result.moveBy(gcfSrc.getDisplayBox().x , gcfSrc.getDisplayBox().y);
   
    mName.put((String)gcfSrc.getAttribute("id") , UIDupHelper.FIGURE_ID_PREFIX + gcfSrc.getAttribute("id"));
    mFigure.put(UIDupHelper.FIGURE_ID_PREFIX + gcfSrc.getAttribute("id") , result);
   
    return result;
View Full Code Here

TOP

Related Classes of de.FeatureModellingTool.GraphicalEditor.GroupConstraintFigure

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.