예제 #1
0
  // end declare accessors
  public static void checkClassConsistency(ModelRoot modelRoot) {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "GraphNode", //$NON-NLS-1$
        " Operation entered: GraphNode::checkClassConsistency"); //$NON-NLS-1$
    if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == false) { // $NON-NLS-1$
      return;
    }
    Graphnode_c[] objs = Graphnode_c.GraphnodeInstances(modelRoot, null, false);

    for (int i = 0; i < objs.length; i++) {
      objs[i].checkConsistency();
    }
  }
예제 #2
0
  public void relateAcrossR301To(Graphelement_c target, boolean notifyChanges) {
    if (target == null) return;

    if (target == IsSupertypeGraphelement) return; // already related

    if (IsSupertypeGraphelement != target) {

      Object oldKey = getInstanceKey();

      if (IsSupertypeGraphelement != null) {

        IsSupertypeGraphelement.clearBackPointerR301To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofgraphics.log.println(
              ILogger.CONSISTENCY,
              "Graphnode_c.relateAcrossR301To(Graphelement_c target)",
              "Relate performed across R301 from GraphNode to GraphElement without unrelate of prior instance.");
        }
      }

      IsSupertypeGraphelement = target;
      if (IdAssigner.NULL_UUID.equals(target.getElementid())) {
        // do not update cached value
      } else {
        // update cached value
        m_elementid = target.getElementidCachedValue();
      }
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR301To(this);
      target.addRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "301", "");
        Ooaofgraphics.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
예제 #3
0
  public boolean checkConsistency() {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "GraphNode", //$NON-NLS-1$
        " Operation entered: GraphNode::checkConsistency"); //$NON-NLS-1$
    if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == false) { // $NON-NLS-1$
      return true;
    }
    ModelRoot modelRoot = getModelRoot();
    boolean retval = true;
    class Graphnode_c_test21773_c implements ClassQueryInterface_c {
      Graphnode_c_test21773_c(java.util.UUID p21774) {
        m_p21774 = p21774;
      }

      private java.util.UUID m_p21774;

      public boolean evaluate(Object candidate) {
        Graphnode_c selected = (Graphnode_c) candidate;
        boolean retval = false;
        retval = (selected.getElementid().equals(m_p21774));
        return retval;
      }
    }

    Graphnode_c[] objs21772 =
        Graphnode_c.GraphnodeInstances(modelRoot, new Graphnode_c_test21773_c(getElementid()));

    if (((objs21772.length) == 0)) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(
            ILogger.CONSISTENCY,
            "GraphNode", //$NON-NLS-1$
            "Consistency: Object: GraphNode: Cardinality of an identifier is zero. " //$NON-NLS-1$
                + "Actual Value: "
                + Integer.toString(objs21772.length)); // $NON-NLS-1$
      } else {
        Exception e = new Exception();
        CanvasPlugin.logError(
            "Consistency: Object: GraphNode: Cardinality of an identifier is zero. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs21772.length),
            e);
      }
      retval = false;
    }

    if (((objs21772.length) > 1)) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(
            ILogger.CONSISTENCY,
            "GraphNode", //$NON-NLS-1$
            "Consistency: Object: GraphNode: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs21772.length)
                + " elementId: "
                + "Not Printable"); //$NON-NLS-1$
      } else {
        Exception e = new Exception();
        CanvasPlugin.logError(
            "Consistency: Object: GraphNode: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs21772.length)
                + " elementId: "
                + "Not Printable",
            e); //$NON-NLS-1$
      }
      retval = false;
    }

    // GraphNode is a subtype in association: rel.Numb = 301
    // The supertype class is: GraphElement
    class Graphelement_c_test21778_c implements ClassQueryInterface_c {
      Graphelement_c_test21778_c(java.util.UUID p21779) {
        m_p21779 = p21779;
      }

      private java.util.UUID m_p21779;

      public boolean evaluate(Object candidate) {
        Graphelement_c selected = (Graphelement_c) candidate;
        boolean retval = false;
        retval = (selected.getElementid().equals(m_p21779));
        return retval;
      }
    }

    Graphelement_c[] objs21777 =
        Graphelement_c.GraphelementInstances(
            modelRoot, new Graphelement_c_test21778_c(getElementid()));

    if (((objs21777.length) != 1)) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(
            ILogger.CONSISTENCY,
            "GraphNode", //$NON-NLS-1$
            "Consistency: Object: GraphNode: Association: 301: Cardinality of a supertype is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: "
                + Integer.toString(objs21777.length)); // $NON-NLS-1$
      } else {
        Exception e = new Exception();
        CanvasPlugin.logError(
            "Consistency: Object: GraphNode: Association: 301: Cardinality of a supertype is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs21777.length),
            e);
      }
      retval = false;
    }

    // Supertype: rel.Numb = 19
    int objs21780 = 0;
    // Subtype Object: Shape
    class Shape_c_test21781_c implements ClassQueryInterface_c {
      Shape_c_test21781_c(java.util.UUID p21782) {
        m_p21782 = p21782;
      }

      private java.util.UUID m_p21782;

      public boolean evaluate(Object candidate) {
        Shape_c selected = (Shape_c) candidate;
        boolean retval = false;
        retval = (selected.getElementid().equals(m_p21782));
        return retval;
      }
    }

    Shape_c[] objs21783 =
        Shape_c.ShapeInstances(modelRoot, new Shape_c_test21781_c(getElementid()));

    objs21780 = objs21780 + objs21783.length;
    // Subtype Object: Floating Text
    class FloatingText_c_test21784_c implements ClassQueryInterface_c {
      FloatingText_c_test21784_c(java.util.UUID p21785) {
        m_p21785 = p21785;
      }

      private java.util.UUID m_p21785;

      public boolean evaluate(Object candidate) {
        FloatingText_c selected = (FloatingText_c) candidate;
        boolean retval = false;
        retval = (selected.getElementid().equals(m_p21785));
        return retval;
      }
    }

    FloatingText_c[] objs21786 =
        FloatingText_c.FloatingTextInstances(
            modelRoot, new FloatingText_c_test21784_c(getElementid()));

    objs21780 = objs21780 + objs21786.length;
    if (objs21780 != 1) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(
            ILogger.CONSISTENCY,
            "GraphNode", //$NON-NLS-1$
            "Consistency: Object: GraphNode: Association: 19: Cardinality of subtype is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: "
                + Integer.toString(objs21780)); // $NON-NLS-1$
      } else {
        Exception e = new Exception();
        CanvasPlugin.logError(
            "Consistency: Object: GraphNode: Association: 19: Cardinality of subtype is not equal to 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs21780),
            e);
      }
      retval = false;
    }

    return retval;
  }
예제 #4
0
  public boolean checkConsistency() {
    Ooaofooa.log.println(
        ILogger.OPERATION,
        "Element In Move", //$NON-NLS-1$
        " Operation entered: Element In Move::checkConsistency"); //$NON-NLS-1$
    if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == false) { // $NON-NLS-1$
      return true;
    }
    ModelRoot modelRoot = getModelRoot();
    boolean retval = true;
    class ElementInMove_c_test22330_c implements ClassQueryInterface_c {
      ElementInMove_c_test22330_c(java.util.UUID p22331, java.util.UUID p22332) {
        m_p22331 = p22331;
        m_p22332 = p22332;
      }

      private java.util.UUID m_p22331;
      private java.util.UUID m_p22332;

      public boolean evaluate(Object candidate) {
        ElementInMove_c selected = (ElementInMove_c) candidate;
        boolean retval = false;
        retval =
            (selected.getElementid().equals(m_p22331)) & (selected.getDiagramid().equals(m_p22332));
        return retval;
      }
    }

    ElementInMove_c[] objs22329 =
        ElementInMove_c.ElementInMoveInstances(
            modelRoot, new ElementInMove_c_test22330_c(getElementid(), getDiagramid()));

    if (((objs22329.length) == 0)) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(
            ILogger.CONSISTENCY,
            "Element In Move", //$NON-NLS-1$
            "Consistency: Object: Element In Move: Cardinality of an identifier is zero. " //$NON-NLS-1$
                + "Actual Value: "
                + Integer.toString(objs22329.length)); // $NON-NLS-1$
      } else {
        Exception e = new Exception();
        CanvasPlugin.logError(
            "Consistency: Object: Element In Move: Cardinality of an identifier is zero. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs22329.length),
            e);
      }
      retval = false;
    }

    if (((objs22329.length) > 1)) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(
            ILogger.CONSISTENCY,
            "Element In Move", //$NON-NLS-1$
            "Consistency: Object: Element In Move: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs22329.length)
                + " elementId: "
                + "Not Printable"
                + " diagramId: "
                + "Not Printable"); //$NON-NLS-1$
      } else {
        Exception e = new Exception();
        CanvasPlugin.logError(
            "Consistency: Object: Element In Move: Cardinality of an identifier is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs22329.length)
                + " elementId: "
                + "Not Printable"
                + " diagramId: "
                + "Not Printable",
            e); //$NON-NLS-1$
      }
      retval = false;
    }

    // Element In Move is a link class in association: rel.Numb = 25
    // Other side
    // The other side class in the association is: Model
    class Model_c_test22336_c implements ClassQueryInterface_c {
      Model_c_test22336_c(java.util.UUID p22337) {
        m_p22337 = p22337;
      }

      private java.util.UUID m_p22337;

      public boolean evaluate(Object candidate) {
        Model_c selected = (Model_c) candidate;
        boolean retval = false;
        retval = (selected.getDiagramid().equals(m_p22337));
        return retval;
      }
    }

    Model_c[] objs22335 =
        Model_c.ModelInstances(modelRoot, new Model_c_test22336_c(getDiagramid()));

    if (((objs22335.length) > 1)) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(
            ILogger.CONSISTENCY,
            "Element In Move", //$NON-NLS-1$
            "Consistency: Object: Element In Move: Association: 25: Cardinality of other side of link is greater than 1. " //$NON-NLS-1$
                + "Actual Value: "
                + Integer.toString(objs22335.length)); // $NON-NLS-1$
      } else {
        Exception e = new Exception();
        CanvasPlugin.logError(
            "Consistency: Object: Element In Move: Association: 25: Cardinality of other side of link is greater than 1. " //$NON-NLS-1$
                + "Actual Value: " //$NON-NLS-1$
                + Integer.toString(objs22335.length),
            e);
      }
      retval = false;
    }

    return retval;
  }