public void unrelateAcrossR25From(GraphicalElement_c target, boolean notifyChanges) {
    if (target == null) return;

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

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

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

    if (IsMovingGraphicalElement != null) {

      m_elementid = IsMovingGraphicalElement.getElementid();
      if (IdAssigner.NULL_UUID.equals(m_elementid)) {
        m_elementid = IsMovingGraphicalElement.getElementidCachedValue();
      }
      IsMovingGraphicalElement = null;
      target.removeRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_UNRELATED, this, target, "25", "");
        Ooaofgraphics.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
  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;
  }
 public static ElementInMove_c getOneGD_EIMOnR25(
     GraphicalElement_c target, ClassQueryInterface_c test) {
   if (target != null) {
     return getOneGD_EIMOnR25(target.getModelRoot(), target, test);
   }
   return null;
 }
  public void batchRelate(
      ModelRoot modelRoot, boolean relateProxies, boolean notifyChanges, boolean searchAllRoots) {
    InstanceList instances = null;
    ModelRoot baseRoot = modelRoot;

    // R25
    Model_c relInst22327 =
        (Model_c) baseRoot.getInstanceList(Model_c.class).get(new Object[] {m_diagramid});
    // if there was no local element, check for any global elements
    // failing that proceed to check other model roots
    if (relInst22327 == null) {
      relInst22327 =
          (Model_c)
              Ooaofooa.getDefaultInstance()
                  .getInstanceList(Model_c.class)
                  .get(new Object[] {m_diagramid});
    }
    // synchronized
    if (relInst22327 != null) {
      if (relateProxies || !isProxy() || (inSameComponent(this, relInst22327) && !isProxy())) {
        relInst22327.relateAcrossR25To(this, notifyChanges);
      }
    }

    GraphicalElement_c relInst22328 =
        (GraphicalElement_c)
            baseRoot.getInstanceList(GraphicalElement_c.class).get(new Object[] {m_elementid});
    // if there was no local element, check for any global elements
    // failing that proceed to check other model roots
    if (relInst22328 == null) {
      relInst22328 =
          (GraphicalElement_c)
              Ooaofooa.getDefaultInstance()
                  .getInstanceList(GraphicalElement_c.class)
                  .get(new Object[] {m_elementid});
    }
    // synchronized
    if (relInst22328 != null) {
      if (relateProxies || !isProxy() || (inSameComponent(this, relInst22328) && !isProxy())) {
        relInst22328.relateAcrossR25To(this, notifyChanges);
      }
    }
  }
  public void relateAcrossR25To(GraphicalElement_c target, boolean notifyChanges) {
    if (target == null) return;

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

    if (IsMovingGraphicalElement != target) {

      Object oldKey = getInstanceKey();

      if (IsMovingGraphicalElement != null) {

        IsMovingGraphicalElement.clearBackPointerR25To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofgraphics.log.println(
              ILogger.CONSISTENCY,
              "ElementInMove_c.relateAcrossR25To(GraphicalElement_c target)",
              "Relate performed across R25 from Element In Move to Graphical Element without unrelate of prior instance.");
        }
      }

      IsMovingGraphicalElement = 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.setBackPointerR25To(this);
      target.addRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "25", "");
        Ooaofgraphics.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
  // declare transform functions
  public void Dispose() {
    Ooaofgraphics.log.println(
        ILogger.OPERATION, "Element In Move", " Operation entered: ElementInMove::Dispose");
    final ModelRoot modelRoot = getModelRoot();
    GraphicalElement_c v_elem = GraphicalElement_c.getOneGD_GEOnR25(this);

    Model_c v_model = Model_c.getOneGD_MDOnR25(this);

    unrelateAcrossR25From(v_model);
    unrelateAcrossR25From(v_elem);

    if (delete()) {
      Ooaofgraphics.getDefaultInstance()
          .fireModelElementDeleted(new BaseModelDelta(Modeleventnotification_c.DELTA_DELETE, this));
    }
  } // End dispose
 public java.util.UUID getElementid() {
   if (IsMovingGraphicalElement != null) {
     return IsMovingGraphicalElement.getElementid();
   }
   return IdAssigner.NULL_UUID;
 }
 // declare attribute accessors
 public long getElementidLongBased() {
   if (IsMovingGraphicalElement != null) {
     return IsMovingGraphicalElement.getElementidLongBased();
   }
   return 0;
 }
 public static ElementInMove_c getOneGD_EIMOnR25(
     GraphicalElement_c target, boolean loadComponent) {
   return getOneGD_EIMOnR25(target.getModelRoot(), target, null, loadComponent);
 }