From: <mcu...@us...> - 2007-08-08 00:31:32
|
Revision: 1078 http://orm.svn.sourceforge.net/orm/?rev=1078&view=rev Author: mcurland Date: 2007-08-07 17:31:35 -0700 (Tue, 07 Aug 2007) Log Message: ----------- Adding internal uniqueness constraints (and a number of other shape actions) after a file reload caused the FactTypeShape to lose its center-of-rolesbox anchor point. Added fixup listener to reset the RolesPosition property. refs #218 Modified Paths: -------------- trunk/ORMModel/ObjectModel/ORMModel.cs trunk/ORMModel/ShapeModel/FactTypeShape.cs trunk/ORMModel/ShapeModel/GeneratedCode/Shapes.cs trunk/ORMModel/ShapeModel/ORMShape.DeserializationFixupListeners.cs trunk/ORMModel/ShapeModel/ORMShape.dsl Modified: trunk/ORMModel/ObjectModel/ORMModel.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMModel.cs 2007-08-08 00:27:57 UTC (rev 1077) +++ trunk/ORMModel/ObjectModel/ORMModel.cs 2007-08-08 00:31:35 UTC (rev 1078) @@ -62,10 +62,14 @@ /// </summary> ValidateErrors = 500, /// <summary> + /// Fixup stored presentation elements + /// </summary> + ModifyStoredPresentationElements = 700, + /// <summary> /// Add any presentation elements that are implicit and not /// serialized with the model. /// </summary> - AddImplicitPresentationElements = 600, + AddImplicitPresentationElements = 700, } #endregion // ORMDeserializationFixupPhase enum public partial class ORMModel Modified: trunk/ORMModel/ShapeModel/FactTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/FactTypeShape.cs 2007-08-08 00:27:57 UTC (rev 1077) +++ trunk/ORMModel/ShapeModel/FactTypeShape.cs 2007-08-08 00:31:35 UTC (rev 1078) @@ -5284,6 +5284,41 @@ } } #endregion // Derivation Rules + #region Deserialization Fixup + /// <summary> + /// Return a deserialization fixup listener. The listener + /// ensures that non-serialized information on a FactTypeShape is properly restored + /// </summary> + public static IDeserializationFixupListener FixupListener + { + get + { + return new FactTypeShapeFixupListener(); + } + } + /// <summary> + /// A listener to reset non-serialized FactTypeShape properties. + /// </summary> + private sealed class FactTypeShapeFixupListener : DeserializationFixupListener<FactTypeShape> + { + /// <summary> + /// Create a new FactTypeShapeFixupListener + /// </summary> + public FactTypeShapeFixupListener() + : base((int)ORMDeserializationFixupPhase.ModifyStoredPresentationElements) + { + } + /// <summary> + /// Update the non-serialized RolesPosition property, used to keep a FactTypeShape + /// anchored on the center of the roles box + /// </summary> + protected sealed override void ProcessElement(FactTypeShape element, Store store, INotifyElementAdded notifyAdded) + { + PointD centerPoint = RolesShape.GetBounds(element).Center; + element.RolesPosition = (element.DisplayOrientation != DisplayOrientation.Horizontal) ? centerPoint.X : centerPoint.Y; + } + } + #endregion Deserialization Fixup } #endregion // FactTypeShape class #region ObjectifiedFactTypeNameShape class Modified: trunk/ORMModel/ShapeModel/GeneratedCode/Shapes.cs =================================================================== --- trunk/ORMModel/ShapeModel/GeneratedCode/Shapes.cs 2007-08-08 00:27:57 UTC (rev 1077) +++ trunk/ORMModel/ShapeModel/GeneratedCode/Shapes.cs 2007-08-08 00:31:35 UTC (rev 1078) @@ -818,8 +818,9 @@ [DslDesign::DisplayNameResource("Neumont.Tools.ORM.ShapeModel.FactTypeShape/RolesPosition.DisplayName", typeof(global::Neumont.Tools.ORM.ShapeModel.ORMShapeDomainModel), "Neumont.Tools.ORM.GeneratedCode.ShapeDomainModelResx")] [DslDesign::DescriptionResource("Neumont.Tools.ORM.ShapeModel.FactTypeShape/RolesPosition.Description", typeof(global::Neumont.Tools.ORM.ShapeModel.ORMShapeDomainModel), "Neumont.Tools.ORM.GeneratedCode.ShapeDomainModelResx")] [global::System.ComponentModel.Browsable(false)] + [global::System.ComponentModel.ReadOnly(true)] [DslModeling::DomainObjectId("89244439-fbb1-4deb-bff3-69d47cb90a6b")] - public global::System.Double RolesPosition + private global::System.Double RolesPosition { [global::System.Diagnostics.DebuggerStepThrough] get Modified: trunk/ORMModel/ShapeModel/ORMShape.DeserializationFixupListeners.cs =================================================================== --- trunk/ORMModel/ShapeModel/ORMShape.DeserializationFixupListeners.cs 2007-08-08 00:27:57 UTC (rev 1077) +++ trunk/ORMModel/ShapeModel/ORMShape.DeserializationFixupListeners.cs 2007-08-08 00:31:35 UTC (rev 1078) @@ -39,6 +39,7 @@ yield return new DisplayRoleNameFixupListener(); yield return new DisplayUnaryFactTypeFixupListener(); yield return new DisplayModelNoteLinksFixupListener(); + yield return FactTypeShape.FixupListener; } } IEnumerable<IDeserializationFixupListener> IDeserializationFixupListenerProvider.DeserializationFixupListenerCollection Modified: trunk/ORMModel/ShapeModel/ORMShape.dsl =================================================================== --- trunk/ORMModel/ShapeModel/ORMShape.dsl 2007-08-08 00:27:57 UTC (rev 1077) +++ trunk/ORMModel/ShapeModel/ORMShape.dsl 2007-08-08 00:31:35 UTC (rev 1078) @@ -152,7 +152,7 @@ <DomainEnumerationMoniker Name="DisplayOrientation"/> </Type> </DomainProperty> - <DomainProperty Name="RolesPosition" Id="89244439-FBB1-4DEB-BFF3-69D47CB90A6B" DefaultValue="0" IsBrowsable="false"> + <DomainProperty Name="RolesPosition" Id="89244439-FBB1-4DEB-BFF3-69D47CB90A6B" DefaultValue="0" IsBrowsable="false" GetterAccessModifier="Private" SetterAccessModifier="Private"> <Type> <ExternalTypeMoniker Name="/System/Double"/> </Type> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |