예제 #1
0
  public void unrelateAcrossR25From(Model_c target, boolean notifyChanges) {
    if (target == null) return;

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

    if (target != IsMovingInModel) {
      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 (IsMovingInModel != null) {

      m_diagramid = IsMovingInModel.getDiagramid();
      if (IdAssigner.NULL_UUID.equals(m_diagramid)) {
        m_diagramid = IsMovingInModel.getDiagramidCachedValue();
      }
      IsMovingInModel = null;
      target.removeRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_UNRELATED, this, target, "25", "");
        Ooaofgraphics.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
예제 #2
0
  public void relateAcrossR25To(Model_c target, boolean notifyChanges) {
    if (target == null) return;

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

    if (IsMovingInModel != target) {

      Object oldKey = getInstanceKey();

      if (IsMovingInModel != null) {

        IsMovingInModel.clearBackPointerR25To(this);

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

      IsMovingInModel = target;
      if (IdAssigner.NULL_UUID.equals(target.getDiagramid())) {
        // do not update cached value
      } else {
        // update cached value
        m_diagramid = target.getDiagramidCachedValue();
      }
      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);
      }
    }
  }
예제 #3
0
 public java.util.UUID getDiagramid() {
   if (IsMovingInModel != null) {
     return IsMovingInModel.getDiagramid();
   }
   return IdAssigner.NULL_UUID;
 }
예제 #4
0
 public boolean evaluate(Object candidate) {
   Model_c selected = (Model_c) candidate;
   boolean retval = false;
   retval = (selected.getDiagramid().equals(m_p22337));
   return retval;
 }