コード例 #1
0
  public boolean delete() {
    boolean result = super.delete();
    boolean delete_error = false;
    String errorMsg =
        "The following relationships were not torn down by the GraphNode.dispose call: ";
    Graphelement_c testR301Inst1 = Graphelement_c.getOneDIM_GEOnR301(this, false);

    if (testR301Inst1 != null) {
      delete_error = true;
      errorMsg = errorMsg + "301 ";
    }
    Shape_c testR19Inst1 = Shape_c.getOneGD_SHPOnR19(this, false);

    if (testR19Inst1 != null) {
      delete_error = true;
      errorMsg = errorMsg + "19 ";
    }
    FloatingText_c testR19Inst2 = FloatingText_c.getOneGD_CTXTOnR19(this, false);

    if (testR19Inst2 != null) {
      delete_error = true;
      errorMsg = errorMsg + "19 ";
    }
    if (delete_error == true) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(ILogger.DELETE, "GraphNode", errorMsg);
      } else {
        Exception e = new Exception();
        e.fillInStackTrace();
        CanvasPlugin.logError(errorMsg, e);
      }
    }
    return result;
  }
コード例 #2
0
  public boolean delete() {
    boolean result = super.delete();
    boolean delete_error = false;
    String errorMsg =
        "The following relationships were not torn down by the Element In Move.dispose call: ";
    GraphicalElement_c testR25Inst = GraphicalElement_c.getOneGD_GEOnR25(this, false);

    if (testR25Inst != null) {
      delete_error = true;
      errorMsg = errorMsg + "25 ";
    }

    Model_c testR25InstOth = Model_c.getOneGD_MDOnR25(this, false);

    if (testR25InstOth != null) {
      delete_error = true;
      errorMsg = errorMsg + "25 ";
    }
    if (delete_error == true) {

      if (CanvasPlugin.getDefault().isDebugging()) {
        Ooaofgraphics.log.println(ILogger.DELETE, "Element In Move", errorMsg);
      } else {
        Exception e = new Exception();
        e.fillInStackTrace();
        CanvasPlugin.logError(errorMsg, e);
      }
    }
    return result;
  }
コード例 #3
0
  public void unrelateAcrossR301From(Graphelement_c target, boolean notifyChanges) {
    if (target == null) return;

    if (IsSupertypeGraphelement == null) return; // already unrelated

    if (target != IsSupertypeGraphelement) {
      Exception e = new Exception();
      e.fillInStackTrace();
      CanvasPlugin.logError("Tried to unrelate from non-related instance across R301", e);
      return;
    }

    if (target != null) {
      target.clearBackPointerR301To(this);
    }

    if (IsSupertypeGraphelement != null) {

      m_elementid = IsSupertypeGraphelement.getElementid();
      if (IdAssigner.NULL_UUID.equals(m_elementid)) {
        m_elementid = IsSupertypeGraphelement.getElementidCachedValue();
      }
      IsSupertypeGraphelement = null;
      target.removeRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_UNRELATED, this, target, "301", "");
        Ooaofgraphics.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
コード例 #4
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;
  }
コード例 #5
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;
  }