public String static_classification() {
   String rule = "";
   for (RefOntoUML.Class c : this.getInstance_of()) {
     rule = rule + '\t' + this.getLabel() + " in World." + c.getName() + '\n';
   }
   return rule;
 }
Example #2
0
  public void DealClass(org.eclipse.uml2.uml.Class c1, RefOntoUML.Class c2) {
    DealClassifier(c1, c2);

    // Attributes
    RefOntoUML.Property p2;
    for (org.eclipse.uml2.uml.Property p1 : c1.getAttributes()) {
      p2 = myfactory.createProperty();
      DealProperty(p1, p2);
      c2.getOwnedAttribute().add(p2);
    }
  }
  private void deleteAttributes(List<Property> classAttributes) {
    ArrayList<Property> attributes = new ArrayList<Property>();

    if (element instanceof DataType) {
      attributes.addAll(((DataType) element).getOwnedAttribute());
      for (Property p : attributes) {
        if (!classAttributes.contains(p)) {
          ((DataType) element).getOwnedAttribute().remove(p);
          diagramManager.updateOLEDFromDeletion(p);
        }
      }
    }
    if (element instanceof RefOntoUML.Class) {
      attributes.addAll(((RefOntoUML.Class) element).getOwnedAttribute());
      for (Property p : attributes) {
        if (!classAttributes.contains(p)) {
          ((RefOntoUML.Class) element).getOwnedAttribute().remove(p);
          diagramManager.updateOLEDFromDeletion(p);
        }
      }
    }
  }