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); } } }
// declare transform functions public void Dispose() { Ooaofgraphics.log.println( ILogger.OPERATION, "GraphNode", " Operation entered: Graphnode::Dispose"); final ModelRoot modelRoot = getModelRoot(); Graphelement_c v_element = Graphelement_c.getOneDIM_GEOnR301(this); if (((v_element != null))) { if (v_element != null) { v_element.Dispose(); } else { Throwable t = new Throwable(); t.fillInStackTrace(); CorePlugin.logError("Attempted to call an operation on a null instance.", t); } } else { Shape_c v_shape = Shape_c.getOneGD_SHPOnR19(this); if (((v_shape != null))) { this.unrelateAcrossR19From(v_shape); if (v_shape != null) { v_shape.Dispose(); } else { Throwable t = new Throwable(); t.fillInStackTrace(); CorePlugin.logError("Attempted to call an operation on a null instance.", t); } } FloatingText_c v_ctxt = FloatingText_c.getOneGD_CTXTOnR19(this); if (((v_ctxt != null))) { this.unrelateAcrossR19From(v_ctxt); if (v_ctxt != null) { v_ctxt.Dispose(); } else { Throwable t = new Throwable(); t.fillInStackTrace(); CorePlugin.logError("Attempted to call an operation on a null instance.", t); } } if (delete()) { Ooaofgraphics.getDefaultInstance() .fireModelElementDeleted( new BaseModelDelta(Modeleventnotification_c.DELTA_DELETE, this)); } } } // End dispose
public void setHeight(float newValue) { if (m_height == newValue) { return; } AttributeChangeModelDelta change = new AttributeChangeModelDelta( Modeleventnotification_c.DELTA_ATTRIBUTE_CHANGE, this, "Height", new Float(m_height), new Float(newValue), true); m_height = newValue; Ooaofgraphics.getDefaultInstance().fireModelElementAttributeChanged(change); }
public void setStartingy(float newValue) { if (m_startingy == newValue) { return; } AttributeChangeModelDelta change = new AttributeChangeModelDelta( Modeleventnotification_c.DELTA_ATTRIBUTE_CHANGE, this, "Startingy", new Float(m_startingy), new Float(newValue), false); m_startingy = newValue; Ooaofgraphics.getDefaultInstance().fireModelElementAttributeChanged(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 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); } } }
public void setElementid(java.util.UUID newValue) { if (newValue != null) { if (newValue.equals(m_elementid)) { return; } } else if (m_elementid != null) { if (m_elementid.equals(newValue)) { return; } } else { return; } AttributeChangeModelDelta change = new AttributeChangeModelDelta( Modeleventnotification_c.DELTA_ATTRIBUTE_CHANGE, this, "Elementid", m_elementid, newValue, true); m_elementid = IdAssigner.preprocessUUID(newValue); Ooaofgraphics.getDefaultInstance().fireModelElementAttributeChanged(change); }