// , 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();
}