Package de.FeatureModellingTool.GraphicalEditor

Examples of de.FeatureModellingTool.GraphicalEditor.PLFigure


    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)) {
      plfNew.setAttribute("PLType" , PLFigure.R2L_REQUIRE);
    } else if (CompositeConstraintType.Equivalence.equals(cct)) {
      plfNew.setAttribute("PLType" , PLFigure.EQUIVALENCE);
    } else {
      plfNew.setAttribute("PLType" , PLFigure.MUTEX);
    }
    plfNew.setAttribute("SourceType" , ccptSource.getName());
    plfNew.setAttribute("SinkType" , ccptSink.getName());
    dv.add(plfNew);
    plfNew.setDisplayBox(fOld.getDisplayBox());
   
    for (Iterator<Feature> itFeature=fSources.iterator() ; itFeature.hasNext() ; ) {
      Feature fSource = itFeature.next();
      Figure figureSource = mFigure.get(fSource.getID());
      CFRelation rOld = cm.getCFRelation(fSource , cOld , true);
      if (rOld==null) {
        rOld = cm.getCFRelation(fSource , cOld , false);
      }
      PLConnection plcOld = (PLConnection)mFigure.get(rOld.getID());
     
      CFRelation rNew = cme.addCFRelation(fSource , ccNew , true
          , rOld.getModifier().equals(CFRModifier.Affirmation) ? (revertSourceRelation ? CFRModifier.Negation : CFRModifier.Affirmation) : (revertSourceRelation ? CFRModifier.Affirmation : CFRModifier.Negation));
           
      PLConnection plcNew = new PLConnection();
      plcNew.setAttribute("id" , rNew.getID());
      plcNew.setAttribute("frameColor" , plcOld.getAttribute("frameColor"));
      plcNew.setAttribute("type" , plcOld.getAttribute("type"));
      plcNew.setAttribute("CFRModifier" , rNew.getModifier().getName());

      for (int i=0 ; i<plcOld.pointCount() ; i++) {
        plcNew.addPoint(plcOld.pointAt(i).x , plcOld.pointAt(i).y);
      }
      plcNew.startPoint(plfNew.getConnectors()[0].getDisplayBox().x , plfNew.getConnectors()[0].getDisplayBox().y);
      plcNew.connectStart(plfNew.getConnectors()[0]);
      plcNew.endPoint(figureSource.getConnectors()[4].getDisplayBox().x , figureSource.getConnectors()[4].getDisplayBox().y);
      plcNew.connectEnd(figureSource.getConnectors()[4]);
      dv.add(plcNew);
    }
   
    for (Iterator<Feature> itFeature=fSinks.iterator() ; itFeature.hasNext() ; ) {
      Feature fSink = itFeature.next();
      Figure figureSink = mFigure.get(fSink.getID());
      CFRelation rOld = cm.getCFRelation(fSink , cOld , true);
      if (rOld==null) {
        rOld = cm.getCFRelation(fSink , cOld , false);
      }
      CFRelation rNew = cme.addCFRelation(fSink , ccNew , true
          , rOld.getModifier().equals(CFRModifier.Affirmation) ? (revertSinkRelation ? CFRModifier.Negation : CFRModifier.Affirmation) : (revertSinkRelation ? CFRModifier.Affirmation : CFRModifier.Negation));
           
      PLConnection plcOld = (PLConnection)mFigure.get(rOld.getID());
      PLConnection plcNew = new PLConnection();
      plcNew.setAttribute("id" , rNew.getID());
      plcNew.setAttribute("frameColor" , plcOld.getAttribute("frameColor"));
      plcNew.setAttribute("type" , plcOld.getAttribute("type"));
      plcNew.setAttribute("CFRModifier" , rNew.getModifier().getName());

      for (int i=0 ; i<plcOld.pointCount() ; i++) {
        plcNew.addPoint(plcOld.pointAt(i).x , plcOld.pointAt(i).y);
      }
      plcNew.startPoint(plfNew.getConnectors()[1].getDisplayBox().x , plfNew.getConnectors()[1].getDisplayBox().y);
      plcNew.connectStart(plfNew.getConnectors()[1]);
      plcNew.endPoint(figureSink.getConnectors()[3].getDisplayBox().x , figureSink.getConnectors()[3].getDisplayBox().y);
      plcNew.connectEnd(figureSink.getConnectors()[3]);
      dv.add(plcNew);
    }
   
View Full Code Here


  }
 
  public static PLFigure dupPLFigure(PLFigure gcfSrc
      , HashMap<String,String> mName , HashMap<String,Figure> mFigure
      , DrawingView dvDest) {
    PLFigure result = new PLFigure();
   
    result.setAttribute("id" , mName.get(gcfSrc.getAttribute("id")));
    result.setAttribute("bounds" , gcfSrc.getAttribute("bounds"));
    result.setAttribute("frameColor" , gcfSrc.getAttribute("frameColor"));
    result.setAttribute("PLType" , gcfSrc.getAttribute("PLType"));
    result.setAttribute("SourceType" , gcfSrc.getAttribute("SourceType"));
    result.setAttribute("SinkType" , gcfSrc.getAttribute("SinkType"));

    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.PLFigure

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.