Examples of FeatureRelation


Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

   
    constraints.clear();
    constraints.addAll(featureModel.getAllFeatureRelation().values());
    for (Iterator<FeatureRelation> itRelation = constraints.iterator()
        ; itRelation.hasNext() ; ) {
      FeatureRelation relation = itRelation.next();
      if (hsSubFeatureIDs.contains(relation.getStartFeature().getID())
          || hsSubFeatureIDs.contains(relation.getEndFeature().getID())) {
        featureModelEditor.removeRelation(relation.getID());
      }
    }
   
    constraints.clear();
    constraints.addAll(constraintModel.getAllCFRelation().values());
    for (Iterator<CFRelation> itRelation = constraints.iterator()
        ; itRelation.hasNext() ; ) {
      CFRelation relation = itRelation.next();
      if (hsSubFeatureIDs.contains(relation.getFeature())) {
        constraintModelEditor.removeCFRelation(relation.getID());
      }
    }
   
   
   
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

      figureMap.put(newFeature.getID() , figDist);
    }
   
    for (Iterator<FeatureRelation> itRelation=fmSrc.getAllFeatureRelation().values().iterator()
        ; itRelation.hasNext() ; ) {
      FeatureRelation relation = itRelation.next();
      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();
      }
    }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

      figureMap.put(newFeature.getID() , figDist);
    }
   
    for (Iterator<FeatureRelation> itRelation=fmSrc.getAllFeatureRelation().values().iterator()
        ; 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();
      }
    }
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

                        //grandParent.remove(parent);
                        treeTableModel.removeNodeFromParent(parent);
                    }
                } else if (propertyName.equals(FeatureModelProperties.RELATION_ADDED)) {
                    //--��������˾�����ϵ����endNode��ΪstartNode�����ӽڵ㣬�м���Ϲ�ϵ�ڵ�
                    FeatureRelation fr = (FeatureRelation) evt.getNewValue();
                    String relationName = fr.getName();

                    if (refineRelation.containsKey(relationName)) {
                        Feature start = fr.getStartFeature();
                        Feature end = fr.getEndFeature();
                        FeatureNode startNode = getTreeNode(root, start);
                        FeatureNode endNode = getTreeNode(root, end);

                        if (relationName.equals(FeatureRelation.DECOMPOSE)) {
                            FeatureNode compNode = startNode.getCompositionNode();
                            if (compNode == null) {
                                compNode = new FeatureNode(context, FeatureNode.NODE_TYPE_COMPOSITION);
                                //startNode.add(compNode);
                                treeTableModel.insertNodeInto(compNode, startNode, startNode.getChildCount());
                            }
                            //compNode.add(endNode);
                            treeTableModel.removeNodeFromParent(endNode);
                            treeTableModel.insertNodeInto(endNode, compNode, compNode.getChildCount());
                        } else if (relationName.equals(FeatureRelation.ATTRIBUTE)) {
                            FeatureNode compNode = startNode.getCharacterizationNode();
                            if (compNode == null) {
                                compNode = new FeatureNode(context, FeatureNode.NODE_TYPE_CHARACTERIZATION);
                                //startNode.add(compNode);
                                treeTableModel.insertNodeInto(compNode, startNode, startNode.getChildCount());
                            }
                            //compNode.add(endNode);
                            treeTableModel.removeNodeFromParent(endNode);
                            treeTableModel.insertNodeInto(endNode, compNode, compNode.getChildCount());
                        }
                    }
                } else if (propertyName.equals(FeatureModelProperties.RELATION_REMOVED)) {
                    //--���ɾ���˾�����ϵ����endNode��Ϊroot, ���endNode�ĸ��ڵ�(��ϵ�ڵ㣩û�������ӽڵ��ˣ���ɾ��endNode�ĸ��ڵ�
                    FeatureRelation fr = (FeatureRelation) evt.getOldValue();
                    String relationName = fr.getName();

                    if (refineRelation.containsKey(relationName)) {
                        Feature start = fr.getStartFeature();
                        Feature end = fr.getEndFeature();
                        FeatureNode startNode = getTreeNode(root, start);
                        FeatureNode endNode = getTreeNode(root, end);
                        FeatureNode relationNode = (FeatureNode) endNode.getParent();

                        //root.add(endNode);
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

    }

    private static void collectSubFeatureIDs(Feature feature, HashSet<String> hsSubFeatureIDs) {
        hsSubFeatureIDs.add(feature.getID());
        for (Iterator<FeatureRelation> itRelation = (Iterator<FeatureRelation>) feature.getAllRelatedRelation().iterator(); itRelation.hasNext();) {
            FeatureRelation relation = itRelation.next();
            if (ConstantDefinition.isStructRelation(relation) && relation.getStartFeature().getID().equals(feature.getID()) && !hsSubFeatureIDs.contains(relation.getEndFeature().getID())) {
                collectSubFeatureIDs(relation.getEndFeature(), hsSubFeatureIDs);
            }
        }
    }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

        Set constraints = new HashSet();

        constraints.clear();
        constraints.addAll(featureModel.getAllFeatureRelation().values());
        for (Iterator<FeatureRelation> itRelation = constraints.iterator(); itRelation.hasNext();) {
            FeatureRelation relation = itRelation.next();
            if (!htNameMap.containsKey(relation.getID())) {
                Feature start = featureModel.getFeature(htNameMap.get(relation.getStartFeature().getID()));
                Feature end = featureModel.getFeature(htNameMap.get(relation.getEndFeature().getID()));
                if (start != null || end != null) {
                    if (start == null) {
                        start = relation.getStartFeature();
                    }
                    if (end == null) {
                        end = relation.getEndFeature();
                    }
                    FeatureRelation newRelation = featureModelEditor.addRelation(relation.getName(), start, end);
                    htNameMap.put(relation.getID(), newRelation.getID());
                }
            }
        }

        constraints.clear();
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

        featureEditor.setCategory(newFeature, feature.getCategory());
        featureEditor.setDescription(newFeature, feature.getDescription());
        featureEditor.setVariability(newFeature, feature.getVariability());

        for (Iterator<FeatureRelation> itRelation = feature.getAllRelatedRelation().iterator(); itRelation.hasNext();) {
            FeatureRelation relation = itRelation.next();
            if (ConstantDefinition.isStructRelation(relation) && relation.getStartFeature().getID().equals(feature.getID())) {
                cloneFeatureTree(relation.getEndFeature(), featureEditor, featureModel, featureModelEditor, htNameMap, hsSubFeatureIDs);
            }
        }
    }
View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

        Set constraints = new HashSet();

        constraints.clear();
        constraints.addAll(featureModel.getAllFeatureRelation().values());
        for (Iterator<FeatureRelation> itRelation = constraints.iterator(); itRelation.hasNext();) {
            FeatureRelation relation = itRelation.next();
            if (hsSubFeatureIDs.contains(relation.getStartFeature().getID()) || hsSubFeatureIDs.contains(relation.getEndFeature().getID())) {
                featureModelEditor.removeRelation(relation.getID());
            }
        }

        constraints.clear();
        constraints.addAll(constraintModel.getAllCFRelation().values());
        for (Iterator<CFRelation> itRelation = constraints.iterator(); itRelation.hasNext();) {
            CFRelation relation = itRelation.next();
            if (hsSubFeatureIDs.contains(relation.getFeature())) {
                constraintModelEditor.removeCFRelation(relation.getID());
            }
        }


View Full Code Here

Examples of de.FeatureModellingTool.FeatureModel.FeatureRelation

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

        for (Iterator<FeatureRelation> itRelation = fmSrc.getAllFeatureRelation().values().iterator(); itRelation.hasNext();) {
            FeatureRelation relation = itRelation.next();
            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();
            }
        }
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.