Examples of FeatureRelation


Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

//          , rDist.getDisplayBox().y - rSrc.getDisplayBox().y + fOld.getDisplayBox().y);
            figureMap.put(newFeature.getID(), figDist);
        }

            for (Iterator<FeatureRelation> itRelation = fmSrc.getAllFeatureRelation().values().iterator(); itRelation != null && itRelation.hasNext();) {
                FeatureRelation relation = itRelation.next();
                if (!nameMap.containsKey(relation.getStartFeature().getID()) || !nameMap.containsKey(relation.getEndFeature().getID())) {
                    continue;
                }

                FeatureRelation newRelation = fmEditor.addRelation(relation.getName(), fmDist.getFeature(nameMap.get(relation.getStartFeature().getID())), fmDist.getFeature(nameMap.get(relation.getEndFeature().getID())));

                nameMap.put(relation.getID(), newRelation.getID());

                ConnectionFigure cf = null;
                if (FeatureRelation.ATTRIBUTE.equals(newRelation.getName())) {
                    AttributeConnection dvc = new AttributeConnection();
                    cf = dvc;
                } else if (FeatureRelation.DECOMPOSE.equals(newRelation.getName())) {
                    DecomposeConnection ic = new DecomposeConnection();
                    cf = ic;
                } else if (FeatureRelation.REQUIRE.equals(newRelation.getName())) {
                    ConstraintConnection cc = new ConstraintConnection(FeatureRelation.REQUIRE);
                    cc.setEndDecoration(new ArrowTip());
                    cf = cc;
                } else if (FeatureRelation.EXCLUDE.equals(newRelation.getName())) {
                    ConstraintConnection cc = new ConstraintConnection(FeatureRelation.EXCLUDE);
                    cc.setMidDecoration(new CrossDecoration(5));
                    cf = cc;
                }

                if (cf != null) {
                    cf.setAttribute("id", newRelation.getID());
                    cf.startPoint(figureMap.get(newRelation.getStartFeature().getID()).center().x, figureMap.get(newRelation.getStartFeature().getID()).center().y);
                    cf.endPoint(figureMap.get(newRelation.getEndFeature().getID()).center().x, figureMap.get(newRelation.getEndFeature().getID()).center().y);
                    if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(relation)) {
                        cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[2]);
                        cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[1]);
                    } else {
                        cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[0]);
                        cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[0]);
                    }
                    dvDist.add(cf);
                    cf.updateConnection();
                    dvDist.repairDamage();
                }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

        figureMap.put(fTarget.getID(), figDist);

        Feature fParent = fmSrc.getParentFeature(fSrc.getID());
        if (fParent != null) {
            for (Iterator<FeatureRelation> itRelation = fSrc.getAllRelatedRelation().iterator(); itRelation.hasNext();) {
                FeatureRelation relation = itRelation.next();
                if (relation.getStartFeature().getID().equals(fParent.getID())) {
                    FeatureRelation newRelation = fmEditor.addRelation(relation.getName(), fDist, fTarget);

                    ConnectionFigure cf = null;
                    if (FeatureRelation.ATTRIBUTE.equals(newRelation.getName())) {
                        AttributeConnection dvc = new AttributeConnection();
                        cf = dvc;
                    } else if (FeatureRelation.DECOMPOSE.equals(newRelation.getName())) {
                        DecomposeConnection ic = new DecomposeConnection();
                        cf = ic;
                    } else if (FeatureRelation.REQUIRE.equals(newRelation.getName())) {
                        ConstraintConnection cc = new ConstraintConnection(FeatureRelation.REQUIRE);
                        cc.setEndDecoration(new ArrowTip());
                        cf = cc;
                    } else if (FeatureRelation.EXCLUDE.equals(newRelation.getName())) {
                        ConstraintConnection cc = new ConstraintConnection(FeatureRelation.EXCLUDE);
                        cc.setMidDecoration(new CrossDecoration(5));
                        cf = cc;
                    }

                    if (cf != null) {
                        cf.setAttribute("id", newRelation.getID());
                        cf.startPoint(figureMap.get(newRelation.getStartFeature().getID()).center().x, figureMap.get(newRelation.getStartFeature().getID()).center().y);
                        cf.endPoint(figureMap.get(newRelation.getEndFeature().getID()).center().x, figureMap.get(newRelation.getEndFeature().getID()).center().y);
                        if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(relation)) {
                            cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[2]);
                            cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[1]);
                        } else {
                            cf.connectStart(figureMap.get(newRelation.getStartFeature().getID()).getConnectors()[0]);
                            cf.connectEnd(figureMap.get(newRelation.getEndFeature().getID()).getConnectors()[0]);
                        }
                        dvDist.add(cf);
                        cf.updateConnection();
                    }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

      , HashMap<String,String> mName , HashMap<String,FeatureRelation> mRelation
      , FeatureModelEditor fmeDest) {
    String sStart = mName.get(frSrc.getStartFeature().getID());
    String sEnd = mName.get(frSrc.getEndFeature().getID());
   
    FeatureRelation result = fmeDest.addRelation(frSrc.getName() , sStart , sEnd);
   
    mName.put(frSrc.getID() , result.getID());
    mRelation.put(result.getID() , result);
   
    return result;
  }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

      Feature fSrc = itFeature.next();
      dupFeature(fSrc , mName , mFeature , feDest , fmeDest);
    }
   
    for (Iterator<FeatureRelation> itFeatureRelation=fmDest.getAllFeatureRelation().values().iterator() ; itFeatureRelation.hasNext() ; ) {
      FeatureRelation frSrc = itFeatureRelation.next();
      dupFeatureRelation(frSrc , mName , mRelation , fmeDest);
    }
  }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

        while (it.hasNext()) {
            String id = (String) it.next();
            if (id == null)
                continue;
            Feature feature = featureModel.getFeature(id);
            FeatureRelation relation = featureModel.getFeatureRelation(id);

            if (feature != null) {
                tableModel.addRow(new Object[]{feature.getName(), feature.getDescription()});
            } else if (relation != null) {
                tableModel.addRow(new Object[]{relation.getName(), ""});
            } else {
                tableModel.addRow(new Object[]{"", ""});
            }
        }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

   
    for (Iterator<FeatureLayout> itFeatureLayout = this.featureLayouts.values().iterator() ; itFeatureLayout.hasNext() ; ) {
      Feature feature = itFeatureLayout.next().feature;
      if (feature.getAllRelatedRelation()!=null)
        for (Iterator<FeatureRelation> itFeatureRelation = (Iterator<FeatureRelation>)feature.getAllRelatedRelation().iterator() ; itFeatureRelation.hasNext() ; ) {
          FeatureRelation relation = itFeatureRelation.next();
          if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(relation)
              && relation.getStartFeature().getID().equals(feature.getID()))
            this.featureLayouts.get(relation.getEndFeature().getID()).parentFeature = feature;
        }
    }
   
    int rowIndex = 0;
    for (Iterator<FeatureLayout> itFeatureLayout = this.featureLayouts.values().iterator() ; itFeatureLayout.hasNext() ; ) {
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

    int minx = Integer.MAX_VALUE;
    int maxx = 0;
   
    if (featureLayout.feature.getAllRelatedRelation()!=null)
      for (Iterator<FeatureRelation> itFeatureRelation = (Iterator<FeatureRelation>)featureLayout.feature.getAllRelatedRelation().iterator() ; itFeatureRelation.hasNext() ; ) {
        FeatureRelation relation = itFeatureRelation.next();
        if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(relation)
            && featureLayout.feature.getID().equals(relation.getStartFeature().getID())) {
          hasChild = true;
 
          FeatureLayout childLayout = this.featureLayouts.get(relation.getEndFeature().getID());
          tmp = caculateLayout(childLayout , xoffset , rowIndex + 1 , widthStep , heightStep);
          if (tmp>result)
            result = tmp;
         
          minx = minx>childLayout.x ? childLayout.x : minx;
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

    }
   
    if (this.featureModel.getAllFeatureRelation()!=null)
      for (Iterator itRelation = this.featureModel.getAllFeatureRelation().values().iterator() ; itRelation.hasNext() ; )
      {
        FeatureRelation featureRelation = (FeatureRelation)itRelation.next();
        ConnectionFigure cf = null;
        if (FeatureRelation.ATTRIBUTE.equals(featureRelation.getName())) {
          AttributeConnection dvc = new AttributeConnection();
          cf = dvc;
        } else if (FeatureRelation.DECOMPOSE.equals(featureRelation.getName())) {
          DecomposeConnection ic = new DecomposeConnection();
          cf = ic;
        } else if (FeatureRelation.REQUIRE.equals(featureRelation.getName())) {
          ConstraintConnection cc = new ConstraintConnection(FeatureRelation.REQUIRE);
              cc.setEndDecoration(new ArrowTip());
          cf = cc;
        } else if (FeatureRelation.EXCLUDE.equals(featureRelation.getName())) {
          ConstraintConnection cc = new ConstraintConnection(FeatureRelation.EXCLUDE);
              cc.setMidDecoration(new CrossDecoration(5));
          cf = cc;
        }
       
        if (cf!=null) {
          cf.setAttribute("id" , featureRelation.getID());
          cf.startPoint(htFigures.get(featureRelation.getStartFeature().getID()).center().x , htFigures.get(featureRelation.getStartFeature().getID()).center().y);
          cf.endPoint(htFigures.get(featureRelation.getEndFeature().getID()).center().x , htFigures.get(featureRelation.getEndFeature().getID()).center().y);
          if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(featureRelation)) {
            cf.connectStart(htFigures.get(featureRelation.getStartFeature().getID()).getConnectors()[2]);
            cf.connectEnd(htFigures.get(featureRelation.getEndFeature().getID()).getConnectors()[1]);
          } else {
            cf.connectStart(htFigures.get(featureRelation.getStartFeature().getID()).getConnectors()[0]);
            cf.connectEnd(htFigures.get(featureRelation.getEndFeature().getID()).getConnectors()[0]);
          }
          dv.add(cf);
          cf.updateConnection();
         
          htFigures.put(featureRelation.getID() , cf);
          super.idToFigureMap.add(featureRelation.getID() , cf);
        }
      }
  }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

    }
   
    if (this.featureModel.getAllFeatureRelation()!=null)
      for (Iterator itRelation = this.featureModel.getAllFeatureRelation().values().iterator() ; itRelation.hasNext() ; )
      {
        FeatureRelation featureRelation = (FeatureRelation)itRelation.next();
        ConnectionFigure cf = null;
        if (FeatureRelation.ATTRIBUTE.equals(featureRelation.getName())) {
          AttributeConnection dvc = new AttributeConnection();
          cf = dvc;
        } else if (FeatureRelation.DECOMPOSE.equals(featureRelation.getName())) {
          DecomposeConnection ic = new DecomposeConnection();
          cf = ic;
        } else if (FeatureRelation.REQUIRE.equals(featureRelation.getName())) {
          ConstraintConnection cc = new ConstraintConnection(FeatureRelation.REQUIRE);
              cc.setEndDecoration(new ArrowTip());
          cf = cc;
        } else if (FeatureRelation.EXCLUDE.equals(featureRelation.getName())) {
          ConstraintConnection cc = new ConstraintConnection(FeatureRelation.EXCLUDE);
              cc.setMidDecoration(new CrossDecoration(5));
          cf = cc;
        }
       
        if (cf!=null) {
          cf.setAttribute("id" , featureRelation.getID());
          cf.startPoint(htFigures.get(featureRelation.getStartFeature().getID()).center().x , htFigures.get(featureRelation.getStartFeature().getID()).center().y);
          cf.endPoint(htFigures.get(featureRelation.getEndFeature().getID()).center().x , htFigures.get(featureRelation.getEndFeature().getID()).center().y);
          if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(featureRelation)) {
            cf.connectStart(htFigures.get(featureRelation.getStartFeature().getID()).getConnectors()[2]);
            cf.connectEnd(htFigures.get(featureRelation.getEndFeature().getID()).getConnectors()[1]);
          } else {
            cf.connectStart(htFigures.get(featureRelation.getStartFeature().getID()).getConnectors()[0]);
            cf.connectEnd(htFigures.get(featureRelation.getEndFeature().getID()).getConnectors()[0]);
          }
          dv.add(cf);
          cf.updateConnection();
         
          htFigures.put(featureRelation.getID() , cf);
          super.idToFigureMap.add(featureRelation.getID() , cf);
        }
      }
  }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

   
    for (Iterator<FeatureLayout> itFeatureLayout = this.featureLayouts.values().iterator() ; itFeatureLayout.hasNext() ; ) {
      Feature feature = itFeatureLayout.next().feature;
      if (feature.getAllRelatedRelation()!=null)
        for (Iterator<FeatureRelation> itFeatureRelation = (Iterator<FeatureRelation>)feature.getAllRelatedRelation().iterator() ; itFeatureRelation.hasNext() ; ) {
          FeatureRelation relation = itFeatureRelation.next();
          if (de.FeatureModellingTool.Pattern.ConstantDefinition.isStructRelation(relation)
              && relation.getStartFeature().getID().equals(feature.getID()))
            this.featureLayouts.get(relation.getEndFeature().getID()).parentFeature = feature;
        }
    }
   
    int rowIndex = 0;
    for (Iterator<FeatureLayout> itFeatureLayout = this.featureLayouts.values().iterator() ; itFeatureLayout.hasNext() ; ) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.