Exemple #1
0
  public void DealGeneralization(org.eclipse.uml2.uml.Generalization gen1) {
    System.out.print("[Generalization]: ");
    RefOntoUML.Generalization gen2 = myfactory.createGeneralization();

    // source (Specific)
    org.eclipse.uml2.uml.Classifier e1 = gen1.getSpecific();
    RefOntoUML.Classifier e2 = (RefOntoUML.Classifier) GetElement(e1);
    System.out.print(e1.getName() + " -> ");

    // Poderia ter setado apenas um dos dois (Generalization::Specific, Classifier::Generalization),
    // ja que sao EOpposites
    gen2.setSpecific(e2);
    // O Specific tem posse do generalization
    e2.getGeneralization().add(gen2);

    // target (General)
    e1 = gen1.getGeneral();
    e2 = (RefOntoUML.Classifier) GetElement(e1);
    System.out.println(e1.getName());

    gen2.setGeneral(e2);

    // Important for GeneralizationSet
    RelateElements(gen1, gen2);
  }
Exemple #2
0
 public void DealClassifier(org.eclipse.uml2.uml.Classifier c1, RefOntoUML.Classifier c2) {
   DealNamedElement(c1, c2);
   // Important for Generalization, Property
   RelateElements(c1, c2);
   // isAbstract
   c2.setIsAbstract(c1.isAbstract());
 }