You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(21) |
Sep
(25) |
Oct
(13) |
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(1) |
Oct
(1) |
Nov
(8) |
Dec
(3) |
2009 |
Jan
(5) |
Feb
(3) |
Mar
(10) |
Apr
(6) |
May
(3) |
Jun
(4) |
Jul
(1) |
Aug
(3) |
Sep
(5) |
Oct
(1) |
Nov
(2) |
Dec
(2) |
2010 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(1) |
May
(1) |
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(3) |
Jul
(1) |
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(4) |
Nov
(4) |
Dec
(2) |
2013 |
Jan
(1) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(1) |
Nov
(3) |
Dec
(2) |
2014 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(1) |
Jun
|
Jul
(2) |
Aug
(1) |
Sep
|
Oct
|
Nov
(2) |
Dec
(5) |
2015 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
|
Dec
|
2016 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <mcu...@us...> - 2011-11-30 07:06:53
|
Revision: 1479 http://orm.svn.sourceforge.net/orm/?rev=1479&view=rev Author: mcurland Date: 2011-11-30 07:06:47 +0000 (Wed, 30 Nov 2011) Log Message: ----------- * Do not treat value types used only be derived fact types as independent: stops table creation for value types used in fully derived fact types. * Do not display length field for Picture and OleObject data types on relational columns * Make the column data type read-only for unary fact types, changing this value invalidates the unary fact type pattern. Modified Paths: -------------- trunk/AlternateViews/RelationalView/ShapeModel/ColumnElementListCompartment.cs trunk/ORMModel/ObjectModel/ObjectType.cs trunk/RelationalModel/DcilModel/Design/ColumnTypeDescriptor.cs Modified: trunk/AlternateViews/RelationalView/ShapeModel/ColumnElementListCompartment.cs =================================================================== --- trunk/AlternateViews/RelationalView/ShapeModel/ColumnElementListCompartment.cs 2011-11-30 02:50:15 UTC (rev 1478) +++ trunk/AlternateViews/RelationalView/ShapeModel/ColumnElementListCompartment.cs 2011-11-30 07:06:47 UTC (rev 1479) @@ -283,7 +283,7 @@ } else if (dataType is RawDataDataType) { - return ((dataType is FixedLengthRawDataDataType) ? "BINARY" : ((dataType is LargeLengthRawDataDataType) ? "BLOB" : "VARBINARY")) + (precision > 0 ? "(" + precision.ToString() + ")" : null); + return ((dataType is FixedLengthRawDataDataType) ? "BINARY" : ((dataType is LargeLengthRawDataDataType) ? "BLOB" : "VARBINARY")) + ((precision > 0 && dataType.LengthName != null) ? "(" + precision.ToString() + ")" : null); } else if (dataType is TemporalDataType) { Modified: trunk/ORMModel/ObjectModel/ObjectType.cs =================================================================== --- trunk/ORMModel/ObjectModel/ObjectType.cs 2011-11-30 02:50:15 UTC (rev 1478) +++ trunk/ORMModel/ObjectModel/ObjectType.cs 2011-11-30 07:06:47 UTC (rev 1479) @@ -2610,7 +2610,9 @@ { get { - return IsIndependent || (ImpliedMandatoryConstraint == null && AllowIsIndependent(false)); + bool seenDerived; + bool seenNonDerived; + return IsIndependent || (ImpliedMandatoryConstraint == null && (AllowIsIndependent(false, out seenDerived, out seenNonDerived) && (seenNonDerived || (seenDerived && !IsValueType)))); } } /// <summary> @@ -2628,7 +2630,26 @@ /// <returns><see langword="true"/> if <see cref="IsIndependent"/> can be turned on.</returns> private bool AllowIsIndependent(bool throwIfFalse) { + bool dummy1; + bool dummy2; + return AllowIsIndependent(throwIfFalse, out dummy1, out dummy2); + } + /// <summary> + /// Test if the <see cref="IsIndependent"/> property can be set to true. + /// </summary> + /// <param name="throwIfFalse">Set to <see langword="true"/> to throw an exception instead of returning false.</param> + /// <param name="playsDerivedRole"> Set to <see langword="true"/> if the object type plays a role in a fully derived fact type. Accurate if function returns true.</param> + /// <param name="playsNonDerivedRole"> Set to <see langword="true"/> if the object type plays a role in a non-fully derived fact type. Accurate if function returns true.</param> + /// <returns><see langword="true"/> if <see cref="IsIndependent"/> can be turned on.</returns> + private bool AllowIsIndependent(bool throwIfFalse, out bool playsDerivedRole, out bool playsNonDerivedRole) + { bool retVal = true; + playsDerivedRole = false; + playsNonDerivedRole = false; + if (IsImplicitBooleanValue) + { + return false; + } LinkedElementCollection<Role> preferredIdentifierRoles = null; LinkedElementCollection<Role> playedRoles = PlayedRoleCollection; int playedRoleCount = playedRoles.Count; @@ -2648,8 +2669,10 @@ // roles on this object type can imply a mandatory on one // or more of the non-existential roles. This would be an // unusual way to model the mandatory constraint, however. + playsDerivedRole = true; continue; } + playsNonDerivedRole = true; LinkedElementCollection<ConstraintRoleSequence> constraints = playedRole.ConstraintRoleSequenceCollection; int constraintCount = constraints.Count; for (int j = 0; j < constraintCount; ++j) Modified: trunk/RelationalModel/DcilModel/Design/ColumnTypeDescriptor.cs =================================================================== --- trunk/RelationalModel/DcilModel/Design/ColumnTypeDescriptor.cs 2011-11-30 02:50:15 UTC (rev 1478) +++ trunk/RelationalModel/DcilModel/Design/ColumnTypeDescriptor.cs 2011-11-30 07:06:47 UTC (rev 1479) @@ -58,6 +58,22 @@ return base.CreatePropertyDescriptor(requestor, domainPropertyInfo, attributes); } /// <summary> + /// Disallow changing data types for columns based on unary predicates. These must remain boolean. + /// </summary> + protected override bool IsPropertyDescriptorReadOnly(ElementPropertyDescriptor propertyDescriptor) + { + Column column; + ObjectType valueType; + if (propertyDescriptor.DomainPropertyInfo.Id == Column.DataTypeDomainPropertyId && + null != (column = propertyDescriptor.ModelElement as Column) && + null != (valueType = column.AssociatedValueType) && + valueType.IsImplicitBooleanValue) + { + return true; + } + return base.IsPropertyDescriptorReadOnly(propertyDescriptor); + } + /// <summary> /// An element property descriptor that merges DataType facet properties only if the /// DataTypes of the multi-selected elements match. /// </summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2011-10-15 17:45:17
|
Revision: 1476 http://orm.svn.sourceforge.net/orm/?rev=1476&view=rev Author: mcurland Date: 2011-10-15 17:45:11 +0000 (Sat, 15 Oct 2011) Log Message: ----------- Updated version and readme to October 2011 CTP refs #193 Modified Paths: -------------- trunk/Setup/Readme.htm trunk/VersionGenerator.exe.config Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2011-10-13 04:43:38 UTC (rev 1475) +++ trunk/Setup/Readme.htm 2011-10-15 17:45:11 UTC (rev 1476) @@ -3,7 +3,7 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> -<title>NORMA June 2011 CTP Readme</title> +<title>NORMA October 2011 CTP Readme</title> <style type="text/css"> .new {font-size:x-small; background-color:Gold; color:Blue; } li {padding-bottom: 3px;} @@ -12,8 +12,9 @@ <body> -<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA June 2011 CTP Readme</a> </b></p> +<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA October 2011 CTP Readme</a> </b></p> <p>This file supersedes the previous readme.txt and older readme.htm files. This readme has parallel indexing mechanisms: by topic, and by release date (starting with the October 2008 (2008-10) release). The file will be extended for future product releases.<br/><br/> +The October 2011 release is a bug fix release. Refer to June 2011 for newer features.<br/><br/> The June 2011 release includes new display features (display objectified fact types as object types, display link fact types), additional ring types with an improved editor for choosing ring types, visible zoom commands, and a number of bug fixes. See detailed change notes below for specifics. <br/><br/></p> <h2>Contents</h2> @@ -43,8 +44,27 @@ </ul>--> <hr/> +<h2>October 2011 CTP Changes</h2> +<div>The October 2011 CTP release includes all modifications through changeset 1476. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<ul> +<li>Features: +<ol> +<li>A mouse hover on the glyphs in the ring type editor shows a standard verbalization describing that ring type.</li> +</ol> +</li> +<li>Bug Fixes: +<ol> +<li>Objectified fact type shapes displayed as object types did not reconnect role players when a file was reloaded.</li> +<li>Fixed some ring type combination implications in the ring type editor.</li> +<li>Zoom and Extension Manager commands were not available with multiple items selected.</li> +<li>(VS2010) Changing generation settings for a specific file format wrote multiple conflicting lines to the project file. Only the original setting was recognized by the generator.</li> +</ol> +</li> +</ul> + +<hr/> <h2>June 2011 CTP Changes</h2> -<div>The June 2011 CTP release includes all modifications through changeset 1473. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The June 2011 CTP release includes all modifications through changeset 1473.</div> <ul> <li><a href="#DisplayAsObjectType 2011-06">Display Objectified Fact Type as Object Type</a> </li> <li><a href="#LinkFactTypeDisplay 2011-06">Link Fact Type Display</a> </li> Modified: trunk/VersionGenerator.exe.config =================================================================== --- trunk/VersionGenerator.exe.config 2011-10-13 04:43:38 UTC (rev 1475) +++ trunk/VersionGenerator.exe.config 2011-10-15 17:45:11 UTC (rev 1476) @@ -2,7 +2,7 @@ <configuration> <appSettings> <add key="RevisionStartYearMonth" value="2006-01"/> - <add key="ReleaseYearMonth" value="2011-06"/> + <add key="ReleaseYearMonth" value="2011-10"/> <add key="CountQuartersFromYearMonth" value="2011-01"/> <!-- ReleaseType: "CTP" or "RTM" --> <add key="ReleaseType" value="CTP"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2011-10-13 04:43:45
|
Revision: 1475 http://orm.svn.sourceforge.net/orm/?rev=1475&view=rev Author: mcurland Date: 2011-10-13 04:43:38 +0000 (Thu, 13 Oct 2011) Log Message: ----------- Bug fixes: * Zoom and Extension Manager commands are not available in some multi select states, add to list of commands that support multiple selections. * VS2010 ORMCustomTool adds duplicate ORMGenerator entries in project file. ProjectItemElement.SetMetadata adds a new item instead of modifying the existing one. Explicitly delete existing elements and use AddMetadata to replace. Modified Paths: -------------- trunk/ORMModel/Shell/ORMDesignerCommandManager.cs trunk/Tools/ORMCustomTool/UI/MainBranch.cs Modified: trunk/ORMModel/Shell/ORMDesignerCommandManager.cs =================================================================== --- trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2011-07-27 17:34:59 UTC (rev 1474) +++ trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2011-10-13 04:43:38 UTC (rev 1475) @@ -359,6 +359,8 @@ private const ORMDesignerCommands EnabledSimpleMultiSelectCommandFilter = ORMDesignerCommands.DisplayStandardWindows | ORMDesignerCommands.CopyImage | + ORMDesignerCommands.ExtensionManager | + ORMDesignerCommands.Zoom | ORMDesignerCommands.DisplayOrientation | ORMDesignerCommands.DisplayConstraintsPosition | ORMDesignerCommands.ExclusiveOrDecoupler | @@ -1042,6 +1044,7 @@ } } // Turn on standard commands for all selections + // Consider adding anything here to the EnabledSimpleMultiSelectCommandFilter above visibleCommands |= ORMDesignerCommands.DisplayStandardWindows | ORMDesignerCommands.CopyImage | ORMDesignerCommands.SelectAll | ORMDesignerCommands.ExtensionManager | ORMDesignerCommands.ErrorList | ORMDesignerCommands.ReportGeneratorList | ORMDesignerCommands.FreeFormCommandList | ORMDesignerCommands.SelectInModelBrowser | ORMDesignerCommands.Zoom; enabledCommands |= ORMDesignerCommands.DisplayStandardWindows | ORMDesignerCommands.CopyImage | ORMDesignerCommands.SelectAll | ORMDesignerCommands.ExtensionManager | ORMDesignerCommands.ErrorList | ORMDesignerCommands.ReportGeneratorList | ORMDesignerCommands.FreeFormCommandList | ORMDesignerCommands.SelectInModelBrowser | ORMDesignerCommands.Zoom; } Modified: trunk/Tools/ORMCustomTool/UI/MainBranch.cs =================================================================== --- trunk/Tools/ORMCustomTool/UI/MainBranch.cs 2011-07-27 17:34:59 UTC (rev 1474) +++ trunk/Tools/ORMCustomTool/UI/MainBranch.cs 2011-10-13 04:43:38 UTC (rev 1475) @@ -392,7 +392,7 @@ } } formatBranch.SelectedORMGenerator = modifierGenerator; - _parent.BuildItemsByGenerator[primaryGenerator.OfficialName].SetMetadata(ITEMMETADATA_ORMGENERATOR, primaryBranch.SelectedGeneratorOfficialNames); + SetItemMetaData(_parent.BuildItemsByGenerator[primaryGenerator.OfficialName], ITEMMETADATA_ORMGENERATOR, primaryBranch.SelectedGeneratorOfficialNames); retVal |= StateRefreshChanges.Children | StateRefreshChanges.Children; } else if (testToggleOff) @@ -483,7 +483,7 @@ #endif = buildItemsByGeneratorName[primaryGenerator.OfficialName]; formatBranch.SelectedORMGenerator = null; - updateBuildItem.SetMetadata(ITEMMETADATA_ORMGENERATOR, primaryBranch.SelectedGeneratorOfficialNames); + SetItemMetaData(updateBuildItem, ITEMMETADATA_ORMGENERATOR, primaryBranch.SelectedGeneratorOfficialNames); } } else @@ -505,6 +505,32 @@ _parent.AddRemovedItem(removeBuildItem); } } +#if VISUALSTUDIO_10_0 + private static void SetItemMetaData(ProjectItemElement buildItem, string metadataName, string metadataValue) + { + // ProjectItemElement.SetMetadata adds a new metadata element with the same name + // as the previous one. There is no 'RemoveMetadata' that takes a string, so we go through + // the entire metadata collection and clean it out. + foreach (ProjectMetadataElement element in buildItem.Metadata) + { + if (element.Name == metadataName) + { + // The Metadata collection is a read-only snapshot, so deleting from it is safe + // inside the iterator. + buildItem.RemoveChild(element); + // Do not break. This handles removing multiple metadata items with the + // same name, which will clean up project files affected by this problem + // in previous drops. + } + } + buildItem.AddMetadata(metadataName, metadataValue); + } +#else // VISUALSTUDIO_10_0 + private static void SetItemMetaData(BuildItem buildItem, string metadataName, string metadataValue) + { + buildItem.SetMetadata(metadataName, metadataValue); + } +#endif // VISUALSTUDIO_10_0 public override BranchFeatures Features { get This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2011-07-27 17:35:06
|
Revision: 1474 http://orm.svn.sourceforge.net/orm/?rev=1474&view=rev Author: mcurland Date: 2011-07-27 17:34:59 +0000 (Wed, 27 Jul 2011) Log Message: ----------- * FactTypeShape displayed as object type does not reconnect role players on file reload. refs #406 * Eliminate some allowed ring type combinations from ring type picker display (Irreflexive+Symmetric disallows Transitive because Transitive+Symmetric implies Reflexive, similarly for Irreflexive+Transitive disallows Symmetric) refs #407 * Added descriptive tooltips to ring type picker glyphs Modified Paths: -------------- trunk/ORMModel/ObjectModel/Design/Editors/RingConstraintTypePicker.cs trunk/ORMModel/ObjectModel/ORMModel.resx trunk/ORMModel/Resources/ResourceStringsGenerator.cs trunk/ORMModel/Resources/ResourceStringsGenerator.xml trunk/ORMModel/ShapeModel/ORMDiagram.cs Modified: trunk/ORMModel/ObjectModel/Design/Editors/RingConstraintTypePicker.cs =================================================================== --- trunk/ORMModel/ObjectModel/Design/Editors/RingConstraintTypePicker.cs 2011-06-30 02:39:04 UTC (rev 1473) +++ trunk/ORMModel/ObjectModel/Design/Editors/RingConstraintTypePicker.cs 2011-07-27 17:34:59 UTC (rev 1474) @@ -104,6 +104,7 @@ public readonly RingConstraintType[] ImpliedByCombination; // Theoretically [][], but doesn't actually happen public readonly RingConstraintType[] UsedInCombinationBy; public readonly string DisplayName; + public readonly string Description; public readonly SurveyQuestionGlyph Glyph; public SingleRingTypeInfo( RingConstraintType nodeType, @@ -113,6 +114,7 @@ RingConstraintType[] impliedByCombination, RingConstraintType[] usedInCombinationBy, string displayName, + string description, SurveyQuestionGlyph glyph) { NodeType = nodeType; @@ -122,6 +124,7 @@ ImpliedByCombination = impliedByCombination; UsedInCombinationBy = usedInCombinationBy; DisplayName = displayName; + Description = description; Glyph = glyph; } } @@ -155,6 +158,7 @@ null, null, enumNames[(int)RingConstraintType.Irreflexive], + ResourceStrings.RingConstraintTypeDescriptionIrreflexive, SurveyQuestionGlyph.RingIrreflexive) , new SingleRingTypeInfo( RingConstraintType.Antisymmetric, @@ -164,6 +168,7 @@ null, null, enumNames[(int)RingConstraintType.Antisymmetric], + ResourceStrings.RingConstraintTypeDescriptionAntisymmetric, SurveyQuestionGlyph.RingAntisymmetric) , new SingleRingTypeInfo( RingConstraintType.Asymmetric, @@ -173,6 +178,7 @@ null, null, enumNames[(int)RingConstraintType.Asymmetric], + ResourceStrings.RingConstraintTypeDescriptionAsymmetric, SurveyQuestionGlyph.RingAsymmetric) , new SingleRingTypeInfo( RingConstraintType.Intransitive, @@ -182,6 +188,7 @@ null, null, enumNames[(int)RingConstraintType.Intransitive], + ResourceStrings.RingConstraintTypeDescriptionIntransitive, SurveyQuestionGlyph.RingIntransitive) , new SingleRingTypeInfo( RingConstraintType.StronglyIntransitive, @@ -191,6 +198,7 @@ null, null, enumNames[(int)RingConstraintType.StronglyIntransitive], + ResourceStrings.RingConstraintTypeDescriptionStronglyIntransitive, SurveyQuestionGlyph.RingStronglyIntransitive) , new SingleRingTypeInfo( RingConstraintType.Acyclic, @@ -200,6 +208,7 @@ null, null, enumNames[(int)RingConstraintType.Acyclic], + ResourceStrings.RingConstraintTypeDescriptionAcyclic, SurveyQuestionGlyph.RingAcyclic) , new SingleRingTypeInfo( RingConstraintType.PurelyReflexive, @@ -209,7 +218,13 @@ null, null, enumNames[(int)RingConstraintType.PurelyReflexive], + ResourceStrings.RingConstraintTypeDescriptionPurelyReflexive, SurveyQuestionGlyph.RingPurelyReflexive) + // Note that if any two of Reflexive/Symmetric/Transitive are selected then the + // third remains bold (or implied if Symmetric/Transitive is selected). This is + // slightly inconsistent with the other selections, but is reasonable from a + // usability perspective as selecting the third positive ring type will simply + // make reflexive implied, not turn it off. , new SingleRingTypeInfo( RingConstraintType.Reflexive, new RingConstraintType[]{RingConstraintType.Irreflexive, RingConstraintType.Asymmetric, RingConstraintType.Intransitive, RingConstraintType.StronglyIntransitive, RingConstraintType.Acyclic}, @@ -218,24 +233,27 @@ new RingConstraintType[]{RingConstraintType.Symmetric, RingConstraintType.Transitive}, null, enumNames[(int)RingConstraintType.Reflexive], + ResourceStrings.RingConstraintTypeDescriptionReflexive, SurveyQuestionGlyph.RingReflexive) , new SingleRingTypeInfo( RingConstraintType.Symmetric, new RingConstraintType[]{RingConstraintType.Antisymmetric, RingConstraintType.Asymmetric, RingConstraintType.Acyclic}, - null, + new RingConstraintType[]{RingConstraintType.Irreflexive, RingConstraintType.Transitive}, new RingConstraintType[]{RingConstraintType.PurelyReflexive}, null, - new RingConstraintType[]{RingConstraintType.Reflexive, RingConstraintType.Irreflexive}, + new RingConstraintType[]{RingConstraintType.Reflexive, RingConstraintType.Irreflexive, RingConstraintType.Transitive}, enumNames[(int)RingConstraintType.Symmetric], + ResourceStrings.RingConstraintTypeDescriptionSymmetric, SurveyQuestionGlyph.RingSymmetric) , new SingleRingTypeInfo( RingConstraintType.Transitive, new RingConstraintType[]{RingConstraintType.Intransitive, RingConstraintType.StronglyIntransitive, RingConstraintType.PurelyReflexive}, + new RingConstraintType[]{RingConstraintType.Irreflexive, RingConstraintType.Symmetric}, null, null, - null, - new RingConstraintType[]{RingConstraintType.Reflexive, RingConstraintType.Irreflexive}, + new RingConstraintType[]{RingConstraintType.Reflexive, RingConstraintType.Irreflexive, RingConstraintType.Symmetric}, enumNames[(int)RingConstraintType.Transitive], + ResourceStrings.RingConstraintTypeDescriptionTransitive, SurveyQuestionGlyph.RingTransitive) }; int[] enumToPositionMap = new int[SingleRingTypeCount + 1]; // Note that undefined is at 0, so real values start at 1 @@ -644,6 +662,17 @@ { return mySingleNodes[row].DisplayName; } + string IBranch.GetTipText(int row, int column, ToolTipType tipType) + { + switch (tipType) + { + case ToolTipType.Icon: + return mySingleNodes[row].Description; + case ToolTipType.StateIcon: + return ""; + } + return null; + } int IBranch.VisibleItemCount { get @@ -808,10 +837,6 @@ { return null; } - string IBranch.GetTipText(int row, int column, ToolTipType tipType) - { - return null; - } bool IBranch.IsExpandable(int row, int column) { return false; Modified: trunk/ORMModel/ObjectModel/ORMModel.resx =================================================================== --- trunk/ORMModel/ObjectModel/ORMModel.resx 2011-06-30 02:39:04 UTC (rev 1473) +++ trunk/ORMModel/ObjectModel/ORMModel.resx 2011-07-27 17:34:59 UTC (rev 1474) @@ -1070,6 +1070,36 @@ <data name="RingConstraintType.AsymmetricStronglyIntransitive" xml:space="preserve"> <value>Asymmetric and Strongly Intransitive</value> </data> + <data name="RingConstraintType.Description.Acyclic" xml:space="preserve"> + <value>Acyclic:
No A may cycle back to itself via one or more traversals through “A relates to A”.</value> + </data> + <data name="RingConstraintType.Description.Antisymmetric" xml:space="preserve"> + <value>Antisymmetric:
If A1 relates to A2 and A1 is not A2
 then it is impossible that A2 relates to A1.</value> + </data> + <data name="RingConstraintType.Description.Asymmetric" xml:space="preserve"> + <value>Asymmetric:
If A1 relates to A2
 then it is impossible that A2 relates to A1.</value> + </data> + <data name="RingConstraintType.Description.Intransitive" xml:space="preserve"> + <value>Intransitive:
If A1 relates to A2 and A2 relates to A3
 then it is impossible that A2 relates to A3.</value> + </data> + <data name="RingConstraintType.Description.Irreflexive" xml:space="preserve"> + <value>Irreflexive:
No A relates to itself.</value> + </data> + <data name="RingConstraintType.Description.PurelyReflexive" xml:space="preserve"> + <value>Purely Reflexive:
If A1 relates to some A2
 then A1 = A2.</value> + </data> + <data name="RingConstraintType.Description.Reflexive" xml:space="preserve"> + <value>Reflexive:
If A1 relates to some A2
 then A1 relates to itself.</value> + </data> + <data name="RingConstraintType.Description.StronglyIntransitive" xml:space="preserve"> + <value>Strongly Intransitive:
If A1 relates to some A2
 then it is not true that A1 is indirectly related to A2 by repeatedly applying this fact type.</value> + </data> + <data name="RingConstraintType.Description.Symmetric" xml:space="preserve"> + <value>Symmetric:
If A1 relates to A2
 then A2 relates to A1.</value> + </data> + <data name="RingConstraintType.Description.Transitive" xml:space="preserve"> + <value>Transitive:
If A1 relates to A2 and A2 relates to A3
 then A1 relates to A3.</value> + </data> <data name="RingConstraintType.Intransitive" xml:space="preserve"> <value>Intransitive</value> </data> Modified: trunk/ORMModel/Resources/ResourceStringsGenerator.cs =================================================================== --- trunk/ORMModel/Resources/ResourceStringsGenerator.cs 2011-06-30 02:39:04 UTC (rev 1473) +++ trunk/ORMModel/Resources/ResourceStringsGenerator.cs 2011-07-27 17:34:59 UTC (rev 1474) @@ -1612,6 +1612,76 @@ return ResourceStrings.GetString(ResourceManagers.Model, "ModelException.ValueTypeInstance.InvalidValueTypeParent"); } } + public static string RingConstraintTypeDescriptionAcyclic + { + get + { + return ResourceStrings.GetString(ResourceManagers.Model, "RingConstraintType.Description.Acyclic"); + } + } + public static string RingConstraintTypeDescriptionAntisymmetric + { + get + { + return ResourceStrings.GetString(ResourceManagers.Model, "RingConstraintType.Description.Antisymmetric"); + } + } + public static string RingConstraintTypeDescriptionAsymmetric + { + get + { + return ResourceStrings.GetString(ResourceManagers.Model, "RingConstraintType.Description.Asymmetric"); + } + } + public static string RingConstraintTypeDescriptionIntransitive + { + get + { + return ResourceStrings.GetString(ResourceManagers.Model, "RingConstraintType.Description.Intransitive"); + } + } + public static string RingConstraintTypeDescriptionIrreflexive + { + get + { + return ResourceStrings.GetString(ResourceManagers.Model, "RingConstraintType.Description.Irreflexive"); + } + } + public static string RingConstraintTypeDescriptionPurelyReflexive + { + get + { + return ResourceStrings.GetString(ResourceManagers.Model, "RingConstraintType.Description.PurelyReflexive"); + } + } + public static string RingConstraintTypeDescriptionReflexive + { + get + { + return ResourceStrings.GetString(ResourceManagers.Model, "RingConstraintType.Description.Reflexive"); + } + } + public static string RingConstraintTypeDescriptionStronglyIntransitive + { + get + { + return ResourceStrings.GetString(ResourceManagers.Model, "RingConstraintType.Description.StronglyIntransitive"); + } + } + public static string RingConstraintTypeDescriptionSymmetric + { + get + { + return ResourceStrings.GetString(ResourceManagers.Model, "RingConstraintType.Description.Symmetric"); + } + } + public static string RingConstraintTypeDescriptionTransitive + { + get + { + return ResourceStrings.GetString(ResourceManagers.Model, "RingConstraintType.Description.Transitive"); + } + } /// <summary>This text appears in the edit menu when fact types are selected in the diagram.</summary> public static string CommandDeleteFactTypeText { Modified: trunk/ORMModel/Resources/ResourceStringsGenerator.xml =================================================================== --- trunk/ORMModel/Resources/ResourceStringsGenerator.xml 2011-06-30 02:39:04 UTC (rev 1473) +++ trunk/ORMModel/Resources/ResourceStringsGenerator.xml 2011-07-27 17:34:59 UTC (rev 1474) @@ -251,6 +251,16 @@ <ResourceString name="ModelExceptionEntityTypeSubtypeInstanceDuplicateSupertypeInstance" model="Model" resourceName="ModelException.EntityTypeSubtypeInstance.DuplicateSupertypeInstance"/> <ResourceString name="ModelExceptionEntityTypeSubtypeInstanceEnforceInitialSubtypeInstance" model="Model" resourceName="ModelException.EntityTypeSubtypeInstance.EnforceInitialSubtypeInstance"/> <ResourceString name="ModelExceptionValueTypeInstanceInvalidValueTypeParent" model="Model" resourceName="ModelException.ValueTypeInstance.InvalidValueTypeParent"/> + <ResourceString name="RingConstraintTypeDescriptionAcyclic" model="Model" resourceName="RingConstraintType.Description.Acyclic"/> + <ResourceString name="RingConstraintTypeDescriptionAntisymmetric" model="Model" resourceName="RingConstraintType.Description.Antisymmetric"/> + <ResourceString name="RingConstraintTypeDescriptionAsymmetric" model="Model" resourceName="RingConstraintType.Description.Asymmetric"/> + <ResourceString name="RingConstraintTypeDescriptionIntransitive" model="Model" resourceName="RingConstraintType.Description.Intransitive"/> + <ResourceString name="RingConstraintTypeDescriptionIrreflexive" model="Model" resourceName="RingConstraintType.Description.Irreflexive"/> + <ResourceString name="RingConstraintTypeDescriptionPurelyReflexive" model="Model" resourceName="RingConstraintType.Description.PurelyReflexive"/> + <ResourceString name="RingConstraintTypeDescriptionReflexive" model="Model" resourceName="RingConstraintType.Description.Reflexive"/> + <ResourceString name="RingConstraintTypeDescriptionStronglyIntransitive" model="Model" resourceName="RingConstraintType.Description.StronglyIntransitive"/> + <ResourceString name="RingConstraintTypeDescriptionSymmetric" model="Model" resourceName="RingConstraintType.Description.Symmetric"/> + <ResourceString name="RingConstraintTypeDescriptionTransitive" model="Model" resourceName="RingConstraintType.Description.Transitive"/> <ResourceString name="CommandDeleteFactTypeText" model="Diagram" resourceName="Command.DeleteFactType.Text"/> <ResourceString name="CommandDeleteObjectTypeText" model="Diagram" resourceName="Command.DeleteObjectType.Text"/> <ResourceString name="CommandDeleteConstraintText" model="Diagram" resourceName="Command.DeleteConstraint.Text"/> Modified: trunk/ORMModel/ShapeModel/ORMDiagram.cs =================================================================== --- trunk/ORMModel/ShapeModel/ORMDiagram.cs 2011-06-30 02:39:04 UTC (rev 1473) +++ trunk/ORMModel/ShapeModel/ORMDiagram.cs 2011-07-27 17:34:59 UTC (rev 1474) @@ -1002,6 +1002,31 @@ #endregion //StickyEditObject #region View Fixup Methods /// <summary> + /// Used by <see cref="ShouldAddShapeForElement"/> to map an + /// element that is not directly displayed shaped one with displayed + /// elements. The default representation maps a <see cref="Role"/> to + /// its parent <see cref="FactType"/> and an objectified <see cref="ObjectType"/> + /// to the objectifying <see cref="FactType"/>. + /// </summary> + /// <param name="element">The element to be displayed or redirected.</param> + /// <returns>The input element, or displayed element.</returns> + protected virtual ModelElement RedirectToDisplayedElement(ModelElement element) + { + Role role; + ObjectType objectType; + Objectification objectification; + if (null != (role = element as Role)) + { + element = role.FactType; + } + else if (null != (objectType = element as ObjectType) && + null != (objectification = objectType.Objectification)) + { + element = objectification.NestedFactType; + } + return element; + } + /// <summary> /// Called as a result of the FixUpDiagram calls /// with the diagram as the first element /// </summary> @@ -1016,18 +1041,8 @@ ModelElement element2 = null; if (link != null) { - element1 = DomainRoleInfo.GetSourceRolePlayer(link); - Role role1 = element1 as Role; - if (role1 != null) - { - element1 = role1.FactType; - } - element2 = DomainRoleInfo.GetTargetRolePlayer(link); - Role role2 = element2 as Role; - if (role2 != null) - { - element2 = role2.FactType; - } + element1 = RedirectToDisplayedElement(DomainRoleInfo.GetSourceRolePlayer(link)); + element2 = RedirectToDisplayedElement(DomainRoleInfo.GetTargetRolePlayer(link)); } else if ((subtypeFact = element as SubtypeFact) != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2011-06-30 02:39:15
|
Revision: 1473 http://orm.svn.sourceforge.net/orm/?rev=1473&view=rev Author: mcurland Date: 2011-06-30 02:39:04 +0000 (Thu, 30 Jun 2011) Log Message: ----------- * External constraints attached to a fact type shape with DisplayAsObjectType true refs #406 * Setting DisplayAsObjectType to false with constraint display position set to bottom placed objectification and reading shapes on top of each other * Dropping multiple objects only performed fixup operations (size adjustment, for example) on the first dropped shape. refs #403 * Fixed role bar resize and redraw issues (continuation of [1465]) * Temporarily skip attempts to change the document tab caption in VS2010 database import, added readme note about other VS2010 import problems. refs #405 * Defer to a type converter in the transaction log viewer if value text not available. Specifically, this allows the EdgePoints property on a property to display. refs #317 Modified Paths: -------------- trunk/ORMModel/Framework/Diagnostics/TransactionLogViewer.cs trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs trunk/ORMModel/ShapeModel/ExternalConstraintLink.cs trunk/ORMModel/ShapeModel/FactTypeShape.cs trunk/ORMModel/ShapeModel/ORMShape.AttachRules.cs trunk/ORMModel/ShapeModel/ORMShape.AttachRules.xml trunk/ORMModel/ShapeModel/ReadingShape.cs trunk/ORMModel/ShapeModel/ViewFixupRules.cs trunk/Setup/Readme.htm trunk/Tools/DatabaseImport/ORMDatabaseImportWizard.cs Modified: trunk/ORMModel/Framework/Diagnostics/TransactionLogViewer.cs =================================================================== --- trunk/ORMModel/Framework/Diagnostics/TransactionLogViewer.cs 2011-06-28 01:16:16 UTC (rev 1472) +++ trunk/ORMModel/Framework/Diagnostics/TransactionLogViewer.cs 2011-06-30 02:39:04 UTC (rev 1473) @@ -951,7 +951,13 @@ } else { + TypeConverter converter; retVal = value.ToString(); + if (retVal == value.GetType().FullName && + null != (converter = TypeDescriptor.GetConverter(value))) + { + retVal = converter.ConvertToString(value); + } } } return retVal; Modified: trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs =================================================================== --- trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs 2011-06-28 01:16:16 UTC (rev 1472) +++ trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs 2011-06-30 02:39:04 UTC (rev 1473) @@ -697,10 +697,6 @@ if (existingLink != null) { - if (existingLink == link) - { - originalLinkProcessed = true; - } ShapeElement resolvedFromShape = ResolvePrimaryShape(existingLink.FromShape); bool testDeleteLinksOnCurrentFromShape = false; if (closerFromShapeBlocking) @@ -747,12 +743,20 @@ connectLink = existingLink; connectFromShape = closerFromShape; connectToShape = closestToShape; + if (existingLink == link) + { + originalLinkProcessed = true; + } } } else if (detachFromShape) { testDeleteLinksOnCurrentFromShape = true; } + else if (existingLink == link) + { + originalLinkProcessed = true; + } } else if (closerFromShape != null || detachFromShape) { @@ -767,6 +771,10 @@ connectFromShape = currentFromShape; connectToShape = closestToShape; testDeleteLinksOnCurrentFromShape = true; + if (existingLink == link) + { + originalLinkProcessed = true; + } } if (testDeleteLinksOnCurrentFromShape) { @@ -801,10 +809,6 @@ } if (existingLink != null) { - if (existingLink == link) - { - originalLinkProcessed = true; - } Debug.Assert(ResolvePrimaryShape(existingLink.ToShape) != closestToShape, "The link would also have been attached to the to shape"); if (closerFromShapeBlocking) { @@ -836,12 +840,20 @@ connectLink = existingLink; connectToShape = closestToShape; connectFromShape = closerFromShape; + if (existingLink == link) + { + originalLinkProcessed = true; + } } else { connectLink = existingLink; connectToShape = closestToShape; connectFromShape = currentFromShape; + if (existingLink == link) + { + originalLinkProcessed = true; + } } } else if (closerFromShape == null && !detachFromShape) @@ -985,7 +997,7 @@ AttachLinkResult.Attach != configurableFromEndpoint.CanAttachLink(forLink, false); return (!detachFromShape && FindNearestShapeForElement(diagram, fromShape, toElement, forLink, null, false, out closestToShape, out closerFromShape, out closerFromShapeBlocking) && - !closerFromShapeBlocking) ? + closerFromShape == null) ? closestToShape : null; } @@ -1065,7 +1077,6 @@ // elements are either currently connected or should be connected. // Before connecting, find out up front if we have a closer from shape than the current from shape. // If we do, then the current to/from shapes should not be connected for this link. - bool closerFromShapeDeferred = false; double closerFromShapeDistance = detachedFromShape ? double.MaxValue : closestToShapeDistance; testCenterX = closestToShapeCenter.X; testCenterY = closestToShapeCenter.Y; @@ -1097,27 +1108,18 @@ break; } } - center = GetReliableShapeCenter(currentFromShape2); - if ((currentDistance = (distanceX = testCenterX - center.X) * distanceX - + (distanceY = testCenterY - center.Y) * distanceY) < closerFromShapeDistance) + if (!deferredShape) { - if (deferredShape) + center = GetReliableShapeCenter(currentFromShape2); + if ((currentDistance = (distanceX = testCenterX - center.X) * distanceX + + (distanceY = testCenterY - center.Y) * distanceY) < closerFromShapeDistance) { - closerFromShapeDeferred = true; - } - else - { closerFromShapeDistance = currentDistance; closerFromShape = currentFromShape2; - closerFromShapeDeferred = false; closerFromShapeBlocking = blockingShape; } } } - if (closerFromShapeDeferred && closerFromShape == null) - { - closerFromShapeBlocking = true; - } return true; } return false; @@ -1276,19 +1278,19 @@ public enum AttachLinkResult { /// <summary> - /// The link can be attached + /// The link can be attached to this shape /// </summary> Attach, /// <summary> /// The link cannot be attached to this shape, but a - /// shape that is farther away may be used as an attach - /// point. + /// shape that is farther away may be attached to this + /// link. /// </summary> Defer, /// <summary> /// The link cannot be attached to this shape, and no - /// shape that is farther away should be used an attach - /// point for this link. + /// shape that is farther away should be attached to + /// this link. /// </summary> Block, } Modified: trunk/ORMModel/ShapeModel/ExternalConstraintLink.cs =================================================================== --- trunk/ORMModel/ShapeModel/ExternalConstraintLink.cs 2011-06-28 01:16:16 UTC (rev 1472) +++ trunk/ORMModel/ShapeModel/ExternalConstraintLink.cs 2011-06-30 02:39:04 UTC (rev 1473) @@ -453,16 +453,30 @@ } } #endregion // ExternalConstraintLink specific - #region Dangling constraint shape deletion + #region Dangling constraint shape deletion and fact type shape role bar resizing /// <summary> + /// AddRule: typeof(Microsoft.VisualStudio.Modeling.Diagrams.LinkConnectsToNode) + /// Make sure connected fact type shapes properly display their role bars + /// </summary> + private static void VerifyedConnectedShapeAddedRule(ElementAddedEventArgs e) + { + LinkConnectsToNode connectLink = (LinkConnectsToNode)e.ModelElement; + FactTypeShape factTypeShape; + if (connectLink.Link is ExternalConstraintLink && + null != (factTypeShape = connectLink.Nodes as FactTypeShape)) + { + FrameworkDomainModel.DelayValidateElement(factTypeShape, DelayValidateFactTypeShapeSize); + } + } + /// <summary> /// DeletingRule: typeof(Microsoft.VisualStudio.Modeling.Diagrams.LinkConnectsToNode) /// External constraint shapes can only be drawn if they show all of their /// links, so automatically remove them if a connecting shape is removed. /// </summary> - private static void DeleteDanglingConstraintShapeDeletingRule(ElementDeletingEventArgs e) + private static void VerifyConnectedShapeShapeDeletingRule(ElementDeletingEventArgs e) { - LinkConnectsToNode connectLink = e.ModelElement as LinkConnectsToNode; - ExternalConstraintLink link = connectLink.Link as ExternalConstraintLink; + LinkConnectsToNode connectLink = (LinkConnectsToNode)e.ModelElement; + ExternalConstraintLink link; ModelElement linkMel; ModelElement shapeMel; if (null != (link = connectLink.Link as ExternalConstraintLink) && @@ -492,18 +506,12 @@ { FrameworkDomainModel.DelayValidateElement(constraintShape, DelayValidateExternalConstraintShapeFullyConnected); } - else + // Delay, fact type shape size will not be accurate until deletion is completed. + FactTypeShape factTypeShape = MultiShapeUtility.ResolvePrimaryShape(oppositeShape) as FactTypeShape; + if (factTypeShape != null && + !factTypeShape.IsDeleting) { - FactTypeShape factTypeShape = MultiShapeUtility.ResolvePrimaryShape(oppositeShape) as FactTypeShape; - if (factTypeShape != null) - { - SizeD oldSize = factTypeShape.Size; - factTypeShape.AutoResize(); - if (oldSize == factTypeShape.Size) - { - ((IInvalidateDisplay)factTypeShape).InvalidateRequired(true); - } - } + FrameworkDomainModel.DelayValidateElement(factTypeShape, DelayValidateFactTypeShapeSize); } } } @@ -514,31 +522,43 @@ /// links, so automatically remove them if a link is moved off the constraint /// shape. /// </summary> - private static void DeleteDanglingConstraintShapeRolePlayerChangeRule(RolePlayerChangedEventArgs e) + private static void VerifyConnectedShapeShapeRolePlayerChangedRule(RolePlayerChangedEventArgs e) { - IElementDirectory directory; - ShapeElement oldShape; + ShapeElement shape; if (e.DomainRole.Id == LinkConnectsToNode.NodesDomainRoleId && - (directory = e.ElementLink.Store.ElementDirectory).ContainsElement(e.OldRolePlayerId) && - null != (oldShape = directory.GetElement(e.OldRolePlayerId) as ShapeElement)) + ((LinkConnectsToNode)e.ElementLink).Link is ExternalConstraintLink && + null != (shape = e.OldRolePlayer as ShapeElement)) { ExternalConstraintShape constraintShape; FactTypeShape factTypeShape; - if (null != (constraintShape = oldShape as ExternalConstraintShape)) + if (null != (constraintShape = shape as ExternalConstraintShape)) { FrameworkDomainModel.DelayValidateElement(constraintShape, DelayValidateExternalConstraintShapeFullyConnected); } - else if (null != (factTypeShape = MultiShapeUtility.ResolvePrimaryShape(oldShape) as FactTypeShape)) + else if (null != (factTypeShape = MultiShapeUtility.ResolvePrimaryShape(shape) as FactTypeShape)) { - SizeD oldSize = factTypeShape.Size; - factTypeShape.AutoResize(); - if (oldSize == factTypeShape.Size) + FrameworkDomainModel.DelayValidateElement(factTypeShape, DelayValidateFactTypeShapeSize); + if (null != (shape = e.NewRolePlayer as ShapeElement) && + null != (factTypeShape = MultiShapeUtility.ResolvePrimaryShape(shape) as FactTypeShape)) { - ((IInvalidateDisplay)factTypeShape).InvalidateRequired(true); + FrameworkDomainModel.DelayValidateElement(factTypeShape, DelayValidateFactTypeShapeSize); } } } } + private static void DelayValidateFactTypeShapeSize(ModelElement element) + { + if (!element.IsDeleted) + { + FactTypeShape factTypeShape = (FactTypeShape)element; + SizeD oldSize = factTypeShape.Size; + factTypeShape.AutoResize(); + if (oldSize == factTypeShape.Size) + { + ((IInvalidateDisplay)factTypeShape).InvalidateRequired(true); + } + } + } /// <summary> /// AddRule: typeof(ExternalConstraintShape), FireTime=TopLevelCommit, Priority=DiagramFixupConstants.AddConnectionRulePriority + 1; /// External constraint shapes can only be drawn if they show all of their @@ -579,7 +599,7 @@ } } } - #endregion // Dangling constraint shape deletion + #endregion // Dangling constraint shape deletion and fact type shape role bar resizing #region Accessibility Properties /// <summary> /// Return the localized accessible name for the link Modified: trunk/ORMModel/ShapeModel/FactTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/FactTypeShape.cs 2011-06-28 01:16:16 UTC (rev 1472) +++ trunk/ORMModel/ShapeModel/FactTypeShape.cs 2011-06-30 02:39:04 UTC (rev 1473) @@ -5182,6 +5182,7 @@ protected AttachLinkResult CanAttachLink(ModelElement element, bool toRole) { ObjectTypePlaysRole rolePlayerLink; + FactConstraint constraintLink; FactType factType; Objectification objectification; if (element is SubtypeFact) @@ -5198,47 +5199,58 @@ return AttachLinkResult.Defer; } } - else if (null != (rolePlayerLink = element as ObjectTypePlaysRole) && - null != (factType = this.AssociatedFactType) && - null != (objectification = factType.Objectification)) + else if (null != (rolePlayerLink = element as ObjectTypePlaysRole)) { - bool displayedAsObjectType = DisplayAsObjectType; - ObjectType objectifyingType = objectification.NestingType; - FactType refModeFactType; - if (displayedAsObjectType) + if (null != (factType = this.AssociatedFactType) && + null != (objectification = factType.Objectification)) { - if (objectifyingType != rolePlayerLink.RolePlayer && - ShouldDrawObjectification(objectification, objectifyingType)) + bool displayedAsObjectType = DisplayAsObjectType; + ObjectType objectifyingType = objectification.NestingType; + FactType refModeFactType; + if (displayedAsObjectType) { - return AttachLinkResult.Defer; + if (objectifyingType != rolePlayerLink.RolePlayer && + ShouldDrawObjectification(objectification, objectifyingType)) + { + return AttachLinkResult.Defer; + } + else if (toRole && + !ExpandRefMode && // Use ExpandRefMode from the fact type shape + null != (refModeFactType = objectifyingType.ReferenceModeFactType) && + refModeFactType == rolePlayerLink.PlayedRole.FactType) + { + return AttachLinkResult.Defer; + } } else if (toRole && - !ExpandRefMode && // Use ExpandRefMode from the fact type shape null != (refModeFactType = objectifyingType.ReferenceModeFactType) && refModeFactType == rolePlayerLink.PlayedRole.FactType) { - return AttachLinkResult.Defer; - } - } - else if (toRole && - null != (refModeFactType = objectifyingType.ReferenceModeFactType) && - refModeFactType == rolePlayerLink.PlayedRole.FactType) - { - // Use ExpandRefMode from the name shape - foreach (PresentationElement childPel in this.RelativeChildShapes) - { - ObjectifiedFactTypeNameShape nameShape = childPel as ObjectifiedFactTypeNameShape; - if (nameShape != null) + // Use ExpandRefMode from the name shape + foreach (PresentationElement childPel in this.RelativeChildShapes) { - if (!nameShape.ExpandRefMode) + ObjectifiedFactTypeNameShape nameShape = childPel as ObjectifiedFactTypeNameShape; + if (nameShape != null) { - return AttachLinkResult.Defer; + if (!nameShape.ExpandRefMode) + { + return AttachLinkResult.Defer; + } + break; } - break; } } } } + else if (null != (constraintLink = element as FactConstraint)) + { + if (DisplayAsObjectType && + null != (objectification = constraintLink.FactType.Objectification) && + !objectification.IsImplied) + { + return AttachLinkResult.Defer; + } + } return AttachLinkResult.Attach; } AttachLinkResult IConfigureableLinkEndpoint.CanAttachLink(ModelElement element, bool toRole) Modified: trunk/ORMModel/ShapeModel/ORMShape.AttachRules.cs =================================================================== --- trunk/ORMModel/ShapeModel/ORMShape.AttachRules.cs 2011-06-28 01:16:16 UTC (rev 1472) +++ trunk/ORMModel/ShapeModel/ORMShape.AttachRules.cs 2011-06-30 02:39:04 UTC (rev 1473) @@ -35,8 +35,9 @@ // Given the low likelihood of this ever happening, the extra overhead of synchronization would outweigh any possible gain from it. retVal = new Type[]{ typeof(ExternalConstraintLink).GetNestedType("DeleteDanglingConstraintShapeAddRuleClass", BindingFlags.Public | BindingFlags.NonPublic), - typeof(ExternalConstraintLink).GetNestedType("DeleteDanglingConstraintShapeDeletingRuleClass", BindingFlags.Public | BindingFlags.NonPublic), - typeof(ExternalConstraintLink).GetNestedType("DeleteDanglingConstraintShapeRolePlayerChangeRuleClass", BindingFlags.Public | BindingFlags.NonPublic), + typeof(ExternalConstraintLink).GetNestedType("VerifyedConnectedShapeAddedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), + typeof(ExternalConstraintLink).GetNestedType("VerifyConnectedShapeShapeDeletingRuleClass", BindingFlags.Public | BindingFlags.NonPublic), + typeof(ExternalConstraintLink).GetNestedType("VerifyConnectedShapeShapeRolePlayerChangedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(ExternalConstraintShape).GetNestedType("ExclusiveOrCouplerAddedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(ExternalConstraintShape).GetNestedType("ExclusiveOrCouplerDeletedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(ExternalConstraintShape).GetNestedType("PreferredIdentifierAddRuleClass", BindingFlags.Public | BindingFlags.NonPublic), @@ -150,7 +151,7 @@ { Microsoft.VisualStudio.Modeling.RuleManager ruleManager = store.RuleManager; Type[] disabledRuleTypes = ORMShapeDomainModel.CustomDomainModelTypes; - for (int i = 0; i < 83; ++i) + for (int i = 0; i < 84; ++i) { ruleManager.EnableRule(disabledRuleTypes[i]); } @@ -192,10 +193,10 @@ } } [Microsoft.VisualStudio.Modeling.RuleOn(typeof(Microsoft.VisualStudio.Modeling.Diagrams.LinkConnectsToNode), Priority=ORMSolutions.ORMArchitect.Framework.FrameworkDomainModel.InlineRulePriority)] - private sealed class DeleteDanglingConstraintShapeDeletingRuleClass : Microsoft.VisualStudio.Modeling.DeletingRule + private sealed class VerifyedConnectedShapeAddedRuleClass : Microsoft.VisualStudio.Modeling.AddRule { [System.Diagnostics.DebuggerStepThrough()] - public DeleteDanglingConstraintShapeDeletingRuleClass() + public VerifyedConnectedShapeAddedRuleClass() { base.IsEnabled = false; } @@ -203,25 +204,51 @@ /// Provide the following method in class: /// ORMSolutions.ORMArchitect.Core.ShapeModel.ExternalConstraintLink /// /// <summary> + /// /// AddRule: typeof(Microsoft.VisualStudio.Modeling.Diagrams.LinkConnectsToNode) + /// /// </summary> + /// private static void VerifyedConnectedShapeAddedRule(ElementAddedEventArgs e) + /// { + /// } + /// </summary> + [System.Diagnostics.DebuggerStepThrough()] + public override void ElementAdded(Microsoft.VisualStudio.Modeling.ElementAddedEventArgs e) + { + ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleStart(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ExternalConstraintLink.VerifyedConnectedShapeAddedRule"); + ExternalConstraintLink.VerifyedConnectedShapeAddedRule(e); + ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleEnd(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ExternalConstraintLink.VerifyedConnectedShapeAddedRule"); + } + } + [Microsoft.VisualStudio.Modeling.RuleOn(typeof(Microsoft.VisualStudio.Modeling.Diagrams.LinkConnectsToNode), Priority=ORMSolutions.ORMArchitect.Framework.FrameworkDomainModel.InlineRulePriority)] + private sealed class VerifyConnectedShapeShapeDeletingRuleClass : Microsoft.VisualStudio.Modeling.DeletingRule + { + [System.Diagnostics.DebuggerStepThrough()] + public VerifyConnectedShapeShapeDeletingRuleClass() + { + base.IsEnabled = false; + } + /// <summary> + /// Provide the following method in class: + /// ORMSolutions.ORMArchitect.Core.ShapeModel.ExternalConstraintLink + /// /// <summary> /// /// DeletingRule: typeof(Microsoft.VisualStudio.Modeling.Diagrams.LinkConnectsToNode) /// /// </summary> - /// private static void DeleteDanglingConstraintShapeDeletingRule(ElementDeletingEventArgs e) + /// private static void VerifyConnectedShapeShapeDeletingRule(ElementDeletingEventArgs e) /// { /// } /// </summary> [System.Diagnostics.DebuggerStepThrough()] public override void ElementDeleting(Microsoft.VisualStudio.Modeling.ElementDeletingEventArgs e) { - ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleStart(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ExternalConstraintLink.DeleteDanglingConstraintShapeDeletingRule"); - ExternalConstraintLink.DeleteDanglingConstraintShapeDeletingRule(e); - ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleEnd(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ExternalConstraintLink.DeleteDanglingConstraintShapeDeletingRule"); + ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleStart(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ExternalConstraintLink.VerifyConnectedShapeShapeDeletingRule"); + ExternalConstraintLink.VerifyConnectedShapeShapeDeletingRule(e); + ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleEnd(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ExternalConstraintLink.VerifyConnectedShapeShapeDeletingRule"); } } [Microsoft.VisualStudio.Modeling.RuleOn(typeof(Microsoft.VisualStudio.Modeling.Diagrams.LinkConnectsToNode), Priority=ORMSolutions.ORMArchitect.Framework.FrameworkDomainModel.InlineRulePriority)] - private sealed class DeleteDanglingConstraintShapeRolePlayerChangeRuleClass : Microsoft.VisualStudio.Modeling.RolePlayerChangeRule + private sealed class VerifyConnectedShapeShapeRolePlayerChangedRuleClass : Microsoft.VisualStudio.Modeling.RolePlayerChangeRule { [System.Diagnostics.DebuggerStepThrough()] - public DeleteDanglingConstraintShapeRolePlayerChangeRuleClass() + public VerifyConnectedShapeShapeRolePlayerChangedRuleClass() { base.IsEnabled = false; } @@ -231,16 +258,16 @@ /// /// <summary> /// /// RolePlayerChangeRule: typeof(Microsoft.VisualStudio.Modeling.Diagrams.LinkConnectsToNode) /// /// </summary> - /// private static void DeleteDanglingConstraintShapeRolePlayerChangeRule(RolePlayerChangedEventArgs e) + /// private static void VerifyConnectedShapeShapeRolePlayerChangedRule(RolePlayerChangedEventArgs e) /// { /// } /// </summary> [System.Diagnostics.DebuggerStepThrough()] public override void RolePlayerChanged(Microsoft.VisualStudio.Modeling.RolePlayerChangedEventArgs e) { - ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleStart(e.ElementLink.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ExternalConstraintLink.DeleteDanglingConstraintShapeRolePlayerChangeRule"); - ExternalConstraintLink.DeleteDanglingConstraintShapeRolePlayerChangeRule(e); - ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleEnd(e.ElementLink.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ExternalConstraintLink.DeleteDanglingConstraintShapeRolePlayerChangeRule"); + ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleStart(e.ElementLink.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ExternalConstraintLink.VerifyConnectedShapeShapeRolePlayerChangedRule"); + ExternalConstraintLink.VerifyConnectedShapeShapeRolePlayerChangedRule(e); + ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleEnd(e.ElementLink.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ExternalConstraintLink.VerifyConnectedShapeShapeRolePlayerChangedRule"); } } } Modified: trunk/ORMModel/ShapeModel/ORMShape.AttachRules.xml =================================================================== --- trunk/ORMModel/ShapeModel/ORMShape.AttachRules.xml 2011-06-28 01:16:16 UTC (rev 1472) +++ trunk/ORMModel/ShapeModel/ORMShape.AttachRules.xml 2011-06-30 02:39:04 UTC (rev 1473) @@ -24,10 +24,13 @@ </arg:PriorityAdjustment> </arg:RuleOn> </arg:AddRule> - <arg:DeletingRule methodName="DeleteDanglingConstraintShapeDeletingRule"> + <arg:AddRule methodName="VerifyedConnectedShapeAddedRule"> <arg:RuleOn targetType="LinkConnectsToNode" targetTypeQualifier="Microsoft.VisualStudio.Modeling.Diagrams"/> + </arg:AddRule> + <arg:DeletingRule methodName="VerifyConnectedShapeShapeDeletingRule"> + <arg:RuleOn targetType="LinkConnectsToNode" targetTypeQualifier="Microsoft.VisualStudio.Modeling.Diagrams"/> </arg:DeletingRule> - <arg:RolePlayerChangeRule methodName="DeleteDanglingConstraintShapeRolePlayerChangeRule"> + <arg:RolePlayerChangeRule methodName="VerifyConnectedShapeShapeRolePlayerChangedRule"> <arg:RuleOn targetType="LinkConnectsToNode" targetTypeQualifier="Microsoft.VisualStudio.Modeling.Diagrams"/> </arg:RolePlayerChangeRule> </arg:RuleContainer> Modified: trunk/ORMModel/ShapeModel/ReadingShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ReadingShape.cs 2011-06-28 01:16:16 UTC (rev 1472) +++ trunk/ORMModel/ShapeModel/ReadingShape.cs 2011-06-30 02:39:04 UTC (rev 1473) @@ -331,17 +331,22 @@ /// <param name="createdDuringViewFixup">Whether this shape was created as part of a view fixup</param> public override void PlaceAsChildOf(NodeShape parent, bool createdDuringViewFixup) { - FactTypeShape factShape = (FactTypeShape)parent; + FactTypeShape factTypeShape = (FactTypeShape)parent; + FactType factType; + Objectification objectification; AutoResize(); SizeD size = Size; double yOffset; - if (factShape.ConstraintDisplayPosition == ConstraintDisplayPosition.Top) + if (factTypeShape.ConstraintDisplayPosition == ConstraintDisplayPosition.Bottom && + (null == (factType = factTypeShape.AssociatedFactType) || + null == (objectification = factType.Objectification) || + objectification.IsImplied)) { - yOffset = factShape.Size.Height + .5 * size.Height; + yOffset = -1.5 * size.Height; } else { - yOffset = -1.5 * size.Height; + yOffset = factTypeShape.Size.Height + .5 * size.Height; } Location = new PointD(0, yOffset); } Modified: trunk/ORMModel/ShapeModel/ViewFixupRules.cs =================================================================== --- trunk/ORMModel/ShapeModel/ViewFixupRules.cs 2011-06-28 01:16:16 UTC (rev 1472) +++ trunk/ORMModel/ShapeModel/ViewFixupRules.cs 2011-06-30 02:39:04 UTC (rev 1473) @@ -1278,39 +1278,34 @@ #region ForceClearViewFixupDataListRuleClass partial class ForceClearViewFixupDataListRuleClass { - #region Dynamic Microsoft.VisualStudio.Modeling.Diagrams.Diagram.ClearViewFixupDataList implementation - private delegate void ClearDiagramViewFixupDataListDelegate(Diagram @this); - /// <summary> - /// The Microsoft.VisualStudio.Modeling.Diagrams.Diagram.ViewFixupData class and corresponding - /// Microsoft.VisualStudio.Modeling.Diagrams.Diagram.ViewFixupDataList property are internal - /// Microsoft.VisualStudio.Modeling.ModelCommand is internal, but the partition and EventArgs - /// elements are not. Retrieve these with a dynamic method. - /// </summary> - private static readonly ClearDiagramViewFixupDataListDelegate ClearViewFixupDataList = CreateClearViewFixupDataList(); - private static ClearDiagramViewFixupDataListDelegate CreateClearViewFixupDataList() + #region Dynamic Microsoft.VisualStudio.Modeling.Diagrams.Diagram.GetViewFixupDataListCount implementation + private delegate int GetViewFixupDataListCountDelegate(Diagram @this); + private static readonly GetViewFixupDataListCountDelegate GetViewFixupDataListCount = CreateGetViewFixupDataListCount(); + private static GetViewFixupDataListCountDelegate CreateGetViewFixupDataListCount() { Type diagramType = typeof(Diagram); Type viewFixupDataListType; PropertyInfo viewFixupDataListProperty; MethodInfo viewFixupDataListPropertyGet; - MethodInfo clearMethod; + PropertyInfo countProperty; + MethodInfo countPropertyGet; if (null == (viewFixupDataListProperty = diagramType.GetProperty("ViewFixupDataList", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)) || null == (viewFixupDataListType = viewFixupDataListProperty.PropertyType) || - null == (clearMethod = viewFixupDataListType.GetMethod("Clear", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)) || + null == (countProperty = viewFixupDataListType.GetProperty("Count", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)) || + null == (countPropertyGet = countProperty.GetGetMethod(true)) || null == (viewFixupDataListPropertyGet = viewFixupDataListProperty.GetGetMethod(true))) { Debug.Fail("The internal structure of the Diagram class has changed, IL generation will fail"); return null; } - - // Approximate method being written (assuming TransactionItem context): - // void ClearViewFixupDataList() + // Approximate method being written: + // int GetViewFixupDataListCount() // { - // ViewFixupDataList.Clear(); + // return ViewFixupDataList.Count; // } DynamicMethod dynamicMethod = new DynamicMethod( - "ClearViewFixupDataList", - null, + "GetViewFixupDataListCount", + typeof(int), new Type[] { diagramType }, diagramType.Module, true); @@ -1319,25 +1314,29 @@ ILGenerator il = dynamicMethod.GetILGenerator(16); il.Emit(OpCodes.Ldarg_0); il.Emit(OpCodes.Call, viewFixupDataListPropertyGet); - il.Emit(OpCodes.Call, clearMethod); + il.Emit(OpCodes.Call, countPropertyGet); - // Return the array (already on the stack) + // Return the count (already on the stack) il.Emit(OpCodes.Ret); - return (ClearDiagramViewFixupDataListDelegate)dynamicMethod.CreateDelegate(typeof(ClearDiagramViewFixupDataListDelegate)); + return (GetViewFixupDataListCountDelegate)dynamicMethod.CreateDelegate(typeof(GetViewFixupDataListCountDelegate)); } - #endregion // Dynamic Microsoft.VisualStudio.Modeling.Diagrams.Diagram.ClearViewFixupDataList implementation + #endregion // Dynamic Microsoft.VisualStudio.Modeling.Diagrams.Diagram.GetViewFixupDataListCount implementation /// <summary> /// ChangeRule: typeof(Microsoft.VisualStudio.Modeling.Diagrams.Diagram), FireTime=TopLevelCommit, Priority=DiagramFixupConstants.AddShapeRulePriority + 1; - /// Make sure the internal diagram ViewFixupDataList is cleared once fixup is completed. - /// The core implementation does not clear more than a single element. + /// Only the first element of the internal diagram ViewFixupDataList is processed whenever the + /// DoViewFixup is set to true, but we generally need to process all of these items. Keep setting + /// the property to true until all of the items are processed. /// </summary> private void ForceClearViewFixupDataListRule(ElementPropertyChangedEventArgs e) { Diagram diagram; - if (e.DomainProperty.Id == Diagram.DoViewFixupDomainPropertyId && - !(diagram = (e.ModelElement as Diagram)).IsDeleted) + Guid propertyId = e.DomainProperty.Id; + if (propertyId == Diagram.DoViewFixupDomainPropertyId && + !((bool)e.NewValue) && + !(diagram = (e.ModelElement as Diagram)).IsDeleted && + 0 != GetViewFixupDataListCount(diagram)) { - ClearViewFixupDataList(diagram); + diagram.Store.DomainDataDirectory.GetDomainProperty(propertyId).SetValue(diagram, true); } } } Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2011-06-28 01:16:16 UTC (rev 1472) +++ trunk/Setup/Readme.htm 2011-06-30 02:39:04 UTC (rev 1473) @@ -44,7 +44,7 @@ <hr/> <h2>June 2011 CTP Changes</h2> -<div>The June 2011 CTP release includes all modifications through changeset 1472. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The June 2011 CTP release includes all modifications through changeset 1473. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li><a href="#DisplayAsObjectType 2011-06">Display Objectified Fact Type as Object Type</a> </li> <li><a href="#LinkFactTypeDisplay 2011-06">Link Fact Type Display</a> </li> @@ -67,13 +67,14 @@ <li>(VS2010) Customizable attach points displayed on the Relational and Barker ER diagrams crashed if clicked.</li> <li>External constraints attached to subtype lines did not display in the Context Window.</li> <li>Selecting an ObjectType reference inside a group element crashed the Properties Window.</li> -<li>Fact type shapes with constraint role bar display failed with multiple shapes for the same fact type on the same diagram.</li> +<li>Fact type shapes with constraint role bar display failed with multiple shapes for the same fact type on the same diagram and did not always resize when role bars were initially shown or hidden.</li> <li>Objectified fact types did not synchronize the object type and default fact type name in the target model after a cross-model drag of the objectified fact type.</li> <li>Sample population values did not appear to change, always displayed original invariant value.</li> <li>Sample population editor crashed adding new supertype instances in an empty inline-expanded subtype cell.</li> <li>The meta file created by the <em>Copy Image</em> command did not have a transparent background on all versions, lines were rendered visibly different from those in the designer.</li> <li>The <em>ExpandRefMode</em> property did not work well with multiple shapes for the object type (or objectified fact type) on the same diagram. If there are multiple shapes on the diagram, the first shape to set <em>ExpandRefMode</em> to true will add the reference mode fact type and value type, and the last to clear this property will remove them. The reference mode fact type will only attach to those shapes with <em>ExpandRefMode</em> set to true.</li> <li>Multiple shapes representing a single backing element (FactType, ObjectType, etc) on the same diagram caused a null reference exception if the backing element was deleted. Duplicate shapes needed to be deleted to enable deletion of the backing element.</li> +<li>Dragging multiple shapes within one document or between documents only validated size and other settings for the first selected shape.</li> <li>The final dialog shown by the database import wizard launched by a VB or C# project offered to disable the <em>Save</em> button to prevent data loss (caused by an inconsistent implementation of VSHPROPID_IsNewUnsavedItem across different project types). Template and wizard-generated files are now marked with a <em><?new?></em> processing instruction to avoid any project-type dependencies.</li> </ol> </li> @@ -638,6 +639,8 @@ <li>The <em>ORM Diagram Spy</em> window will occasionally go blank after extended use with multiple open ORM files. A restart of the environment is required to recover the window. If you can reliably reproduce this issue please report the scenario.</li> <li>The NORMA help files are not installed or integrated with Visual Studio 2010. [The installer merge modules used for help integration in VS2005 and VS2008 are not included with the VS2010 SDK.]</li> <li>The FrequencyConstraint and Reading shapes are larger in Visual Studio 2010.</li> +<li>Database import does not work from the <em>Add New Item</em> dialog in a project. Use <em>File/New</em> instead then save the file in the project file and add it to the project.</li> +<li>The document tab after a database import using <em>File/New</em> displays the full path of the temporary file instead of the base file name.</li> </ol> <a href="#The Top">Return to top</a> <hr/> Modified: trunk/Tools/DatabaseImport/ORMDatabaseImportWizard.cs =================================================================== --- trunk/Tools/DatabaseImport/ORMDatabaseImportWizard.cs 2011-06-28 01:16:16 UTC (rev 1472) +++ trunk/Tools/DatabaseImport/ORMDatabaseImportWizard.cs 2011-06-30 02:39:04 UTC (rev 1473) @@ -248,6 +248,7 @@ RunStarted(automationObject, replacementsDictionary, runKind, customParams); } +#if !VISUALSTUDIO_10_0 // UNDONE: Accessing any documents at this point throws in VS2010. I'd rather see the temp path in the caption than an error message. /// <summary> /// Ensures that only the file name portion of the new <see cref="ProjectItem"/>'s path is used as the /// title for the document window. @@ -343,5 +344,6 @@ { ProjectItemFinishedGenerating(projectItem); } +#endif // VISUALSTUDIO_10_0 } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2011-06-28 01:16:23
|
Revision: 1472 http://orm.svn.sourceforge.net/orm/?rev=1472&view=rev Author: mcurland Date: 2011-06-28 01:16:16 +0000 (Tue, 28 Jun 2011) Log Message: ----------- * Remove check for VSHPROPID_IsNewUnsavedItem and add processing instructions indicate a new file to all templates and wizards. Modifies heuristics for showing import error message added in [1226] * Modeling project items not installing in VS2010, remove condition from setup Modified Paths: -------------- trunk/ORMModel/Shell/ORMDocData.cs trunk/ORMModel/Shell/ProjectItems/CSharp.zip trunk/ORMModel/Shell/ProjectItems/JSharp.zip trunk/ORMModel/Shell/ProjectItems/Modeling.zip trunk/ORMModel/Shell/ProjectItems/NewFileItems/ORMModel.orm trunk/ORMModel/Shell/ProjectItems/VS2005/General.zip trunk/ORMModel/Shell/ProjectItems/VS2008/General.zip trunk/ORMModel/Shell/ProjectItems/VisualBasic.zip trunk/ORMModel/Shell/ProjectItems/VisualC.zip trunk/ORMModel/Shell/ProjectItems/Web/CSharp.zip trunk/ORMModel/Shell/ProjectItems/Web/JSharp.zip trunk/ORMModel/Shell/ProjectItems/Web/VisualBasic.zip trunk/Setup/NORMAItemTemplates.wxi trunk/Setup/Readme.htm trunk/Tools/DatabaseImport/DcilObjectModel.cs Modified: trunk/ORMModel/Shell/ORMDocData.cs =================================================================== --- trunk/ORMModel/Shell/ORMDocData.cs 2011-06-15 19:14:24 UTC (rev 1471) +++ trunk/ORMModel/Shell/ORMDocData.cs 2011-06-28 01:16:16 UTC (rev 1472) @@ -382,8 +382,41 @@ // Convert early so we can accurately check extension elements int retVal = 0; bool dontSave = false; + bool newFileItem = false; List<string> unrecognizedNamespaces = null; ORMDesignerSettings settings = ORMDesignerPackage.DesignerSettings; + XmlReaderSettings readerSettings = new XmlReaderSettings(); + readerSettings.CloseInput = false; + // New files are marked with the <?new?> processing instruction before the root element. Find it in the originally + // opened file. Note that this was originally checked with the VSHPROPID_IsNewUnsavedItem hierarchy property, + // but this is not implemented on all project types and, hence, does not return reliable information. All templates + // and wizards generating new files should add this processing instruction to avoid the 'file format change' + // warning shown below. + if (!isReload) + { + long startingPosition = inputStream.Position; + using (XmlReader reader = XmlReader.Create(inputStream, readerSettings)) + { + bool finishedReading = false; + while (!finishedReading && reader.Read()) + { + switch (reader.NodeType) + { + case XmlNodeType.Element: + finishedReading = true; + break; + case XmlNodeType.ProcessingInstruction: + if (reader.Name == "new") + { + newFileItem = true; + finishedReading = true; + } + break; + } + } + } + inputStream.Position = startingPosition; + } using (Stream convertedStream = settings.ConvertStream(inputStream, ServiceProvider)) { dontSave = convertedStream != null; @@ -392,9 +425,7 @@ Stream namespaceStrippedStream = null; try { - XmlReaderSettings readerSettings = new XmlReaderSettings(); ExtensionLoader extensionLoader = ORMDesignerPackage.ExtensionLoader; - readerSettings.CloseInput = false; Dictionary<string, ExtensionModelBinding> documentExtensions = null; using (XmlReader reader = XmlReader.Create(stream, readerSettings)) { @@ -522,13 +553,6 @@ } } } - IVsHierarchy hierarchy; - uint itemId; - object isNewObject; - bool newFileItem = null != (hierarchy = this.Hierarchy) && - VSConstants.VSITEMID_NIL != (itemId = this.ItemId) && - ErrorHandler.Succeeded(hierarchy.GetProperty(itemId, (int)__VSHPROPID.VSHPROPID_IsNewUnsavedItem, out isNewObject)) && - (bool)isNewObject; if (dontSave && !newFileItem) { string message; Modified: trunk/ORMModel/Shell/ProjectItems/CSharp.zip =================================================================== (Binary files differ) Modified: trunk/ORMModel/Shell/ProjectItems/JSharp.zip =================================================================== (Binary files differ) Modified: trunk/ORMModel/Shell/ProjectItems/Modeling.zip =================================================================== (Binary files differ) Modified: trunk/ORMModel/Shell/ProjectItems/NewFileItems/ORMModel.orm =================================================================== --- trunk/ORMModel/Shell/ProjectItems/NewFileItems/ORMModel.orm 2011-06-15 19:14:24 UTC (rev 1471) +++ trunk/ORMModel/Shell/ProjectItems/NewFileItems/ORMModel.orm 2011-06-28 01:16:16 UTC (rev 1472) @@ -1,4 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> +<?new?> <ormRoot:ORM2 xmlns:orm="http://schemas.neumont.edu/ORM/2006-04/ORMCore" xmlns:ormDiagram="http://schemas.neumont.edu/ORM/2006-04/ORMDiagram" xmlns:ormRoot="http://schemas.neumont.edu/ORM/2006-04/ORMRoot"> <orm:ORMModel id="modelId" Name="$fileinputname$"/> <ormDiagram:ORMDiagram id="diagramId" IsCompleteView="false" Name="$fileinputname$" BaseFontName="Tahoma" BaseFontSize="0.0972222238779068"> Modified: trunk/ORMModel/Shell/ProjectItems/VS2005/General.zip =================================================================== (Binary files differ) Modified: trunk/ORMModel/Shell/ProjectItems/VS2008/General.zip =================================================================== (Binary files differ) Modified: trunk/ORMModel/Shell/ProjectItems/VisualBasic.zip =================================================================== (Binary files differ) Modified: trunk/ORMModel/Shell/ProjectItems/VisualC.zip =================================================================== (Binary files differ) Modified: trunk/ORMModel/Shell/ProjectItems/Web/CSharp.zip =================================================================== (Binary files differ) Modified: trunk/ORMModel/Shell/ProjectItems/Web/JSharp.zip =================================================================== (Binary files differ) Modified: trunk/ORMModel/Shell/ProjectItems/Web/VisualBasic.zip =================================================================== (Binary files differ) Modified: trunk/Setup/NORMAItemTemplates.wxi =================================================================== --- trunk/Setup/NORMAItemTemplates.wxi 2011-06-15 19:14:24 UTC (rev 1471) +++ trunk/Setup/NORMAItemTemplates.wxi 2011-06-28 01:16:16 UTC (rev 1472) @@ -67,12 +67,10 @@ <?ifdef ModelingProjectSupport?> <Directory Id="Modeling" Name="Modeling"> <Component Id="NORMAVSProjectItemsModelingComponent" Guid="D74F0161-7C3D-4981-$(var.VersionGuidSuffix)" DiskId="1" Win64="$(var.Win64)" KeyPath="yes"> - <Condition>Installed</Condition> <File Id="Modeling.zip" Name="ORMModel.zip" Source="..\ORMModel\Shell\ProjectItems\Modeling.zip" DefaultLanguage="0" CompanionFile="ORMSolutions.ORMArchitect.Core$(var.VSExt).dll"/> </Component> <Component Id="NORMADBImportProjectItemsModelingComponent" Guid="960D82F8-25D0-4F2B-$(var.VersionGuidSuffix)" DiskId="1" Win64="$(var.Win64)" KeyPath="yes"> - <Condition>Installed</Condition> <File Id="DBImportModeling.zip" Name="ORMModelFromDatabase.zip" ShortName="DBImpMod.zip" Source="..\Tools\DatabaseImport\ProjectItems\$(var.VSShortName)\Modeling.zip" DefaultLanguage="0" CompanionFile="ORMSolutions.ORMArchitect.DatabaseImport$(var.VSExt).dll"/> </Component> Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2011-06-15 19:14:24 UTC (rev 1471) +++ trunk/Setup/Readme.htm 2011-06-28 01:16:16 UTC (rev 1472) @@ -44,7 +44,7 @@ <hr/> <h2>June 2011 CTP Changes</h2> -<div>The June 2011 CTP release includes all modifications through changeset 1471. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The June 2011 CTP release includes all modifications through changeset 1472. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li><a href="#DisplayAsObjectType 2011-06">Display Objectified Fact Type as Object Type</a> </li> <li><a href="#LinkFactTypeDisplay 2011-06">Link Fact Type Display</a> </li> @@ -74,6 +74,7 @@ <li>The meta file created by the <em>Copy Image</em> command did not have a transparent background on all versions, lines were rendered visibly different from those in the designer.</li> <li>The <em>ExpandRefMode</em> property did not work well with multiple shapes for the object type (or objectified fact type) on the same diagram. If there are multiple shapes on the diagram, the first shape to set <em>ExpandRefMode</em> to true will add the reference mode fact type and value type, and the last to clear this property will remove them. The reference mode fact type will only attach to those shapes with <em>ExpandRefMode</em> set to true.</li> <li>Multiple shapes representing a single backing element (FactType, ObjectType, etc) on the same diagram caused a null reference exception if the backing element was deleted. Duplicate shapes needed to be deleted to enable deletion of the backing element.</li> +<li>The final dialog shown by the database import wizard launched by a VB or C# project offered to disable the <em>Save</em> button to prevent data loss (caused by an inconsistent implementation of VSHPROPID_IsNewUnsavedItem across different project types). Template and wizard-generated files are now marked with a <em><?new?></em> processing instruction to avoid any project-type dependencies.</li> </ol> </li> </ul> @@ -633,8 +634,7 @@ <h3><a id="VS2010 Bugs">Unresolved issues in Visual Studio 2010</a></h3> <p>These are areas that are incomplete and known issues with Visual Studio 2010.</p> <ol> -<li>If an .orm file is opened simultaneously with more than one other file (such as when opening a solution) and is the active file immediately after load, then the ORM designer tool windows and menu items will not activate properly. Activating a second document (of any type) and reactivating the ORM designer will fix the problem. <em>This is a Visual Studio 2010 bug</em> (I can reproduce similar behavior with missing menus with one XML and one Text file).</li> -<li>The final dialog shown by the database import wizard offers to disable the <em>Save</em> button to prevent data loss. You should say No to this question. The database import wizard uses NORMA's file upgrade mechanism to load the file, and the dialog shown is meant for a file upgrade process. VS2010 is returning a 'not implemented' error for a request on the VSHPROPID_IsNewUnsavedItem property, and I know of no other way to distinguish between an imported file and a new file that uses the import mechanism (such as the DB import wizard).</li> +<li>If the .orm designer is opened simultaneously with more than one other file (such as when opening a solution) and is the active file immediately after load, then the ORM designer tool windows and menu items will not activate properly. Activating a second document (of any type) and reactivating the ORM designer will fix the problem. <em>This is a Visual Studio 2010 bug</em> (I can reproduce similar behavior with missing menus with one XML and one Text file).</li> <li>The <em>ORM Diagram Spy</em> window will occasionally go blank after extended use with multiple open ORM files. A restart of the environment is required to recover the window. If you can reliably reproduce this issue please report the scenario.</li> <li>The NORMA help files are not installed or integrated with Visual Studio 2010. [The installer merge modules used for help integration in VS2005 and VS2008 are not included with the VS2010 SDK.]</li> <li>The FrequencyConstraint and Reading shapes are larger in Visual Studio 2010.</li> Modified: trunk/Tools/DatabaseImport/DcilObjectModel.cs =================================================================== --- trunk/Tools/DatabaseImport/DcilObjectModel.cs 2011-06-15 19:14:24 UTC (rev 1471) +++ trunk/Tools/DatabaseImport/DcilObjectModel.cs 2011-06-28 01:16:16 UTC (rev 1472) @@ -58,7 +58,11 @@ schema.Namespaces.Add("dml", "http://schemas.orm.net/DIL/DMIL"); schema.Namespaces.Add("ddl", "http://schemas.orm.net/DIL/DDIL"); XmlSerializer s = new XmlSerializer(typeof(DcilSchema)); - s.Serialize(stream, schema); + using (XmlWriter writer = XmlWriter.Create(stream, new XmlWriterSettings())) + { + writer.WriteProcessingInstruction("new", ""); + s.Serialize(writer, schema); + } } /// <summary> /// Instantiates a new instance of <see cref="DcilSchema"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2011-06-15 19:14:31
|
Revision: 1471 http://orm.svn.sourceforge.net/orm/?rev=1471&view=rev Author: mcurland Date: 2011-06-15 19:14:24 +0000 (Wed, 15 Jun 2011) Log Message: ----------- * Clear invariant value instance strings when a value is changed in the sample population editor. refs #402 * Added file templates for VS2010 modeling project. refs #405 * Push revision number to June 2011. refs #193 * Fix issue with 'null reference exception' when element deleted. This occurred if multiple shapes for the same backing object were placed on the same diagram and unique connectors were attached to those shapes. Verifying that we are only relinking shapes for non-deleted objects also significantly improves the performance of the delete operation. Modified Paths: -------------- trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs trunk/ORMModel/ObjectModel/SamplePopulation.cs trunk/ORMModel/ShapeModel/ORMBaseShape.cs trunk/ORMModel/ShapeModel/ORMShape.AttachRules.cs trunk/ORMModel/ShapeModel/ORMShape.AttachRules.xml trunk/ORMModel/ShapeModel/ViewFixupRules.cs trunk/Setup/ComponentGroups.wxs trunk/Setup/Config.wxi trunk/Setup/NORMAItemTemplates.wxi trunk/Setup/Readme.htm trunk/VersionGenerator.exe.config Added Paths: ----------- trunk/ORMModel/Shell/ProjectItems/Modeling.zip trunk/Tools/DatabaseImport/ProjectItems/VS2010/Modeling.zip Modified: trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs =================================================================== --- trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs 2011-06-08 08:05:11 UTC (rev 1470) +++ trunk/ORMModel/Framework/Diagrams/MultiShapeUtility.cs 2011-06-15 19:14:24 UTC (rev 1471) @@ -434,33 +434,74 @@ } #endregion // GetEffectiveAttachedLinkShapes variants #region Link Configuration + private static readonly object DeletingSubjectsKey = new object(); /// <summary> /// Determines if the relationship should be visited, and reconfigures any links /// </summary> /// <param name="walker">The current <see cref="ElementWalker"/></param> /// <param name="sourceElement">The <see cref="ModelElement"/> being deleted</param> + /// <param name="sourceRoleInfo">The role information</param> /// <param name="domainRelationshipInfo">The relationship information</param> /// <param name="targetRelationship">The other <see cref="ModelElement"/> in the relationship</param> /// <returns>Whether to visit the relationship</returns> - public static bool ShouldVisitOnDelete(ElementWalker walker, ModelElement sourceElement, DomainRelationshipInfo domainRelationshipInfo, ElementLink targetRelationship) + public static bool ShouldVisitOnDelete(ElementWalker walker, ModelElement sourceElement, DomainRoleInfo sourceRoleInfo, DomainRelationshipInfo domainRelationshipInfo, ElementLink targetRelationship) { bool retVal = true; + Dictionary<object, object> contextDictionary; + object subjectsDictionaryObject; + Dictionary<ModelElement, object> deletingSubjectsDictionary; + ShapeElement primaryShape; + object subjectsKey; + ModelElement subject; + NodeShape sourceShape; IReconfigureableLink reconfigurableLink; - if (walker != null && - domainRelationshipInfo != null && - domainRelationshipInfo.Id == LinkConnectsToNode.DomainClassId && - null != (sourceShape = sourceElement as NodeShape) && - null != (reconfigurableLink = (targetRelationship as LinkConnectsToNode).Link as IReconfigureableLink)) + if (walker != null) { - reconfigurableLink.Reconfigure(ResolvePrimaryShape(sourceShape)); - retVal = false; + if (sourceRoleInfo != null && + sourceRoleInfo.Id == PresentationViewsSubject.SubjectDomainRoleId) + { + contextDictionary = sourceElement.Store.TransactionManager.CurrentTransaction.TopLevelTransaction.Context.ContextInfo; + if (contextDictionary.TryGetValue(subjectsKey = DeletingSubjectsKey, out subjectsDictionaryObject)) + { + deletingSubjectsDictionary = (Dictionary<ModelElement, object>)subjectsDictionaryObject; + } + else + { + contextDictionary[subjectsKey] = deletingSubjectsDictionary = new Dictionary<ModelElement, object>(); + } + deletingSubjectsDictionary[sourceElement] = null; + } + else if (domainRelationshipInfo != null && + domainRelationshipInfo.Id == LinkConnectsToNode.DomainClassId && + null != (sourceShape = sourceElement as NodeShape) && + null != (reconfigurableLink = (targetRelationship as LinkConnectsToNode).Link as IReconfigureableLink) && + null != (primaryShape = ResolvePrimaryShape(sourceShape)) && + (!sourceElement.Store.TransactionManager.CurrentTransaction.TopLevelTransaction.Context.ContextInfo.TryGetValue(DeletingSubjectsKey, out subjectsDictionaryObject) || + (null != (subject = primaryShape.ModelElement) && + !((Dictionary<ModelElement, object>)subjectsDictionaryObject).ContainsKey(subject)))) + { + reconfigurableLink.Reconfigure(primaryShape); + retVal = false; + } } return retVal; } /// <summary> + /// Remove cached data from a top-level transaction context dictionary. + /// </summary> + /// <param name="contextDictionary">The dictionary to clear.</param> + public static void ClearCachedContextInfo(Dictionary<object, object> contextDictionary) + { + object key = DeletingSubjectsKey; + if (contextDictionary.ContainsKey(key)) + { + contextDictionary.Remove(key); + } + } + /// <summary> /// The <see cref="IConfigureableLinkEndpoint.CanAttachLink"/> results have changed. /// </summary> /// <param name="shapeElement"></param> Modified: trunk/ORMModel/ObjectModel/SamplePopulation.cs =================================================================== --- trunk/ORMModel/ObjectModel/SamplePopulation.cs 2011-06-08 08:05:11 UTC (rev 1470) +++ trunk/ORMModel/ObjectModel/SamplePopulation.cs 2011-06-15 19:14:24 UTC (rev 1471) @@ -2762,7 +2762,8 @@ { if (e.DomainProperty.Id == ValueTypeInstance.ValueDomainPropertyId) { - ModelElement instance = e.ModelElement; + ValueTypeInstance instance = (ValueTypeInstance)e.ModelElement; + instance.InvariantValue = ""; // Clear the invariant value so that it can be reset when the value changes FrameworkDomainModel.DelayValidateElement(instance, DelayValidateCompatibleValueTypeInstanceValueError); FrameworkDomainModel.DelayValidateElement(instance, ObjectTypeInstance.DelayValidateNamePartChanged); } Modified: trunk/ORMModel/ShapeModel/ORMBaseShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ORMBaseShape.cs 2011-06-08 08:05:11 UTC (rev 1470) +++ trunk/ORMModel/ShapeModel/ORMBaseShape.cs 2011-06-15 19:14:24 UTC (rev 1471) @@ -861,7 +861,7 @@ /// <returns>Whether to visit the relationship</returns> public override VisitorFilterResult ShouldVisitRelationship(ElementWalker walker, ModelElement sourceElement, DomainRoleInfo sourceRoleInfo, DomainRelationshipInfo domainRelationshipInfo, ElementLink targetRelationship) { - if (MultiShapeUtility.ShouldVisitOnDelete(walker, sourceElement, domainRelationshipInfo, targetRelationship)) + if (MultiShapeUtility.ShouldVisitOnDelete(walker, sourceElement, sourceRoleInfo, domainRelationshipInfo, targetRelationship)) { return base.ShouldVisitRelationship(walker, sourceElement, sourceRoleInfo, domainRelationshipInfo, targetRelationship); } Modified: trunk/ORMModel/ShapeModel/ORMShape.AttachRules.cs =================================================================== --- trunk/ORMModel/ShapeModel/ORMShape.AttachRules.cs 2011-06-08 08:05:11 UTC (rev 1470) +++ trunk/ORMModel/ShapeModel/ORMShape.AttachRules.cs 2011-06-15 19:14:24 UTC (rev 1471) @@ -75,7 +75,7 @@ typeof(ORMBaseShape).GetNestedType("AbsoluteBoundsChangedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(ORMBaseShape).GetNestedType("ModelErrorAddedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(ORMBaseShape).GetNestedType("ModelErrorDeletingRuleClass", BindingFlags.Public | BindingFlags.NonPublic), - typeof(ClearInvalidateCacheOnCommittingRuleClass), + typeof(ClearCachesOnCommittingRuleClass), typeof(ConstraintRoleSequenceRoleAddedRuleClass), typeof(ConstraintRoleSequenceRoleDeletedRuleClass), typeof(ConstraintRoleSequencePositionChangedRuleClass), @@ -1272,10 +1272,10 @@ partial class ORMShapeDomainModel { [Microsoft.VisualStudio.Modeling.RuleOn(typeof(ORMShapeDomainModel))] - private sealed class ClearInvalidateCacheOnCommittingRuleClass : Microsoft.VisualStudio.Modeling.TransactionCommittingRule + private sealed class ClearCachesOnCommittingRuleClass : Microsoft.VisualStudio.Modeling.TransactionCommittingRule { [System.Diagnostics.DebuggerStepThrough()] - public ClearInvalidateCacheOnCommittingRuleClass() + public ClearCachesOnCommittingRuleClass() { base.IsEnabled = false; } @@ -1285,16 +1285,16 @@ /// /// <summary> /// /// TransactionCommittingRule: typeof(ORMShapeDomainModel) /// /// </summary> - /// private static void ClearInvalidateCacheOnCommittingRule(TransactionCommitEventArgs e) + /// private static void ClearCachesOnCommittingRule(TransactionCommitEventArgs e) /// { /// } /// </summary> [System.Diagnostics.DebuggerStepThrough()] public override void TransactionCommitting(Microsoft.VisualStudio.Modeling.TransactionCommitEventArgs e) { - ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleStart(e.Transaction.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ORMShapeDomainModel.ClearInvalidateCacheOnCommittingRule"); - ORMShapeDomainModel.ClearInvalidateCacheOnCommittingRule(e); - ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleEnd(e.Transaction.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ORMShapeDomainModel.ClearInvalidateCacheOnCommittingRule"); + ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleStart(e.Transaction.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ORMShapeDomainModel.ClearCachesOnCommittingRule"); + ORMShapeDomainModel.ClearCachesOnCommittingRule(e); + ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleEnd(e.Transaction.Store, "ORMSolutions.ORMArchitect.Core.ShapeModel.ORMShapeDomainModel.ClearCachesOnCommittingRule"); } } [Microsoft.VisualStudio.Modeling.RuleOn(typeof(ORMSolutions.ORMArchitect.Core.ObjectModel.ConstraintRoleSequenceHasRole), FireTime=Microsoft.VisualStudio.Modeling.TimeToFire.TopLevelCommit, Priority=Microsoft.VisualStudio.Modeling.Diagrams.DiagramFixupConstants.ResizeParentRulePriority)] Modified: trunk/ORMModel/ShapeModel/ORMShape.AttachRules.xml =================================================================== --- trunk/ORMModel/ShapeModel/ORMShape.AttachRules.xml 2011-06-08 08:05:11 UTC (rev 1470) +++ trunk/ORMModel/ShapeModel/ORMShape.AttachRules.xml 2011-06-15 19:14:24 UTC (rev 1471) @@ -160,7 +160,7 @@ </arg:DeletingRule> </arg:RuleContainer> <arg:RuleContainer class="ORMShapeDomainModel"> - <arg:TransactionCommittingRule methodName="ClearInvalidateCacheOnCommittingRule"> + <arg:TransactionCommittingRule methodName="ClearCachesOnCommittingRule"> <arg:RuleOn targetType="ORMShapeDomainModel"/> </arg:TransactionCommittingRule> <arg:AddRule methodName="ConstraintRoleSequenceRoleAddedRule"> Modified: trunk/ORMModel/ShapeModel/ViewFixupRules.cs =================================================================== --- trunk/ORMModel/ShapeModel/ViewFixupRules.cs 2011-06-08 08:05:11 UTC (rev 1470) +++ trunk/ORMModel/ShapeModel/ViewFixupRules.cs 2011-06-15 19:14:24 UTC (rev 1471) @@ -1348,14 +1348,16 @@ /// TransactionCommittingRule: typeof(ORMShapeDomainModel) /// Don't store the shape invalidation cache long term with the /// transaction log, we don't need it. + /// Also defer to the multi shape utility to clear its caches. /// </summary> - private static void ClearInvalidateCacheOnCommittingRule(TransactionCommitEventArgs e) + private static void ClearCachesOnCommittingRule(TransactionCommitEventArgs e) { Dictionary<object, object> contextDictionary = e.Transaction.Context.ContextInfo; if (contextDictionary.ContainsKey(InvalidateRequiredKey)) { contextDictionary.Remove(InvalidateRequiredKey); } + MultiShapeUtility.ClearCachedContextInfo(contextDictionary); } /// <summary> /// Get a new update counter value if one is required. Use with Added: trunk/ORMModel/Shell/ProjectItems/Modeling.zip =================================================================== (Binary files differ) Property changes on: trunk/ORMModel/Shell/ProjectItems/Modeling.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/Setup/ComponentGroups.wxs =================================================================== --- trunk/Setup/ComponentGroups.wxs 2011-06-08 08:05:11 UTC (rev 1470) +++ trunk/Setup/ComponentGroups.wxs 2011-06-15 19:14:24 UTC (rev 1471) @@ -44,6 +44,9 @@ <?ifdef JSharpSupport?> <ComponentRef Id="NORMAVSProjectItemsVWebDevJSharpComponent"/> <?endif?> + <?ifdef ModelingProjectSupport?> + <ComponentRef Id="NORMAVSProjectItemsModelingComponent"/> + <?endif?> <ComponentRef Id="NORMAVSVerbalizationComponent"/> <ComponentRef Id="NORMAVSVerbalizationCoreComponent"/> <ComponentRef Id="NORMAVSVerbalizationReportComponent"/> @@ -93,6 +96,9 @@ <?ifdef JSharpSupport?> <ComponentRef Id="NORMADBImportProjectItemsVWebDevJSharpComponent"/> <?endif?> + <?ifdef ModelingProjectSupport?> + <ComponentRef Id="NORMADBImportProjectItemsModelingComponent"/> + <?endif?> </ComponentGroup> <ComponentGroup Id="HelpFeatureComponents"> <ComponentRef Id="NORMAVSHelpComponent"/> Modified: trunk/Setup/Config.wxi =================================================================== --- trunk/Setup/Config.wxi 2011-06-08 08:05:11 UTC (rev 1470) +++ trunk/Setup/Config.wxi 2011-06-15 19:14:24 UTC (rev 1471) @@ -56,6 +56,7 @@ <?define LinqSupport=1 ?> <?define HelpFileTargetCollection="MS.VSIPCC.v100"?> <?define VSIXInstall?> + <?define ModelingProjectSupport=1 ?> <?endif?> <?define PackageCode="$(var.PackageGuidStart)-$(var.VersionGuidSuffix)"?> <!-- ProductCode should be changed for each MAJOR version. Specifically, the first and second hexits of the last section of the GUID should match the two digits of the major version.--> Modified: trunk/Setup/NORMAItemTemplates.wxi =================================================================== --- trunk/Setup/NORMAItemTemplates.wxi 2011-06-08 08:05:11 UTC (rev 1470) +++ trunk/Setup/NORMAItemTemplates.wxi 2011-06-15 19:14:24 UTC (rev 1471) @@ -64,6 +64,20 @@ </Component> </Directory> <?endif?> + <?ifdef ModelingProjectSupport?> + <Directory Id="Modeling" Name="Modeling"> + <Component Id="NORMAVSProjectItemsModelingComponent" Guid="D74F0161-7C3D-4981-$(var.VersionGuidSuffix)" DiskId="1" Win64="$(var.Win64)" KeyPath="yes"> + <Condition>Installed</Condition> + <File Id="Modeling.zip" Name="ORMModel.zip" Source="..\ORMModel\Shell\ProjectItems\Modeling.zip" + DefaultLanguage="0" CompanionFile="ORMSolutions.ORMArchitect.Core$(var.VSExt).dll"/> + </Component> + <Component Id="NORMADBImportProjectItemsModelingComponent" Guid="960D82F8-25D0-4F2B-$(var.VersionGuidSuffix)" DiskId="1" Win64="$(var.Win64)" KeyPath="yes"> + <Condition>Installed</Condition> + <File Id="DBImportModeling.zip" Name="ORMModelFromDatabase.zip" ShortName="DBImpMod.zip" Source="..\Tools\DatabaseImport\ProjectItems\$(var.VSShortName)\Modeling.zip" + DefaultLanguage="0" CompanionFile="ORMSolutions.ORMArchitect.DatabaseImport$(var.VSExt).dll"/> + </Component> + </Directory> + <?endif?> <Directory Id="VisualC" Name="VisualC"> <Component Id="NORMAVSProjectItemsVCPlusPlusComponent" Guid="16B28893-FE72-4BBF-$(var.VersionGuidSuffix)" DiskId="1" Win64="$(var.Win64)" KeyPath="yes"> <Condition>VCPLUSPLUSPACKAGEGUID OR Installed</Condition> Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2011-06-08 08:05:11 UTC (rev 1470) +++ trunk/Setup/Readme.htm 2011-06-15 19:14:24 UTC (rev 1471) @@ -3,7 +3,7 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> -<title>NORMA May 2011 CTP Readme</title> +<title>NORMA June 2011 CTP Readme</title> <style type="text/css"> .new {font-size:x-small; background-color:Gold; color:Blue; } li {padding-bottom: 3px;} @@ -12,9 +12,9 @@ <body> -<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA May 2011 CTP Readme</a> </b></p> +<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA June 2011 CTP Readme</a> </b></p> <p>This file supersedes the previous readme.txt and older readme.htm files. This readme has parallel indexing mechanisms: by topic, and by release date (starting with the October 2008 (2008-10) release). The file will be extended for future product releases.<br/><br/> -The May 2011 release includes new display features (display objectified fact types as object types, display link fact types), additional ring types with an improved editor for choosing ring types, visible zoom commands, and a number of bug fixes. See detailed change notes below for specifics. +The June 2011 release includes new display features (display objectified fact types as object types, display link fact types), additional ring types with an improved editor for choosing ring types, visible zoom commands, and a number of bug fixes. See detailed change notes below for specifics. <br/><br/></p> <h2>Contents</h2> <ul> @@ -43,19 +43,20 @@ </ul>--> <hr/> -<h2>May 2011 CTP Changes</h2> -<div>The May 2011 CTP release includes all modifications through changeset 1470. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<h2>June 2011 CTP Changes</h2> +<div>The June 2011 CTP release includes all modifications through changeset 1471. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> -<li><a href="#DisplayAsObjectType 2011-05">Display Objectified Fact Type as Object Type</a> </li> -<li><a href="#LinkFactTypeDisplay 2011-05">Link Fact Type Display</a> </li> -<li><a href="#NewRingConstraintFeatures 2011-05">New Ring Constraint Types and Editor</a> </li> -<li><a href="#ZoomCommands 2011-05">Zoom Commands</a> </li> -<li><a href="#ZoomSensitiveNudge 2011-05">Zoom Sensitive Nudge Distance</a> </li> +<li><a href="#DisplayAsObjectType 2011-06">Display Objectified Fact Type as Object Type</a> </li> +<li><a href="#LinkFactTypeDisplay 2011-06">Link Fact Type Display</a> </li> +<li><a href="#NewRingConstraintFeatures 2011-06">New Ring Constraint Types and Editor</a> </li> +<li><a href="#ZoomCommands 2011-06">Zoom Commands</a> </li> +<li><a href="#ZoomSensitiveNudge 2011-06">Zoom Sensitive Nudge Distance</a> </li> <li>Other Features: <ol> <li>Simultaneously selecting an object type shapes and a connected subtype connector link is no longer supported: the subtype connector link will be automatically deselected in this case. This makes it much easier to lasso select and align shapes attached to subtype and supertype connectors.</li> -<li>Changes resulting in a size change for object type and fact type shapes will maintain the center point instead of the upper-left corner. This should reduce the number of alignment commands required when changing shape object type and reference mode names, or any other change that affects the size of the shape.</li> +<li>Changes resulting in a size change for object type and fact type shapes will maintain the shape's center point instead of the upper-left corner. This should reduce the number of alignment commands required when changing shape object type and reference mode names, or any other change that affects the size of the shape.</li> <li>Tooltips on foreign key lines in the relational view display table names with the column names.</li> +<li>(VS2010) Setup adds item templates for the Modeling project type.</li> </ol> </li> <li>Bug Fixes: @@ -68,9 +69,11 @@ <li>Selecting an ObjectType reference inside a group element crashed the Properties Window.</li> <li>Fact type shapes with constraint role bar display failed with multiple shapes for the same fact type on the same diagram.</li> <li>Objectified fact types did not synchronize the object type and default fact type name in the target model after a cross-model drag of the objectified fact type.</li> +<li>Sample population values did not appear to change, always displayed original invariant value.</li> <li>Sample population editor crashed adding new supertype instances in an empty inline-expanded subtype cell.</li> <li>The meta file created by the <em>Copy Image</em> command did not have a transparent background on all versions, lines were rendered visibly different from those in the designer.</li> <li>The <em>ExpandRefMode</em> property did not work well with multiple shapes for the object type (or objectified fact type) on the same diagram. If there are multiple shapes on the diagram, the first shape to set <em>ExpandRefMode</em> to true will add the reference mode fact type and value type, and the last to clear this property will remove them. The reference mode fact type will only attach to those shapes with <em>ExpandRefMode</em> set to true.</li> +<li>Multiple shapes representing a single backing element (FactType, ObjectType, etc) on the same diagram caused a null reference exception if the backing element was deleted. Duplicate shapes needed to be deleted to enable deletion of the backing element.</li> </ol> </li> </ul> @@ -353,7 +356,7 @@ <li><a id="DiagramTabHoverActivation 2010-12" class="new" title="December 2010 CTP: Diagram Tab Hover Activation">2010-12</a> Hovering over a diagram tab (at the bottom of the designer) during any drag operation will activate that diagram. Hovering over the left edge of the leftmost tab will scroll the diagrams to the left. Combined with the Visual Studio support for activating a file by hovering over the file tabe and bump scrolling within a diagram, this makes it much easier to drag items between models and copy shapes within models. Without this support, cross-diagram drag required both the source and target diagrams to be visible in either multiple document windows or the <em>Diagram Spy</em> tool window. </li> -<li><a id="ZoomCommands 2011-05" class="new" title="May 2011 CTP: Zoom Commands">2011-05</a> +<li><a id="ZoomCommands 2011-06" class="new" title="June 2011 CTP: Zoom Commands">2011-06</a> A Zoom submenu enables zooming to a specific percentage or with incremental zoom in/zoom out commands. There are corresponding mouse gestures and hotkeys cooresponding to these commands. All of these commands work with 'Control-Shift' modifiers. Pressing control-shift will change the designer cursor to a magnifying glass, indicating zoom.<br />Mouse and keyboard zoom commands: <ul> <li><strong>Zoom In: </strong>Control-Shift-PlusKey, Control-Shift-LeftClick, Control-MouseWheel, Control-Shift-MouseWheel</li> @@ -362,7 +365,7 @@ <li><strong>Scroll: </strong>MouseWheel for vertical scroll, Shift-MouseWheel for horizontal scroll.</li> </ul> </li> -<li><a id="ZoomSensitiveNudge 2011-05" class="new" title="May 2011 CTP: Zoom Sensitive Nudge Distance">2011-05</a> +<li><a id="ZoomSensitiveNudge 2011-06" class="new" title="June 2011 CTP: Zoom Sensitive Nudge Distance">2011-06</a> Keyboard nudging of selected shapes depends on the zoom level. At maximum zoom (400%) the keyboard nudge distance is very small with the intent of allowing extremely fine-grained shape alignment. The nudge distance is fixed from 10% to 100% zoom, at which point it linearly decreases to the fine-grained setting at maximum zoom. </li> </ol> @@ -517,9 +520,9 @@ <li><a id="Value Constraint Special String Characters 2010-02" class="new" title="February 2010 CTP: Value constraint special string characters">2010-02</a> Special delimiter characters used in value constraint definitions can be specified inside single-quotation characters. For example, <em>a,b,c</em> for a string data type is parsed and listed back as <em>{'a', 'b', 'c'}</em>, while <em>'a,b,c'</em> is treated as a single string value. Use two adjacent single quotes to represent a single quote in a string (<em>'''abc'''</em> represents the string <em>'abc'</em>), and use <em>''</em> to represent the empty string. </li> -<li><a id="DisplayAsObjectType 2011-05" class="new" title="May 2011 CTP: Display Objectified Fact Type as Object Type">2011-05</a> +<li><a id="DisplayAsObjectType 2011-06" class="new" title="June 2011 CTP: Display Objectified Fact Type as Object Type">2011-06</a> The <em>DisplayAsObjectType</em> property on a shape for an objectified fact type enables uncluttered use of the objectified fact type as an entity type. The display is exactly the same as an object type shape with name and reference mode fields, except that a miniature role box to the left of the text fields indicates the objectifying nature of the entity type and the arity of the objectified fact type. Other shapes attached to the fact type (reading shapes, role value constraints, role name shapes, and the name shape for the objectified entity type) are removed from the diagram and recreated when <em>DisplayAsObjectType</em> is changed from true to false.</li> -<li><a id="LinkFactTypeDisplay 2011-05" class="new" title="May 2011 CTP: Link Fact Type Display">2011-05</a> +<li><a id="LinkFactTypeDisplay 2011-06" class="new" title="June 2011 CTP: Link Fact Type Display">2011-06</a> <em>Link fact types</em> represent the relationship between an objectifying entity type and each of the role players of its objectified fact type. A link fact type is implied and automatically create by NORMA for each role in an objectified fact type. Readings for these fact types can be modified in the 'Implied Fact Types' branch of the 'ORM Reading Editor' tool window when a single role is selected in an objectified fact type. Readings can also be modified by selecting the fact type in the 'ORM Model Browser' tool window and expanding the 'Implied Fact Types' child node. In most cases there is no need to display these fact types. However, it is not uncommon for the objectifying-entity-type-attached role to participate in a set comparison constraint. Shapes are never automatically generated for link fact types, but an explicit shape can be added by dragging an implied fact type node from the model browser.<br /> Notes on link fact type shapes: <ul> @@ -531,7 +534,7 @@ <li>Some other editing actions are unavailable for far roles on link fact types (group operations, for example). The primary reason to show these is to attach constraints to the objectified roles, and this scenario is satisfied without full editing capabilities on the far roles.</li> </ul> </li> -<li><a id="NewRingConstraintFeatures 2011-05" class="new" title="May 2011 CTP: New Ring Constraint Types and Editor">2011-05</a> +<li><a id="NewRingConstraintFeatures 2011-06" class="new" title="June 2011 CTP: New Ring Constraint Types and Editor">2011-06</a> Three new ring types and corresponding combinations provide additional positive ring possibilities and a stronger form of intransitivity. The new values are: <ul> <li><em>Transitive</em> requires the transitive closure of the item to be provided. If A plays B and B plays C then A must play C. The display is the same as <em>intransitive</em> without the tick mark at the bottom of the triangle.</li> @@ -542,10 +545,10 @@ <ul> <li>A bold and checked item is part of the current selection.</li> <li>A bold item that is not checked is compatible with the current selection and can be added without reducing the current selection.</li> -<li>A gray-checked item (never bolded) is implied by the current selection. This provides a useful reminders of how the ring types compose. For example, <em>asymmetric</em> implies <em>irreflexive</em> and <em>antisymmetric</em>.</li> +<li>A gray-checked item (never bolded) is implied by the current selection. This provides a useful reminder of how the ring types compose. For example, <em>asymmetric</em> implies <em>irreflexive</em> and <em>antisymmetric</em>.</li> <li>Ring types are ordered by negative followed by positive (<em>reflexive</em>, <em>symmetric</em>, and <em>transitive</em> are positive types). The negative items are ordered by the somewhat subjective notion of <em>strength</em>, starting with the weakest ring type (<em>irreflexive</em>).</li> </ul> -Designing consistent glyphs for the new combinations required some minor display modifications: the tick mark for <em>irreflexive</em> has been moved opposite the dot, the interior circle for <em>symmetric+irreflexive</em> has been moved to the left edge of the symmetric oval and shares the left dot, and an interior tick mark has been added to <em>purely reflexive</em> to distinguish it from <em>reflexive</em> and indicate the <em>and no other</em> part of this ring type. +Designing consistent glyphs for the new combinations required some minor display modifications to published ring display: the tick mark for <em>irreflexive</em> has been moved from the bottom of the shape to directly opposite the dot, the interior circle for <em>symmetric+irreflexive</em> has been moved to the left edge of the symmetric oval and shares the left dot, and an interior tick mark has been added to <em>purely reflexive</em> to distinguish it from <em>reflexive</em> and visually indicate the <em>and no other</em> part of this ring type. </li> </ol> <a href="#The Top">Return to top</a> @@ -631,6 +634,7 @@ <p>These are areas that are incomplete and known issues with Visual Studio 2010.</p> <ol> <li>If an .orm file is opened simultaneously with more than one other file (such as when opening a solution) and is the active file immediately after load, then the ORM designer tool windows and menu items will not activate properly. Activating a second document (of any type) and reactivating the ORM designer will fix the problem. <em>This is a Visual Studio 2010 bug</em> (I can reproduce similar behavior with missing menus with one XML and one Text file).</li> +<li>The final dialog shown by the database import wizard offers to disable the <em>Save</em> button to prevent data loss. You should say No to this question. The database import wizard uses NORMA's file upgrade mechanism to load the file, and the dialog shown is meant for a file upgrade process. VS2010 is returning a 'not implemented' error for a request on the VSHPROPID_IsNewUnsavedItem property, and I know of no other way to distinguish between an imported file and a new file that uses the import mechanism (such as the DB import wizard).</li> <li>The <em>ORM Diagram Spy</em> window will occasionally go blank after extended use with multiple open ORM files. A restart of the environment is required to recover the window. If you can reliably reproduce this issue please report the scenario.</li> <li>The NORMA help files are not installed or integrated with Visual Studio 2010. [The installer merge modules used for help integration in VS2005 and VS2008 are not included with the VS2010 SDK.]</li> <li>The FrequencyConstraint and Reading shapes are larger in Visual Studio 2010.</li> @@ -648,14 +652,14 @@ <a href="#The Top">Return to top</a> <hr/> <h3><a id="Version Numbers">Version Numbers</a></h3> -<p>The NORMA version numbering scheme was changed in January 2011 to make better use of the available build numbers. A build number (for example, 1.0.1105.6267) has four parts separated by periods (.): Major (1), Minor (0), Revision (1105), and Build (6267). The first two numbers are self-explanatory. The third <em>revision</em> number is the last two digits of the year combined with the month number (1105=May 2011). The revision number is explicitly configured in the source code and generally changed once per official release. The final number is a build number that encodes the day the file was built.</p> +<p>The NORMA version numbering scheme was changed in January 2011 to make better use of the available build numbers. A build number (for example, 1.0.1106.6281) has four parts separated by periods (.): Major (1), Minor (0), Revision (1106), and Build (6281). The major and minor numbers are self-explanatory. The third <em>revision</em> number is the last two digits of the year combined with the month number (1106=June 2011). The revision number is explicitly configured in the source code and generally changed once per official release. The final number is a build number that encodes the day the file was built.</p> <p>Originally, the first two digits of the build number were a month counter beginning at 01 in January 2006, with the last two digits representing the day in the month. So, build 6031 was created on day 31 of month 60 (December 31, 2010). Starting with January 2011 (month 61), the first two digits will only be incremented on a <strong>quarterly</strong> basis, effectively tripling the available remaining revision 4-digit revision numbers. Of course, the day numbers for the three months in a quarter cannot all begin with '1', so we partition as follows:</p> <ul> <li>The first month in each quarter (January, April, July, October) gets the range 1-31 (subtract 0 to get the day).</li> -<li>The second month in each quarter (February, May, August, November) gets the range 32-64 (subtract 33 to get the day).</li> -<li>The third month in each quarter (March, June, September, December) gets the range 37-97 (subtract 66 to get the day).</li> +<li>The second month in each quarter (February, May, August, November) gets the range 34-64 (subtract 33 to get the day).</li> +<li>The third month in each quarter (March, June, September, December) gets the range 67-97 (subtract 66 to get the day).</li> </ul> -<p>So, build 6267 represents the first day of the third month in the second quarter of 2011 (June 1, 2011).</p> +<p>So, build 6281 represents the fifteenth day of the third month in the second quarter of 2011 (June 15, 2011).</p> <p>Although the version information does not directly contain any source code version control information, the build date can generally be cross-referenced against the revision history to find the corresponding changeset.</p> <a href="#The Top">Return to top</a></body> </html> Added: trunk/Tools/DatabaseImport/ProjectItems/VS2010/Modeling.zip =================================================================== (Binary files differ) Property changes on: trunk/Tools/DatabaseImport/ProjectItems/VS2010/Modeling.zip ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: trunk/VersionGenerator.exe.config =================================================================== --- trunk/VersionGenerator.exe.config 2011-06-08 08:05:11 UTC (rev 1470) +++ trunk/VersionGenerator.exe.config 2011-06-15 19:14:24 UTC (rev 1471) @@ -2,7 +2,7 @@ <configuration> <appSettings> <add key="RevisionStartYearMonth" value="2006-01"/> - <add key="ReleaseYearMonth" value="2011-05"/> + <add key="ReleaseYearMonth" value="2011-06"/> <add key="CountQuartersFromYearMonth" value="2011-01"/> <!-- ReleaseType: "CTP" or "RTM" --> <add key="ReleaseType" value="CTP"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2011-04-30 17:25:02
|
Revision: 1466 http://orm.svn.sourceforge.net/orm/?rev=1466&view=rev Author: mcurland Date: 2011-04-30 17:24:56 +0000 (Sat, 30 Apr 2011) Log Message: ----------- Modify selection rules to deselect selectable link shapes (subtype and model note connectors) when the endpoint shapes are also selected. Stops lasso select from choosing subtype links as the primary selection. Modified Paths: -------------- trunk/ORMModel/ShapeModel/ORMDiagram.cs Modified: trunk/ORMModel/ShapeModel/ORMDiagram.cs =================================================================== --- trunk/ORMModel/ShapeModel/ORMDiagram.cs 2011-04-13 01:35:27 UTC (rev 1465) +++ trunk/ORMModel/ShapeModel/ORMDiagram.cs 2011-04-30 17:24:56 UTC (rev 1466) @@ -2069,6 +2069,210 @@ return null; } #endregion // Other base overrides + #region Selection Rules + /// <summary> + /// A class to limit the selection of link shapes when + /// the connected shapes are also selected. This is specifically + /// targeted at subtype connectors, which otherwise become + /// the primary selection in a lasso select of the subtype and + /// supertype shapes. + /// </summary> + private class LimitLinkShapeSelectionRules : DiagramSelectionRules + { + private ORMDiagram myDiagram; + private DiagramSelectionRules myDeferToRules; + /// <summary> + /// Create a new <see cref="LimitLinkShapeSelectionRules"/> object + /// </summary> + /// <param name="diagram">The context diagram</param> + /// <param name="deferToRules">The base rules used for initial collection modification.</param> + public LimitLinkShapeSelectionRules(ORMDiagram diagram, DiagramSelectionRules deferToRules) + { + myDiagram = diagram; + myDeferToRules = deferToRules; + } + /// <summary> + /// Limit selection + /// </summary> + public override bool GetCompliantSelection(SelectedShapesCollection currentSelection, DiagramItemCollection proposedItemsToAdd, DiagramItemCollection proposedItemsToRemove, DiagramItem primaryItem) + { + bool retVal = myDeferToRules.GetCompliantSelection(currentSelection, proposedItemsToAdd, proposedItemsToRemove, primaryItem); + int addCount; + if (retVal && + 0 != (addCount = proposedItemsToAdd.Count)) + { + Dictionary<ShapeElement, object> endpointTracker = null; + Dictionary<LinkShape, int> linkIndices = null; // Positive means in add collection and included, MaxValue indicates in current selection, ~index (negative value) indicates remove required + Dictionary<LinkShape, DiagramItem> currentLinks = null; // Selected shapes collection is not indexed, track the DiagramItem for current items that need to be removed. + bool firstSet = true; + int linkIndex = 0; + LinkShape linkShape; + ShapeElement selectedShape; + object tracked; + LinkedNode<DiagramItem> trackedNode; + DiagramItem trackedItem; + ICollection[] itemCollections = new ICollection[] { proposedItemsToAdd, currentSelection }; + foreach (ICollection itemSet in itemCollections) + { + foreach (DiagramItem item in itemSet) + { + IProxyConnectorShape connectorShape; + if (item.SubField == null && + null != (linkShape = item.Shape as LinkShape)) + { + if (linkIndices == null) + { + linkIndices = new Dictionary<LinkShape, int>(); + } + if (firstSet) + { + linkIndices[linkShape] = linkIndex; + } + else + { + linkIndices[linkShape] = int.MaxValue; + (currentLinks ?? (currentLinks = new Dictionary<LinkShape,DiagramItem>()))[linkShape] = item; + } + foreach (NodeShape nodeShape in LinkConnectsToNode.GetNodes(linkShape)) + { + selectedShape = (null != (connectorShape = nodeShape as IProxyConnectorShape)) ? connectorShape.ProxyConnectorShapeFor : nodeShape; + if ((endpointTracker ?? (endpointTracker = new Dictionary<ShapeElement,object>())).TryGetValue(selectedShape, out tracked)) + { + if (null != (trackedItem = tracked as DiagramItem)) + { + trackedNode = new LinkedNode<DiagramItem>(trackedItem); + trackedNode.SetNext(new LinkedNode<DiagramItem>(item), ref trackedNode); + endpointTracker[selectedShape] = trackedNode; + } + else + { + trackedNode = (LinkedNode<DiagramItem>)tracked; + trackedNode.GetTail().SetNext(new LinkedNode<DiagramItem>(item), ref trackedNode); + } + } + else + { + endpointTracker.Add(selectedShape, item); + } + } + } + ++linkIndex; + } + firstSet = false; + } + if (null != endpointTracker) + { + // Do no further processing to track removed links + foreach (DiagramItem item in proposedItemsToRemove) + { + if (item.SubField == null && + null != (linkShape = item.Shape as LinkShape) && + linkIndices.ContainsKey(linkShape)) + { + linkIndices.Remove(linkShape); + } + } + + // Walk both collections to see if link endpoints need to be removed + int removedCount = 0; + foreach (ICollection itemSet in itemCollections) + { + foreach (DiagramItem item in itemSet) + { + if (item.SubField == null && + null != (selectedShape = item.Shape) && + endpointTracker.TryGetValue(selectedShape, out tracked)) + { + if (null != (trackedItem = tracked as DiagramItem)) + { + linkShape = (LinkShape)trackedItem.Shape; + if (linkIndices.TryGetValue(linkShape, out linkIndex) && + linkIndex >= 0) + { + ++removedCount; + linkIndices[linkShape] = ~linkIndex; + } + } + else + { + trackedNode = (LinkedNode<DiagramItem>)tracked; + while (null != trackedNode) + { + trackedItem = trackedNode.Value; + // Same as code for single item above + linkShape = (LinkShape)trackedItem.Shape; + if (linkIndices.TryGetValue(linkShape, out linkIndex) && + linkIndex >= 0) + { + ++removedCount; + linkIndices[linkShape] = ~linkIndex; + } + + trackedNode = trackedNode.Next; + } + } + } + } + } + if (removedCount != 0) + { + List<int> removedIndices = null; + foreach (KeyValuePair<LinkShape, int> pair in linkIndices) + { + int removeIndex = pair.Value; + if (removeIndex < 0) + { + if (removeIndex == int.MinValue) + { + trackedItem = currentLinks[pair.Key]; + if (!proposedItemsToRemove.Contains(trackedItem)) + { + proposedItemsToRemove.Add(trackedItem); + } + } + else + { + (removedIndices ?? (removedIndices = new List<int>())).Add(removeIndex); + } + } + } + if (null != removedIndices) + { + int removeCount = removedIndices.Count; + if (removeCount > 1) + { + removedIndices.Sort(); + } + for (int i = 0; i < removeCount; ++i) + { + proposedItemsToAdd.RemoveAt(~removedIndices[i]); + } + } + } + } + retVal = proposedItemsToAdd.Count != 0 || proposedItemsToRemove.Count != 0; + } + return retVal; + } + } + private DiagramSelectionRules mySelectionRules; + /// <summary> + /// Modify selection algorithm to automatically deselect connector + /// lines when either of the endpoint shapes are also selected. + /// </summary> + public override DiagramSelectionRules SelectionRules + { + get + { + DiagramSelectionRules retVal = mySelectionRules; + if (retVal == null) + { + mySelectionRules = retVal = new LimitLinkShapeSelectionRules(this, base.SelectionRules); + } + return retVal; + } + } + #endregion // Selection Rules #region Accessibility Properties /// <summary> /// Return the class name as the accessible name This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-10-26 07:45:42
|
Revision: 1463 http://orm.svn.sourceforge.net/orm/?rev=1463&view=rev Author: mcurland Date: 2010-10-26 07:45:34 +0000 (Tue, 26 Oct 2010) Log Message: ----------- * Unguarded cross-model merge rule was creating two link fact types on unary objectification, model would not reload. refs #403 * Automatic join paths failing with constrained roles on the same role player of fully symmetric binary fact types (both role players the same). Favor the role away from the join. Adjustment of [1460]. refs #395 * Shape placement of automatically-created shapes during cross-model merge is not respecting the specified element creation. Modified Paths: -------------- trunk/ORMModel/Framework/CopyMergeServices.cs trunk/ORMModel/ObjectModel/Constraint.cs trunk/ORMModel/ObjectModel/Objectification.cs trunk/ORMModel/ShapeModel/ORMDiagram.cs Modified: trunk/ORMModel/Framework/CopyMergeServices.cs =================================================================== --- trunk/ORMModel/Framework/CopyMergeServices.cs 2010-10-22 20:52:58 UTC (rev 1462) +++ trunk/ORMModel/Framework/CopyMergeServices.cs 2010-10-26 07:45:34 UTC (rev 1463) @@ -1678,14 +1678,17 @@ if (copy.CopyType == CopiedElementType.Existing) { ModelElement copyElement = copy.Element; - PropertyAssignment[] propertyAssignments = GetCopiedPropertyAssignments(copyClosure[pair.Key].Element, copyElement); - if (propertyAssignments != null) + if (!copyElement.IsDeleted) { - // Update the element with new property assignments - for (int i = 0; i < propertyAssignments.Length; ++i) + PropertyAssignment[] propertyAssignments = GetCopiedPropertyAssignments(copyClosure[pair.Key].Element, copyElement); + if (propertyAssignments != null) { - PropertyAssignment assignment = propertyAssignments[i]; - targetDataDirectory.GetDomainProperty(assignment.PropertyId).SetValue(copyElement, assignment.Value); + // Update the element with new property assignments + for (int i = 0; i < propertyAssignments.Length; ++i) + { + PropertyAssignment assignment = propertyAssignments[i]; + targetDataDirectory.GetDomainProperty(assignment.PropertyId).SetValue(copyElement, assignment.Value); + } } } } Modified: trunk/ORMModel/ObjectModel/Constraint.cs =================================================================== --- trunk/ORMModel/ObjectModel/Constraint.cs 2010-10-22 20:52:58 UTC (rev 1462) +++ trunk/ORMModel/ObjectModel/Constraint.cs 2010-10-26 07:45:34 UTC (rev 1463) @@ -5370,8 +5370,14 @@ matchedRightRole = testRightRole; matchedRightRoleAlternateEntryConstraintRoleIndex = testRightRoleAlternateEntryConstraintRoleIndex; } - else + else if (matchedRightRoleAlternateEntryConstraintRoleIndex != -1 && matchedLeftRole == null) { + // Prefer the opposite role over the alternate entry through the constraint role + matchedRightRole = testRightRole; + matchedRightRoleAlternateEntryConstraintRoleIndex = -1; + } + else if (testRightRoleAlternateEntryConstraintRoleIndex == -1) + { incompleteOrAmbiguousPath = true; break; } @@ -5520,8 +5526,15 @@ matchedRightRole = testRightRole; matchedRightRoleAlternateEntryConstraintRoleIndex = testRightRoleAlternateEntryConstraintRoleIndex; } - else + else if (matchedRightRoleAlternateEntryConstraintRoleIndex != -1) { + // Always prefer the opposite role over the near role + matchedLeftRole = testLeftRole; + matchedRightRole = testRightRole; + matchedRightRoleAlternateEntryConstraintRoleIndex = -1; + } + else if (testRightRoleAlternateEntryConstraintRoleIndex == -1) + { incompleteOrAmbiguousPath = true; break; } Modified: trunk/ORMModel/ObjectModel/Objectification.cs =================================================================== --- trunk/ORMModel/ObjectModel/Objectification.cs 2010-10-22 20:52:58 UTC (rev 1462) +++ trunk/ORMModel/ObjectModel/Objectification.cs 2010-10-26 07:45:34 UTC (rev 1463) @@ -334,14 +334,25 @@ /// </summary> private static void ObjectificationAddedRule(ElementAddedEventArgs e) { - ProcessObjectificationAdded((Objectification)e.ModelElement, null, null); + ModelElement element = e.ModelElement; + if (CopyMergeUtility.GetIntegrationPhase(element.Store) == CopyClosureIntegrationPhase.Integrating) + { + return; + } + ProcessObjectificationAdded((Objectification)element, null, null); } /// <summary> /// AddRule: typeof(Objectification), FireTime=LocalCommit, Priority=FrameworkDomainModel.CopyClosureExpansionCompletedRulePriority; /// </summary> private static void ObjectificationAddedClosureRule(ElementAddedEventArgs e) { - ProcessObjectificationAdded((Objectification)e.ModelElement, null, null); + ModelElement element = e.ModelElement; + if (element.IsDeleted || + CopyMergeUtility.GetIntegrationPhase(element.Store) != CopyClosureIntegrationPhase.IntegrationComplete) + { + return; + } + ProcessObjectificationAdded((Objectification)element, null, null); } /// <summary> /// Create implied facts and constraints as needed @@ -352,11 +363,6 @@ private static void ProcessObjectificationAdded(Objectification objectification, FactType nestedFactType, ObjectType nestingType) { Store store = objectification.Store; - if (objectification.IsDeleted || - CopyMergeUtility.GetIntegrationPhase(store) == CopyClosureIntegrationPhase.Integrating) - { - return; - } if (nestedFactType == null) { nestedFactType = objectification.NestedFactType; @@ -400,19 +406,31 @@ for (int i = 0; i < roleCount; ++i) { Role role = roles[i].Role; - RoleProxy proxy = role.Proxy; - if (proxy == null) + RoleProxy proxy; + ObjectifiedUnaryRole objectifiedUnaryRole; + if (unaryRole == null) { - if (unaryRole == null || role == unaryRole) + objectifiedUnaryRole = null; + proxy = role.Proxy; + } + else + { + if (unaryRole != role) { - CreateImpliedFactTypeForRole(model, nestingType, role, objectification, unaryRole != null); + continue; } + objectifiedUnaryRole = unaryRole.ObjectifiedUnaryRole; + proxy = null; } + if (proxy == null && objectifiedUnaryRole == null) + { + CreateImpliedFactTypeForRole(model, nestingType, role, objectification, unaryRole != null); + } else { RoleBase oppositeRoleBase; Role oppositeRole; - if (null != (oppositeRoleBase = proxy.OppositeRole) && + if (null != (oppositeRoleBase = ((RoleBase)proxy ?? objectifiedUnaryRole).OppositeRole) && null != (oppositeRole = oppositeRoleBase as Role) && (nestingType != oppositeRole.RolePlayer)) { @@ -538,7 +556,8 @@ { oldFactType = (FactType)e.OldRolePlayer; } - RuleManager ruleManager = link.Store.RuleManager; + Store store = link.Store; + RuleManager ruleManager = store.RuleManager; try { ruleManager.DisableRule(typeof(RoleDeletingRuleClass)); @@ -549,6 +568,11 @@ ruleManager.EnableRule(typeof(RoleDeletingRuleClass)); } ProcessObjectificationDeleting(link, oldFactType, oldObjectType); + // UNDONE: COPYMERGE Element equivalence does not produce an + // objectification role player change, it just equates the old + // object type with the new one. If this changes (as it probably + // should to handle objectification change scenarios) then we will + // need to check merge state here. ProcessObjectificationAdded(link, null, null); } #endregion // ObjectificationRolePlayerChangedRule Modified: trunk/ORMModel/ShapeModel/ORMDiagram.cs =================================================================== --- trunk/ORMModel/ShapeModel/ORMDiagram.cs 2010-10-22 20:52:58 UTC (rev 1462) +++ trunk/ORMModel/ShapeModel/ORMDiagram.cs 2010-10-26 07:45:34 UTC (rev 1463) @@ -380,6 +380,19 @@ if (clearContext) { DropTargetContext.Remove(transaction.TopLevelTransaction); + NodeShape nodeShape; + if (null != (nodeShape = shapeElement as NodeShape) && + nodeShape.Location.IsEmpty) + { + // Backup plan if the location doesn't take. This can + // happen if an element is being automatically created + // during the drop of another shape element, such as + // during cross-model drops. In this case, the design + // surface merge context is set, this shape is not + // considered root element, and the drop target context + // location is ignored by ShapeElement.PlaceChildShapeUsingContext + nodeShape.Location = elementPosition; + } } if (shapeElement != null) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-10-22 20:53:05
|
Revision: 1462 http://orm.svn.sourceforge.net/orm/?rev=1462&view=rev Author: mcurland Date: 2010-10-22 20:52:58 +0000 (Fri, 22 Oct 2010) Log Message: ----------- * Add (non-displayed) uniqueness constraint verbalization to unary fact type verbalization * Fix crashing role path scenario with objectification deletion. refs #403 Modified Paths: -------------- trunk/ORMModel/ObjectModel/FactType.cs trunk/ORMModel/ObjectModel/RolePath.cs trunk/ORMModel/ObjectModel/Verbalization.cs trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs Modified: trunk/ORMModel/ObjectModel/FactType.cs =================================================================== --- trunk/ORMModel/ObjectModel/FactType.cs 2010-10-20 20:51:14 UTC (rev 1461) +++ trunk/ORMModel/ObjectModel/FactType.cs 2010-10-22 20:52:58 UTC (rev 1462) @@ -2675,7 +2675,8 @@ bool lookForCombined = !isNegative && Shell.OptionsPage.CurrentCombineMandatoryAndUniqueVerbalization; LinkedElementCollection<RoleBase> factRoles = RoleCollection; - bool isUnaryFactType = FactType.GetUnaryRoleIndex(factRoles).HasValue; + int? unaryRoleIndex = FactType.GetUnaryRoleIndex(factRoles); + bool isUnaryFactType = unaryRoleIndex.HasValue; if (!isUnaryFactType && 2 == factRoles.Count) { Role[] roles = new Role[2]; @@ -2904,6 +2905,16 @@ } } } + else + { + // Verbalize the uniqueness constraint on the unary role + UniquenessConstraint constraint; + if (null != (constraint = factRoles[unaryRoleIndex.Value].Role.SingleRoleAlethicUniquenessConstraint) && + (filter == null || !filter.FilterChildVerbalizer(constraint, sign).IsBlocked)) + { + yield return CustomChildVerbalizer.VerbalizeInstance((IVerbalize)constraint); + } + } } // Verbalize other single-facttype set constraints Modified: trunk/ORMModel/ObjectModel/RolePath.cs =================================================================== --- trunk/ORMModel/ObjectModel/RolePath.cs 2010-10-20 20:51:14 UTC (rev 1461) +++ trunk/ORMModel/ObjectModel/RolePath.cs 2010-10-22 20:52:58 UTC (rev 1462) @@ -2932,6 +2932,7 @@ if (previousPathedRole == null) { pushFactType = currentFactType; + hasSameFactTypeWithoutJoinError = true; } else { Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2010-10-20 20:51:14 UTC (rev 1461) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2010-10-22 20:52:58 UTC (rev 1462) @@ -6229,7 +6229,7 @@ } } } - if (!sameFactType) + if (!sameFactType || contextPathNode.PathedRole == null) { // Unwind the stack roleUseBaseIndex = PopFactType(factTypeRolesStack, ref roleUseTracker); @@ -6254,8 +6254,20 @@ } if (sameFactType) { - if (currentPathedRoleIndex == 0) + if (contextPathNode.PathedRole == null) { + // Error condition, missing an entry role, push the fact type + // so the stack does not get out of balance. + currentRole = currentPathedRole.Role; + roleUseBaseIndex = PushFactType(currentRole.FactType, currentPathedRole, currentPathedRoles, currentPathedRoleIndex, factTypeRolesStack, ref roleUseTracker, pathConditions, ref processedPathConditions, ref pendingRequiredVariableKeys); + resolvedRoleIndex = ResolveRoleIndex(factTypeRolesStack.Peek(), currentRole); + if (resolvedRoleIndex != -1) // Defensive, guard against bogus path + { + roleUseTracker[roleUseBaseIndex + resolvedRoleIndex] = true; + } + } + else if (currentPathedRoleIndex == 0) + { #region Lead same fact type condition processing // Get the chain node we just pushed VerbalizationPlanNode contextChainNode = myCurrentBranchNode; Modified: trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml 2010-10-20 20:51:14 UTC (rev 1461) +++ trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml 2010-10-22 20:52:58 UTC (rev 1462) @@ -64,7 +64,7 @@ <Snippet type="OneQuantifier" sign="negative"><![CDATA[<span class="quantifier">more than one</span> {0}]]></Snippet> - <Snippet type="OccursInPopulation" sign="positive"><![CDATA[<span class="quantifier">in each population of</span> {1}<span class="quantifier">, </span>{0} <span class="quantifier">occurs at most once</span>]]></Snippet> + <Snippet type="OccursInPopulation" sign="positive"><![CDATA[<span class="quantifier">in each population of</span> {1}<span class="listSeparator">, </span>{0} <span class="quantifier">occurs at most once</span>]]></Snippet> <Snippet type="OccursInPopulation" sign="negative"><![CDATA[{0} <span class="quantifier">occurs more than once in the same population of</span> {1}]]></Snippet> <Snippet type="ModalPossibilityOperator" modality="alethic" sign="positive"><![CDATA[<span class="quantifier">it is possible that</span> {0}]]></Snippet> Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2010-10-20 20:51:14 UTC (rev 1461) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2010-10-22 20:52:58 UTC (rev 1462) @@ -521,7 +521,7 @@ @"<span class=""listSeparator"">, </span>", @"<span class=""objectTypeMissing"">Missing<sub style=""font-size:smaller;"">{0}</sub></span>", @"<a class=""objectType"" href=""elementid:{1}"">{0}<sub style=""font-size:smaller;"">{2}</sub></a>", - @"<span class=""quantifier"">in each population of</span> {1}<span class=""quantifier"">, </span>{0} <span class=""quantifier"">occurs at most once</span>", + @"<span class=""quantifier"">in each population of</span> {1}<span class=""listSeparator"">, </span>{0} <span class=""quantifier"">occurs at most once</span>", @"<span class=""quantifier"">at most one</span> {0}", @"<span class=""quantifier"">+</span>{0} <span class=""quantifier"">if</span><br/>{1}<br/>", @"{0}<span class=""listSeparator"">.</span>{1}", @@ -730,7 +730,7 @@ @"<span class=""listSeparator"">, </span>", @"<span class=""objectTypeMissing"">Missing<sub style=""font-size:smaller;"">{0}</sub></span>", @"<a class=""objectType"" href=""elementid:{1}"">{0}<sub style=""font-size:smaller;"">{2}</sub></a>", - @"<span class=""quantifier"">in each population of</span> {1}<span class=""quantifier"">, </span>{0} <span class=""quantifier"">occurs at most once</span>", + @"<span class=""quantifier"">in each population of</span> {1}<span class=""listSeparator"">, </span>{0} <span class=""quantifier"">occurs at most once</span>", @"<span class=""quantifier"">at most one</span> {0}", @"<span class=""quantifier"">+</span>{0} <span class=""quantifier"">if</span><br/>{1}<br/>", @"{0}<span class=""listSeparator"">.</span>{1}", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-09-15 22:04:55
|
Revision: 1457 http://orm.svn.sourceforge.net/orm/?rev=1457&view=rev Author: mcurland Date: 2010-09-15 22:04:48 +0000 (Wed, 15 Sep 2010) Log Message: ----------- More copy/merge targeted changes * Add matching for model notes and copy note links * Fix matching for value ranges with unspecified upper or lower bounds * Add automatic equivalence matching on request for non-duplicate relationships * Add optimization to request a match once per merge instead of continue to ask on failure * Make sure that lead role paths are matched one time only (two equivalent paths with different projections could match twice) * Fix missed calculation matches when a role path had calculations but no conditions Modified Paths: -------------- trunk/ORMModel/Framework/CopyMergeServices.cs trunk/ORMModel/ObjectModel/ORMCore.CopyMergeClosure.cs trunk/ORMModel/ObjectModel/ORMCore.CopyMergeClosure.xml trunk/ORMModel/ObjectModel/ORMCore.ElementEquivalence.cs trunk/ORMModel/ObjectModel/ValueRange.cs Modified: trunk/ORMModel/Framework/CopyMergeServices.cs =================================================================== --- trunk/ORMModel/Framework/CopyMergeServices.cs 2010-09-15 08:17:28 UTC (rev 1456) +++ trunk/ORMModel/Framework/CopyMergeServices.cs 2010-09-15 22:04:48 UTC (rev 1457) @@ -488,7 +488,7 @@ /// Add an element equivalence relationship. /// </summary> /// <param name="nativeElement">The native element, from the <see cref="Store"/> of - /// the instance called the the <see cref="IElementEquivalence"/> interface.</param> + /// the instance called via the <see cref="IElementEquivalence"/> interface.</param> /// <param name="equivalentElement">An equivalent element in the foreign store.</param> /// <remarks>An implementation of this interface should ignore any call with one or /// more values <see langword="null"/></remarks> @@ -496,9 +496,22 @@ /// <summary> /// Get an equivalent mapping previously added with <see cref="AddEquivalentElement"/> /// </summary> - /// <param name="element">The element to find a match for.</param> + /// <param name="nativeElement">The element to find a match for.</param> /// <returns>The equivalent element, if any.</returns> - ModelElement GetEquivalentElement(ModelElement element); + ModelElement GetEquivalentElement(ModelElement nativeElement); + /// <summary> + /// An equivalence test has been attempted for this element + /// but has failed. Track it so another attempt to test + /// equivalence is not made. + /// </summary> + /// <param name="nativeElement">The native element, from the <see cref="Store"/> of + /// the instance called via the <see cref="IElementEquivalence"/> interface.</param> + void AddFailedEquivalentElement(ModelElement nativeElement); + /// <summary> + /// Check if <see cref="AddFailedEquivalentElement"/> has been + /// called for this element. + /// </summary> + bool IsFailedEquivalentElement(ModelElement nativeElement); } #endregion // IElementEquivalence interface #region CopyClosureIntegrationPhase enum @@ -572,12 +585,66 @@ public static T GetEquivalentElement<T>(T element, Store foreignStore, IEquivalentElementTracker elementTracker) where T : ModelElement { T otherElement = elementTracker.GetEquivalentElement(element) as T; - IElementEquivalence testEquivalence; if (otherElement == null && - null != (testEquivalence = element as IElementEquivalence) && - testEquivalence.MapEquivalentElements(foreignStore, elementTracker)) + !elementTracker.IsFailedEquivalentElement(element)) { - otherElement = elementTracker.GetEquivalentElement(element) as T; + IElementEquivalence testEquivalence; + ElementLink link; + DomainRelationshipInfo relationshipInfo; + ReadOnlyCollection<DomainRoleInfo> domainRoles; + DomainRoleInfo firstRole; + DomainRoleInfo secondRole; + ModelElement otherFirstRolePlayer; + ModelElement otherSecondRolePlayer; + if (null != (testEquivalence = element as IElementEquivalence)) + { + if (testEquivalence.MapEquivalentElements(foreignStore, elementTracker)) + { + otherElement = elementTracker.GetEquivalentElement(element) as T; + } + } + else if (null != (link = element as ElementLink) && + !(relationshipInfo = link.GetDomainRelationship()).AllowsDuplicates && + null != (otherFirstRolePlayer = GetEquivalentElement((firstRole = (domainRoles = relationshipInfo.DomainRoles)[0]).GetRolePlayer(link), foreignStore, elementTracker)) && + null != (otherSecondRolePlayer = GetEquivalentElement((secondRole = domainRoles[1]).GetRolePlayer(link), foreignStore, elementTracker))) + { + // See notes on GetElementLinksToElement in ResolveExistingLink + DomainDataDirectory dataDirectory = foreignStore.DomainDataDirectory; + DomainRoleInfo fromOtherRoleInfo; + DomainRoleInfo toOtherRoleInfo; + ModelElement fromOtherElement; + ModelElement toOtherElement; + if (firstRole.IsOne || !secondRole.IsOne) + { + fromOtherRoleInfo = dataDirectory.FindDomainRole(firstRole.Id); + toOtherRoleInfo = dataDirectory.FindDomainRole(secondRole.Id); + fromOtherElement = otherFirstRolePlayer; + toOtherElement = otherSecondRolePlayer; + } + else + { + fromOtherRoleInfo = dataDirectory.FindDomainRole(secondRole.Id); + toOtherRoleInfo = dataDirectory.FindDomainRole(firstRole.Id); + fromOtherElement = otherSecondRolePlayer; + toOtherElement = otherFirstRolePlayer; + } + if (fromOtherRoleInfo != null) // These will be null together, checking one is sufficient + { + foreach (ElementLink otherLink in fromOtherRoleInfo.GetElementLinks(fromOtherElement)) + { + if (toOtherRoleInfo.GetRolePlayer(otherLink) == toOtherElement && + null != (otherElement = otherLink as T)) + { + elementTracker.AddEquivalentElement(element, otherElement); + break; + } + } + } + } + if (otherElement == null) + { + elementTracker.AddFailedEquivalentElement(element); + } } return otherElement; } @@ -597,10 +664,10 @@ } #endregion // Member Variables and Constructor #region IEquivalentElementTracker Implementation - ModelElement IEquivalentElementTracker.GetEquivalentElement(ModelElement element) + ModelElement IEquivalentElementTracker.GetEquivalentElement(ModelElement nativeElement) { ModelElement retVal; - return myElementDictionary.TryGetValue(element, out retVal) ? retVal : null; + return myElementDictionary.TryGetValue(nativeElement, out retVal) ? retVal : null; } void IEquivalentElementTracker.AddEquivalentElement(ModelElement nativeElement, ModelElement equivalentElement) { @@ -609,6 +676,15 @@ myElementDictionary[nativeElement] = equivalentElement; } } + void IEquivalentElementTracker.AddFailedEquivalentElement(ModelElement nativeElement) + { + myElementDictionary[nativeElement] = null; + } + bool IEquivalentElementTracker.IsFailedEquivalentElement(ModelElement nativeElement) + { + ModelElement checkForNull; + return myElementDictionary.TryGetValue(nativeElement, out checkForNull) && checkForNull == null; + } #endregion // IEquivalentElementTracker Implementation } #endregion // StockEquivalentElementTracker class @@ -1237,6 +1313,7 @@ private readonly Dictionary<Guid, MergeIntegrationOrder> myOrderedRoles; private readonly DomainDataDirectory myTargetDataDirectory; private Dictionary<RoleAndElement, ModelElement> myRequiresOrdering; + private Dictionary<Guid, object> myFailedEquivalence; public EquivalenceTracker(Dictionary<Guid, CopiedElement> equivalenceMap, Dictionary<Guid, MergeIntegrationOrder> orderedRoles, DomainDataDirectory targetDataDirectory, Dictionary<RoleAndElement, ModelElement> requiresOrdering) { myEquivalentElementMap = equivalenceMap; @@ -1246,6 +1323,9 @@ } #endregion // Member Variables and Constructor #region EquivalenceTracker specific + /// <summary> + /// Get back the original or on-demand-created ordering dictionary + /// </summary> public Dictionary<RoleAndElement, ModelElement> RequiresOrdering { get @@ -1253,12 +1333,22 @@ return myRequiresOrdering; } } + /// <summary> + /// Test if an identifier is tracked as either a successful + /// or failed equivalence mapping. + /// </summary> + public bool IsKnownIdentifier(Guid elementId) + { + Dictionary<Guid, object> failures; + return myEquivalentElementMap.ContainsKey(elementId) || + (null != (failures = myFailedEquivalence) && failures.ContainsKey(elementId)); + } #endregion // EquivalenceTracker specific #region IEquivalentElementTracker Implementation - ModelElement IEquivalentElementTracker.GetEquivalentElement(ModelElement element) + ModelElement IEquivalentElementTracker.GetEquivalentElement(ModelElement nativeElement) { CopiedElement copiedElement; - return myEquivalentElementMap.TryGetValue(element.Id, out copiedElement) ? copiedElement.Element : null; + return myEquivalentElementMap.TryGetValue(nativeElement.Id, out copiedElement) ? copiedElement.Element : null; } void IEquivalentElementTracker.AddEquivalentElement(ModelElement nativeElement, ModelElement equivalentElement) { @@ -1288,6 +1378,16 @@ } } } + void IEquivalentElementTracker.AddFailedEquivalentElement(ModelElement nativeElement) + { + (myFailedEquivalence ?? (myFailedEquivalence = new Dictionary<Guid, object>()))[nativeElement.Id] = null; + } + bool IEquivalentElementTracker.IsFailedEquivalentElement(ModelElement nativeElement) + { + Dictionary<Guid, object> failedElements; + return null != (failedElements = myFailedEquivalence) && + failedElements.ContainsKey(nativeElement.Id); + } #endregion // IEquivalentElementTracker Implementation } #endregion // EquivalenceTracker class @@ -1388,6 +1488,7 @@ DomainDataDirectory targetDataDirectory = targetStore.DomainDataDirectory; DomainDataDirectory sourceDataDirectory = sourceStore.DomainDataDirectory; EquivalenceTracker tracker = new EquivalenceTracker(resolvedElements, myOrderedRoles, targetDataDirectory, requiresOrdering); + IEquivalentElementTracker trackerAsInterface = tracker; foreach (KeyValuePair<Guid, IClosureElement> pair in copyClosure) { IClosureElement closureElement = pair.Value; @@ -1401,10 +1502,15 @@ break; // Do not attempt to merge duplicate elements case CopyMergeAction.Match: IElementEquivalence equivalence; - if (null != (equivalence = closureElement.Element as IElementEquivalence) && - !resolvedElements.ContainsKey(pair.Key)) + ModelElement element; + if (!tracker.IsKnownIdentifier(pair.Key) && + null != (equivalence = (element = closureElement.Element) as IElementEquivalence)) { - equivalence.MapEquivalentElements(targetStore, tracker); + if (!equivalence.MapEquivalentElements(targetStore, trackerAsInterface) || + null == trackerAsInterface.GetEquivalentElement(element)) + { + trackerAsInterface.AddFailedEquivalentElement(element); + } } break; case CopyMergeAction.Link: Modified: trunk/ORMModel/ObjectModel/ORMCore.CopyMergeClosure.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMCore.CopyMergeClosure.cs 2010-09-15 08:17:28 UTC (rev 1456) +++ trunk/ORMModel/ObjectModel/ORMCore.CopyMergeClosure.cs 2010-09-15 22:04:48 UTC (rev 1457) @@ -192,6 +192,7 @@ closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(GroupingElementRelationship.ElementDomainRoleId), new DomainRoleClosureRestriction(GroupingElementRelationship.GroupingDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(LeadRolePathSatisfiesCalculatedCondition.LeadRolePathDomainRoleId), new DomainRoleClosureRestriction(LeadRolePathSatisfiesCalculatedCondition.CalculatedConditionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(LeadRolePathSatisfiesCalculatedCondition.LeadRolePathDomainRoleId), new DomainRoleClosureRestriction(LeadRolePathSatisfiesCalculatedCondition.CalculatedConditionDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.InternalReferencedPart); + closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ModelNoteReferencesModelElement.ElementDomainRoleId), new DomainRoleClosureRestriction(ModelNoteReferencesModelElement.NoteDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalReferencedPart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(Objectification.NestingTypeDomainRoleId), new DomainRoleClosureRestriction(Objectification.NestedFactTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalCompositePart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(Objectification.NestedFactTypeDomainRoleId), new DomainRoleClosureRestriction(Objectification.NestingTypeDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalCompositePart); closureManager.AddCopyClosureDirective(new DomainRoleClosureRestriction(ObjectificationImpliesFactType.ImpliedFactTypeDomainRoleId), new DomainRoleClosureRestriction(ObjectificationImpliesFactType.ImpliedByObjectificationDomainRoleId), CopyClosureDirectiveOptions.None, CopyClosureBehavior.ExternalCompositePart); Modified: trunk/ORMModel/ObjectModel/ORMCore.CopyMergeClosure.xml =================================================================== --- trunk/ORMModel/ObjectModel/ORMCore.CopyMergeClosure.xml 2010-09-15 08:17:28 UTC (rev 1456) +++ trunk/ORMModel/ObjectModel/ORMCore.CopyMergeClosure.xml 2010-09-15 22:04:48 UTC (rev 1457) @@ -205,6 +205,10 @@ <cmc:ClosureRole relationship="ValueTypeHasDataType" role="DataType" closureBehavior="ExternalReferencedPart"/> <cmc:ClosureRole relationship="ReferenceModeHasReferenceModeKind" role="Kind" closureBehavior="ExternalReferencedPart"/> <cmc:ClosureRole relationship="ReadingOrderHasRole" role="Role" closureBehavior="InternalReferencedPart" order="From"/> + <!-- UNDONE: COPYMERGE This is temporary for notes (bring in the note with a referencing element). We actually + want a weak relationship, where the ModelNote reference is pulled in only if both role players are pulled in for other + reasons. We need a notion of a MatchOnly element (match, but do not create) and a non-propagating relationship. --> + <cmc:ClosureRole relationship="ModelNoteReferencesModelElement" role="Note" closureBehavior="ExternalReferencedPart"/> <!-- Role path closures --> <cmc:ClosureRole relationship="LeadRolePathSatisfiesCalculatedCondition" role="CalculatedCondition" closureBehavior="InternalReferencedPart"/> Modified: trunk/ORMModel/ObjectModel/ORMCore.ElementEquivalence.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMCore.ElementEquivalence.cs 2010-09-15 08:17:28 UTC (rev 1456) +++ trunk/ORMModel/ObjectModel/ORMCore.ElementEquivalence.cs 2010-09-15 22:04:48 UTC (rev 1457) @@ -1212,8 +1212,9 @@ /// </summary> protected bool MapEquivalentElements(Store foreignStore, IEquivalentElementTracker elementTracker) { + RolePathOwner pathOwner = PathOwner; RolePathOwner otherPathOwner; - if (null != (otherPathOwner = CopyMergeUtility.GetEquivalentElement(PathOwner, foreignStore, elementTracker))) + if (null != (otherPathOwner = CopyMergeUtility.GetEquivalentElement(pathOwner, foreignStore, elementTracker))) { LinkedElementCollection<PathObjectUnifier> unifiers = null; LinkedElementCollection<CalculatedPathValue> conditions = null; @@ -1225,8 +1226,37 @@ int[] matchingOtherUnifiers = null; // Array indexed into other unifiers (index +1, zero means empty) BitTracker matchedOthers = default(BitTracker); Dictionary<ModelElement, ModelElement> preMatchedElements = null; + LinkedElementCollection<LeadRolePath> allOwnedPaths = pathOwner.OwnedLeadRolePathCollection; + if (allOwnedPaths.Count == 1) + { + allOwnedPaths = null; + } foreach (LeadRolePath otherLeadRolePath in otherPathOwner.OwnedLeadRolePathCollection) { + if (allOwnedPaths != null) + { + bool previouslyMatched = false; + foreach (LeadRolePath ownedPath in allOwnedPaths) + { + if (ownedPath != this && + elementTracker.GetEquivalentElement(ownedPath) == otherLeadRolePath) + { + // Do a sanity check before we continue. It is possible for one owner + // to have two equivalent paths (possibly with alternate projections, etc). + // The merge framework does not track reverse elements, so we need to make + // sure that we don't match with two different things. Without this check, + // two projections can end up mapping the same lead role path. For the more + // common case of a relatively small number of different paths, this also + // avoids repetitions of the matching code below. + previouslyMatched = true; + break; + } + } + if (previouslyMatched) + { + continue; + } + } if (preMatchedElements == null) { preMatchedElements = new Dictionary<ModelElement,ModelElement>(); @@ -1392,6 +1422,11 @@ // All conditions match, the paths are equivalent. // Now try top pair up any remaining unmapped functions. + if (calculations == null) + { + calculations = CalculatedValueCollection; + calculationCount = calculations.Count; + } if (calculationCount != 0) { int otherCalculationCount; @@ -1799,6 +1834,33 @@ } } #endregion // CalculatedPathValue class + #region CalculatedPathValueInput class + partial class CalculatedPathValueInput : IElementEquivalence + { + /// <summary> + /// Implements <see cref="IElementEquivalence.MapEquivalentElements"/> + /// Match the calculation input based on the associated lead role path. + /// IElementEquivalence is implemented on path components that are referenced from + /// outside the path structure or nest 1-1 mapped elements. + /// </summary> + protected bool MapEquivalentElements(Store foreignStore, IEquivalentElementTracker elementTracker) + { + CalculatedPathValue calculation; + LeadRolePath rolePath; + if (null != (calculation = CalculatedValue) && + null != (rolePath = calculation.LeadRolePath) && + CopyMergeUtility.GetEquivalentElement(rolePath, foreignStore, elementTracker) != null) + { + return elementTracker.GetEquivalentElement(this) != null; + } + return false; + } + bool IElementEquivalence.MapEquivalentElements(Store foreignStore, IEquivalentElementTracker elementTracker) + { + return MapEquivalentElements(foreignStore, elementTracker); + } + } + #endregion // CalculatedPathValueInput class #region RecognizedPhrase class partial class RecognizedPhrase : IElementEquivalence { @@ -1870,4 +1932,33 @@ } } #endregion // NameAlias class + #region ModelNote class + partial class ModelNote : IElementEquivalence + { + /// <summary> + /// Implements <see cref="IElementEquivalence.MapEquivalentElements"/> + /// </summary> + protected new bool MapEquivalentElements(Store foreignStore, IEquivalentElementTracker elementTracker) + { + foreach (ORMModel otherModel in foreignStore.ElementDirectory.FindElements<ORMModel>(false)) + { + string matchText = Text; + foreach (ModelNote otherNote in otherModel.NoteCollection) + { + if (otherNote.Text == matchText) + { + elementTracker.AddEquivalentElement(this, otherNote); + return true; + } + } + break; + } + return false; + } + bool IElementEquivalence.MapEquivalentElements(Store foreignStore, IEquivalentElementTracker elementTracker) + { + return MapEquivalentElements(foreignStore, elementTracker); + } + } + #endregion // ModelNote class } Modified: trunk/ORMModel/ObjectModel/ValueRange.cs =================================================================== --- trunk/ORMModel/ObjectModel/ValueRange.cs 2010-09-15 08:17:28 UTC (rev 1456) +++ trunk/ORMModel/ObjectModel/ValueRange.cs 2010-09-15 22:04:48 UTC (rev 1457) @@ -1707,6 +1707,28 @@ for (int i = 0; i < rangeCount; ++i) { ValueRange range = ranges[i]; + string rangeMin = range.MinValue; + bool minParsed; + if (string.IsNullOrEmpty(rangeMin)) + { + rangeMin = null; + minParsed = false; + } + else + { + minParsed = dataType.ParseNormalizeValue(rangeMin, range.InvariantMinValue, out rangeMin); + } + string rangeMax = range.MaxValue; + bool maxParsed; + if (string.IsNullOrEmpty(rangeMax)) + { + rangeMax = null; + maxParsed = false; + } + else + { + maxParsed = dataType.ParseNormalizeValue(rangeMax, range.InvariantMaxValue, out rangeMax); + } for (int j = 0; j < otherRangeCount; ++j) { if (!otherMatches[j]) @@ -1718,20 +1740,43 @@ // integration is complete. We use the current data type to // compare values, and leave it up to rules to sort out the // remaining issues after data type information is complete. - string normalizedValue; - string otherNormalizedValue; - if (dataType.ParseNormalizeValue(range.MinValue, range.InvariantMinValue, out normalizedValue) && - dataType.ParseNormalizeValue(otherRange.MinValue, otherRange.InvariantMinValue, out otherNormalizedValue) && - (canCompare ? (dataType.Compare(normalizedValue, otherNormalizedValue) == 0) : (normalizedValue == otherNormalizedValue)) && - dataType.ParseNormalizeValue(range.MaxValue, range.InvariantMaxValue, out normalizedValue) && - dataType.ParseNormalizeValue(otherRange.MaxValue, otherRange.InvariantMaxValue, out otherNormalizedValue) && - (canCompare ? (dataType.Compare(normalizedValue, otherNormalizedValue) == 0) : (normalizedValue == otherNormalizedValue))) + string otherRangeBound = otherRange.MinValue; + if (string.IsNullOrEmpty(otherRangeBound)) { - // Ignore endpoint inclusion properties for merging, consider these sufficient equivalent ranges to match. - elementTracker.AddEquivalentElement(range, otherRange); - otherMatches[j] = true; - break; + if (rangeMin != null) + { + continue; + } } + else if (minParsed != dataType.ParseNormalizeValue(otherRangeBound, otherRange.InvariantMinValue, out otherRangeBound)) + { + continue; + } + else if (!((canCompare && minParsed) ? (dataType.Compare(rangeMin, otherRangeBound) == 0) : (rangeMin == otherRangeBound))) + { + continue; + } + otherRangeBound = otherRange.MaxValue; + if (string.IsNullOrEmpty(otherRangeBound)) + { + if (rangeMax != null) + { + continue; + } + } + else if (maxParsed != dataType.ParseNormalizeValue(otherRangeBound, otherRange.InvariantMaxValue, out otherRangeBound)) + { + continue; + } + else if (!((canCompare && maxParsed) ? (dataType.Compare(rangeMax, otherRangeBound) == 0) : (rangeMax == otherRangeBound))) + { + continue; + } + + // Ignore endpoint inclusion properties for merging, consider these sufficient equivalent ranges to match. + elementTracker.AddEquivalentElement(range, otherRange); + otherMatches[j] = true; + break; } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-09-15 08:17:35
|
Revision: 1456 http://orm.svn.sourceforge.net/orm/?rev=1456&view=rev Author: mcurland Date: 2010-09-15 08:17:28 +0000 (Wed, 15 Sep 2010) Log Message: ----------- Fixed some cross-model copy problems from [1455]. refs #403 * Element order in 'allows duplicates' relationships needs to be based on the link order, not the target element order. * Add matching for abbreviations * Improve sophistication of merge filter to enable both the toolbox and cross-model drag Modified Paths: -------------- trunk/ORMModel/Framework/CopyMergeServices.cs trunk/ORMModel/ObjectModel/NameAlias.cs trunk/ORMModel/ObjectModel/ORMCore.AttachRules.cs trunk/ORMModel/ObjectModel/ORMCore.AttachRules.xml trunk/ORMModel/ObjectModel/ORMCore.ElementEquivalence.cs trunk/ORMModel/ShapeModel/ReadingShape.cs trunk/ORMModel/ShapeModel/ViewFixupRules.cs Modified: trunk/ORMModel/Framework/CopyMergeServices.cs =================================================================== --- trunk/ORMModel/Framework/CopyMergeServices.cs 2010-09-14 21:30:56 UTC (rev 1455) +++ trunk/ORMModel/Framework/CopyMergeServices.cs 2010-09-15 08:17:28 UTC (rev 1456) @@ -16,7 +16,7 @@ // Temporarily uncomment this line to enable helper // routines useful during copy closure debugging. - #define DEBUGHELPERS +// #define DEBUGHELPERS using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -1485,31 +1485,82 @@ DomainRoleInfo sourceRoleInfo; DomainRoleInfo targetRoleInfo; LinkedElementCollection<ModelElement> targetLinkedElements; - LinkedElementCollection<ModelElement> sourceLinkedElements; + int targetLinkCount; if (null != (sourceRoleInfo = sourceDataDirectory.FindDomainRole(roleId)) && null != (targetRoleInfo = targetDataDirectory.FindDomainRole(roleId)) && - 1 < (targetLinkedElements = targetRoleInfo.GetLinkedElements(pair.Value)).Count && - 0 != (sourceLinkedElements = sourceRoleInfo.GetLinkedElements(key.Element)).Count) + 1 < (targetLinkCount = (targetLinkedElements = targetRoleInfo.GetLinkedElements(pair.Value)).Count)) { - // UNDONE: COPYMERGE Use MergeIntegrationOrder to more accurately - // place elements in an existing collection. This moves all merged - // elements to the front. - MergeIntegrationOrder order = orderedRoles[roleId]; - int resolvedIndex = 0; - foreach (ModelElement sourceLinkedElement in sourceLinkedElements) + if (sourceRoleInfo.DomainRelationship.AllowsDuplicates) { - CopiedElement copy; - int targetIndex; - if (resolvedElements.TryGetValue(sourceLinkedElement.Id, out copy) && - -1 != (targetIndex = targetLinkedElements.IndexOf(copy.Element))) + // We have to be very careful in this situation because we can + // based on the order on the location of the source links, but + // not the source elements (which can be duplicated). From the + // target side, we need the LinkedElementCollection for the Move + // method plus the ElementLink collection for order comparison. + ReadOnlyCollection<ElementLink> sourceLinks = sourceRoleInfo.GetElementLinks(key.Element); + if (0 != sourceLinks.Count) { - if (targetIndex != resolvedIndex) + ReadOnlyCollection<ElementLink> targetLinks = targetRoleInfo.GetElementLinks(pair.Value); + // Note that count and order directly correspond to the linked elements. + // Assert the count for minimal sanity, assume the order. + Debug.Assert(targetLinks.Count == targetLinkCount); + // Record the index in original collection now residing in a given slot + int[] originalIndexMap = new int[targetLinkCount]; + for (int i = 0; i < targetLinkCount; ++i) { - targetLinkedElements.Move(targetIndex, resolvedIndex); + originalIndexMap[i] = i; } - ++resolvedIndex; + int resolvedIndex = 0; + foreach (ElementLink sourceLink in sourceLinks) + { + CopiedElement copy; + int originalTargetIndex; + if (resolvedElements.TryGetValue(sourceLink.Id, out copy) && + -1 != (originalTargetIndex = targetLinks.IndexOf((ElementLink)copy.Element))) + { + int targetIndex = Array.IndexOf<int>(originalIndexMap, originalTargetIndex); + if (targetIndex != resolvedIndex) + { + Debug.Assert(targetIndex > resolvedIndex); // Otherwise the links do not form a set + targetLinkedElements.Move(targetIndex, resolvedIndex); + int keepTargetIndex = originalIndexMap[targetIndex]; + for (int i = targetIndex; i > resolvedIndex; --i) + { + originalIndexMap[i] = originalIndexMap[i - 1]; + } + originalIndexMap[resolvedIndex] = keepTargetIndex; + } + ++resolvedIndex; + } + } } } + else + { + LinkedElementCollection<ModelElement> sourceLinkedElements = sourceRoleInfo.GetLinkedElements(key.Element); + if (0 != sourceLinkedElements.Count) + { + // UNDONE: COPYMERGE Use MergeIntegrationOrder to more accurately + // place elements in an existing collection. This moves all merged + // elements to the front. Also apply to AllowsDuplicates case. + // MergeIntegrationOrder order = orderedRoles[roleId]; + int resolvedIndex = 0; + foreach (ModelElement sourceLinkedElement in sourceLinkedElements) + { + CopiedElement copy; + int targetIndex; + if (resolvedElements.TryGetValue(sourceLinkedElement.Id, out copy) && + -1 != (targetIndex = targetLinkedElements.IndexOf(copy.Element))) + { + if (targetIndex != resolvedIndex) + { + targetLinkedElements.Move(targetIndex, resolvedIndex); + } + ++resolvedIndex; + } + } + } + } } } } @@ -1853,34 +1904,26 @@ if (null != (embeddedRoles = myEmbeddedRoles) && embeddedRoles.TryGetValue(newElement.GetDomainClass().ImplementationClass, out roleNode)) { - DomainRoleInfo embeddedRoleInfo = null; - if (roleNode.Next == null) + // Get available embedding roles and verify that the basedOnElement is attached + // via that relationship. Note that we do this even if exactly one root embedding + // relationship is available because we do not know if there are other non-root + // embedding relationships in this code. + DomainRoleInfo sourceEmbeddedRoleInfo = null; + while (roleNode != null) { - // We have only one choice, short circuit tie breakers - // Use Find instead of Get to handle source/target situations - // where the extension models may be different. - embeddedRoleInfo = targetDataDirectory.FindDomainRole(roleNode.Value); - } - else - { - while (roleNode != null) + sourceEmbeddedRoleInfo = sourceDataDirectory.GetDomainRole(roleNode.Value); + if (sourceEmbeddedRoleInfo.GetElementLinks(basedOnElement).Count != 0) { - if (null != (embeddedRoleInfo = sourceDataDirectory.FindDomainRole(roleNode.Value))) { - if (embeddedRoleInfo.GetElementLinks(basedOnElement).Count != 0) - { - { - break; - } - } - embeddedRoleInfo = null; + break; } - roleNode = roleNode.Next; } + sourceEmbeddedRoleInfo = null; + roleNode = roleNode.Next; } - if (embeddedRoleInfo != null) + if (sourceEmbeddedRoleInfo != null) { - DomainRelationshipInfo sourceRelationshipInfo = embeddedRoleInfo.DomainRelationship; + DomainRelationshipInfo sourceRelationshipInfo = sourceEmbeddedRoleInfo.DomainRelationship; DomainRelationshipInfo targetRelationshipInfo = targetDataDirectory.FindDomainRelationship(sourceRelationshipInfo.Id); if (targetRelationshipInfo == null) { @@ -1888,7 +1931,7 @@ } else { - DomainRoleInfo embeddingRoleInfo = embeddedRoleInfo.OppositeDomainRole; + DomainRoleInfo embeddingRoleInfo = sourceEmbeddedRoleInfo.OppositeDomainRole; DomainClassInfo parentClassInfo = embeddingRoleInfo.RolePlayer; Type implementationClass = parentClassInfo.ImplementationClass; ModelElement rootElement = null; @@ -1926,7 +1969,7 @@ if (rootElement != null) { Guid embeddingRoleId = embeddingRoleInfo.Id; - Guid embeddedRoleId = embeddedRoleInfo.Id; + Guid embeddedRoleId = sourceEmbeddedRoleInfo.Id; targetElementFactory.CreateElementLink( targetRelationshipInfo, new RoleAssignment(embeddingRoleId, rootElement), @@ -1936,7 +1979,7 @@ { if (orderedRoles.ContainsKey(embeddingRoleId)) // Pre check so we don't fetch elements we don't need { - foreach (ModelElement basedOnRootElement in embeddedRoleInfo.GetLinkedElements(basedOnElement)) + foreach (ModelElement basedOnRootElement in sourceEmbeddedRoleInfo.GetLinkedElements(basedOnElement)) { TrackOrdering(orderedRoles, embeddingRoleId, basedOnRootElement, rootElement, ref requiresOrdering); break; Modified: trunk/ORMModel/ObjectModel/NameAlias.cs =================================================================== --- trunk/ORMModel/ObjectModel/NameAlias.cs 2010-09-14 21:30:56 UTC (rev 1455) +++ trunk/ORMModel/ObjectModel/NameAlias.cs 2010-09-15 08:17:28 UTC (rev 1456) @@ -110,32 +110,53 @@ /// <param name="notifyAdded">The listener to notify if elements are added during fixup</param> protected sealed override void ProcessElement(NameAlias element, Store store, INotifyElementAdded notifyAdded) { - Type consumer; - Type usage; - object[] attributes = null; - DomainClassInfo consumerDomainClass; - if (null == (consumerDomainClass = element.myConsumerDomainClass) || - null == (consumer = consumerDomainClass.ImplementationClass) || - (null != (usage = element.NameUsageType) && - null == (attributes = consumer.GetCustomAttributes(typeof(NameUsageAttribute), true)))) + element.DeleteIfTypeBindingFailed(); + } + } + /// <summary> + /// AddRule: typeof(NameAlias), FireTime=LocalCommit, Priority=FrameworkDomainModel.CopyClosureExpansionCompletedRulePriority; + /// </summary> + private static void AliasAddedClosureRule(ElementAddedEventArgs e) + { + ModelElement element = e.ModelElement; + if (!element.IsDeleted && + CopyMergeUtility.GetIntegrationPhase(element.Store) == CopyClosureIntegrationPhase.IntegrationComplete) + { + ((NameAlias)element).DeleteIfTypeBindingFailed(); + } + } + /// <summary> + /// Shared helper for merge integration and deserialization. Deletes + /// the element if the types referenced by the consumer and usage + /// are not loaded in the store. + /// </summary> + private void DeleteIfTypeBindingFailed() + { + Type consumer; + Type usage; + object[] attributes = null; + DomainClassInfo consumerDomainClass; + if (null == (consumerDomainClass = myConsumerDomainClass) || + null == (consumer = consumerDomainClass.ImplementationClass) || + (null != (usage = NameUsageType) && + null == (attributes = consumer.GetCustomAttributes(typeof(NameUsageAttribute), true)))) + { + Delete(); + } + else if (usage != null) + { + int i = 0; + for (; i < attributes.Length; ++i) { - element.Delete(); - } - else if (usage != null) - { - int i = 0; - for (; i < attributes.Length; ++i) + if (((NameUsageAttribute)attributes[i]).Type == usage) { - if (((NameUsageAttribute)attributes[i]).Type == usage) - { - break; - } + break; } - if (i == attributes.Length) - { - element.Delete(); - } } + if (i == attributes.Length) + { + Delete(); + } } } #endregion // Deserialization Fixup Modified: trunk/ORMModel/ObjectModel/ORMCore.AttachRules.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMCore.AttachRules.cs 2010-09-14 21:30:56 UTC (rev 1455) +++ trunk/ORMModel/ObjectModel/ORMCore.AttachRules.cs 2010-09-15 08:17:28 UTC (rev 1456) @@ -205,6 +205,7 @@ typeof(MandatoryConstraint).GetNestedType("MandatoryConstraintChangeRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(ModelError).GetNestedType("SynchronizeErrorTextForModelRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(ModelError).GetNestedType("SynchronizeErrorTextForOwnerRuleClass", BindingFlags.Public | BindingFlags.NonPublic), + typeof(NameAlias).GetNestedType("AliasAddedClosureRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(ORMSolutions.ORMArchitect.Framework.NamedElementDictionary).GetNestedType("ElementLinkAddedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(ORMSolutions.ORMArchitect.Framework.NamedElementDictionary).GetNestedType("ElementLinkDeletingRuleClass", BindingFlags.Public | BindingFlags.NonPublic), typeof(ORMSolutions.ORMArchitect.Framework.NamedElementDictionary).GetNestedType("NamedElementChangedRuleClass", BindingFlags.Public | BindingFlags.NonPublic), @@ -489,7 +490,7 @@ { Microsoft.VisualStudio.Modeling.RuleManager ruleManager = store.RuleManager; Type[] disabledRuleTypes = ORMCoreDomainModel.CustomDomainModelTypes; - for (int i = 0; i < 421; ++i) + for (int i = 0; i < 422; ++i) { ruleManager.EnableRule(disabledRuleTypes[i]); } @@ -5030,6 +5031,37 @@ } } #endregion // Rule classes for ModelError + #region Rule classes for NameAlias + partial class NameAlias + { + [Microsoft.VisualStudio.Modeling.RuleOn(typeof(NameAlias), FireTime=Microsoft.VisualStudio.Modeling.TimeToFire.LocalCommit, Priority=ORMSolutions.ORMArchitect.Framework.FrameworkDomainModel.CopyClosureExpansionCompletedRulePriority)] + private sealed class AliasAddedClosureRuleClass : Microsoft.VisualStudio.Modeling.AddRule + { + [System.Diagnostics.DebuggerStepThrough()] + public AliasAddedClosureRuleClass() + { + base.IsEnabled = false; + } + /// <summary> + /// Provide the following method in class: + /// ORMSolutions.ORMArchitect.Core.ObjectModel.NameAlias + /// /// <summary> + /// /// AddRule: typeof(NameAlias), FireTime=LocalCommit, Priority=FrameworkDomainModel.CopyClosureExpansionCompletedRulePriority; + /// /// </summary> + /// private static void AliasAddedClosureRule(ElementAddedEventArgs e) + /// { + /// } + /// </summary> + [System.Diagnostics.DebuggerStepThrough()] + public override void ElementAdded(Microsoft.VisualStudio.Modeling.ElementAddedEventArgs e) + { + ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleStart(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Core.ObjectModel.NameAlias.AliasAddedClosureRule"); + NameAlias.AliasAddedClosureRule(e); + ORMSolutions.ORMArchitect.Framework.Diagnostics.TraceUtility.TraceRuleEnd(e.ModelElement.Store, "ORMSolutions.ORMArchitect.Core.ObjectModel.NameAlias.AliasAddedClosureRule"); + } + } + } + #endregion // Rule classes for NameAlias #region Rule classes for NameGenerator partial class NameGenerator { Modified: trunk/ORMModel/ObjectModel/ORMCore.AttachRules.xml =================================================================== --- trunk/ORMModel/ObjectModel/ORMCore.AttachRules.xml 2010-09-14 21:30:56 UTC (rev 1455) +++ trunk/ORMModel/ObjectModel/ORMCore.AttachRules.xml 2010-09-15 08:17:28 UTC (rev 1456) @@ -570,6 +570,11 @@ <arg:RuleOn targetType="ORMNamedElement"/> </arg:ChangeRule> </arg:RuleContainer> + <arg:RuleContainer class="NameAlias"> + <arg:AddRule methodName="AliasAddedClosureRule"> + <arg:RuleOn targetType="NameAlias" fireTime="LocalCommit" priority="CopyClosureExpansionCompletedRulePriority"/> + </arg:AddRule> + </arg:RuleContainer> <arg:RuleContainer class="NamedElementDictionary" namespace="ORMSolutions.ORMArchitect.Framework"> <arg:AddRule methodName="ElementLinkAddedRule"> <arg:RuleOn targetType="ElementLink" targetTypeQualifier="Microsoft.VisualStudio.Modeling"> Modified: trunk/ORMModel/ObjectModel/ORMCore.ElementEquivalence.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMCore.ElementEquivalence.cs 2010-09-14 21:30:56 UTC (rev 1455) +++ trunk/ORMModel/ObjectModel/ORMCore.ElementEquivalence.cs 2010-09-15 08:17:28 UTC (rev 1456) @@ -1799,4 +1799,75 @@ } } #endregion // CalculatedPathValue class + #region RecognizedPhrase class + partial class RecognizedPhrase : IElementEquivalence + { + /// <summary> + /// Implements <see cref="IElementEquivalence.MapEquivalentElements"/> + /// Match phrases by name. + /// </summary> + protected bool MapEquivalentElements(Store foreignStore, IEquivalentElementTracker elementTracker) + { + foreach (ORMModel otherModel in foreignStore.ElementDirectory.FindElements<ORMModel>(false)) + { + RecognizedPhrase otherPhrase = otherModel.RecognizedPhrasesDictionary.GetElement(Name).FirstElement as RecognizedPhrase; + if (otherPhrase != null) + { + elementTracker.AddEquivalentElement(this, otherPhrase); + return true; + } + break; + } + return false; + } + bool IElementEquivalence.MapEquivalentElements(Store foreignStore, IEquivalentElementTracker elementTracker) + { + return MapEquivalentElements(foreignStore, elementTracker); + } + } + #endregion // RecognizedPhrase class + #region NameAlias class + partial class NameAlias : IElementEquivalence + { + /// <summary> + /// Implements <see cref="IElementEquivalence.MapEquivalentElements"/> + /// </summary> + protected bool MapEquivalentElements(Store foreignStore, IEquivalentElementTracker elementTracker) + { + ModelElement aliasOwner; + ModelElement otherAliasOwner; + if (null != (aliasOwner = Element) && + null != (otherAliasOwner = CopyMergeUtility.GetEquivalentElement(aliasOwner, foreignStore, elementTracker))) + { + // Match by consumer and usage classes. Use the internal class information + // instead of the serialized string forms. If we end up copying one of these + // with no matching class information then we'll delete it at the end of + // the merge integration phase. Note that we match by id because the meta + // information is in a different store. + // UNDONE: COPYMERGE We need a way for an element to add domain model requirements + // without referencing elements in that model. + DomainClassInfo classInfo = myConsumerDomainClass; + bool hasConsumer = classInfo != null; + Guid consumerId = hasConsumer ? classInfo.Id : Guid.Empty; + classInfo = myUsageDomainClass; + bool hasUsage = classInfo != null; + Guid usageId = hasUsage ? classInfo.Id : Guid.Empty; + foreach (NameAlias otherAlias in ElementHasAlias.GetAliasCollection(otherAliasOwner)) + { + if (consumerId == (null != (classInfo = otherAlias.myConsumerDomainClass) ? classInfo.Id : Guid.Empty) && + usageId == (null != (classInfo = otherAlias.myUsageDomainClass) ? classInfo.Id : Guid.Empty)) + { + elementTracker.AddEquivalentElement(this, otherAlias); + return true; + } + } + } + return false; + } + bool IElementEquivalence.MapEquivalentElements(Store foreignStore, IEquivalentElementTracker elementTracker) + { + return MapEquivalentElements(foreignStore, elementTracker); + } + } + #endregion // NameAlias class } Modified: trunk/ORMModel/ShapeModel/ReadingShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ReadingShape.cs 2010-09-14 21:30:56 UTC (rev 1455) +++ trunk/ORMModel/ShapeModel/ReadingShape.cs 2010-09-15 08:17:28 UTC (rev 1456) @@ -895,11 +895,13 @@ private ArrowDirection GetDirection(ShapeElement parentShape) { ArrowDirection retVal = ArrowDirection.None; - FactTypeShape factTypeShape = (FactTypeShape)parentShape.ParentShape; - FactType factType = factTypeShape.AssociatedFactType; - LinkedElementCollection<RoleBase> roles = factType.RoleCollection; - int roleCount = roles.Count; - if (roleCount > 1) + FactTypeShape factTypeShape; + FactType factType; + LinkedElementCollection<RoleBase> roles; + int roleCount; + if (null != (factTypeShape = (FactTypeShape)parentShape.ParentShape) && + null != (factType = factTypeShape.AssociatedFactType) && + (roleCount = (roles = factType.RoleCollection).Count) > 1) { DisplayOrientation orientation = factTypeShape.DisplayOrientation; bool isVertical = orientation != DisplayOrientation.Horizontal; Modified: trunk/ORMModel/ShapeModel/ViewFixupRules.cs =================================================================== --- trunk/ORMModel/ShapeModel/ViewFixupRules.cs 2010-09-14 21:30:56 UTC (rev 1455) +++ trunk/ORMModel/ShapeModel/ViewFixupRules.cs 2010-09-15 08:17:28 UTC (rev 1456) @@ -43,8 +43,8 @@ ModelHasObjectType link = e.ModelElement as ModelHasObjectType; ObjectType objectType = link.ObjectType; if (!element.IsDeleted && - !MergeContext.HasContext(element.Store.TransactionManager.CurrentTransaction.TopLevelTransaction) && - (objectType = (link = (ModelHasObjectType)element).ObjectType).NestedFactType == null) // Otherwise, fix up with the fact type + (objectType = (link = (ModelHasObjectType)element).ObjectType).NestedFactType == null && // Otherwise, fix up with the fact type + ElementRequiresFixup(objectType)) { Diagram.FixUpDiagram(link.Model, objectType); } @@ -246,11 +246,14 @@ private static void FactTypedAddedRule(ElementAddedEventArgs e) { ModelElement element = e.ModelElement; - if (!element.IsDeleted && - !MergeContext.HasContext(element.Store.TransactionManager.CurrentTransaction.TopLevelTransaction)) + if (!element.IsDeleted) { ModelHasFactType link = (ModelHasFactType)e.ModelElement; - Diagram.FixUpDiagram(link.Model, link.FactType); + FactType factType = link.FactType; + if (ElementRequiresFixup(factType)) + { + Diagram.FixUpDiagram(link.Model, factType); + } } } #endregion // FactTypeAddedRule @@ -296,13 +299,13 @@ private static void SetConstraintAddedRule(ElementAddedEventArgs e) { ModelElement element = e.ModelElement; - if (!element.IsDeleted && - !MergeContext.HasContext(element.Store.TransactionManager.CurrentTransaction.TopLevelTransaction)) + if (!element.IsDeleted) { ModelHasSetConstraint link = (ModelHasSetConstraint)e.ModelElement; SetConstraint constraint = link.SetConstraint; // Shapes are never added for internal constraints, so there is no point in attempting a fixup - if (!((IConstraint)constraint).ConstraintIsInternal) + if (!((IConstraint)constraint).ConstraintIsInternal && + ElementRequiresFixup(constraint)) { Diagram.FixUpDiagram(link.Model, constraint); } @@ -605,22 +608,35 @@ ObjectType rolePlayer; ORMModel model; if (!link.IsDeleted && - !MergeContext.HasContext(link.Store.TransactionManager.CurrentTransaction.TopLevelTransaction) && null != (associatedFact = link.PlayedRole.FactType) && null == associatedFact.ImpliedByObjectification && null != (model = (rolePlayer = link.RolePlayer).Model)) { FactType nestedFact; + bool continueFixup = false; if (FactTypeShape.ShouldDrawObjectification(nestedFact = rolePlayer.NestedFactType)) { - Diagram.FixUpDiagram(model, nestedFact); - Diagram.FixUpDiagram(nestedFact, rolePlayer); + if (ElementRequiresFixup(nestedFact)) + { + Diagram.FixUpDiagram(model, nestedFact); + Diagram.FixUpDiagram(nestedFact, rolePlayer); + continueFixup = true; + } } - else + else if (ElementRequiresFixup(rolePlayer)) { Diagram.FixUpDiagram(model, rolePlayer); + continueFixup = true; } - Diagram.FixUpDiagram(model, associatedFact); + if (ElementRequiresFixup(associatedFact)) + { + Diagram.FixUpDiagram(model, associatedFact); + continueFixup = true; + } + if (!continueFixup) + { + return; + } object AllowMultipleShapes; Dictionary<object, object> topLevelContextInfo; @@ -1017,9 +1033,12 @@ ORMModel model; if (!link.IsDeleted && !((factType = link.FactType) is SubtypeFact) && - !MergeContext.HasContext(link.Store.TransactionManager.CurrentTransaction.TopLevelTransaction) && null != (model = factType.Model)) { + if (!ElementRequiresFixup(factType)) + { + return; + } Diagram.FixUpDiagram(model, factType); // Make sure the fact type is already there object AllowMultipleShapes; @@ -1107,11 +1126,14 @@ private static void ModelNoteAddedRule(ElementAddedEventArgs e) { ModelElement element = e.ModelElement; - if (!element.IsDeleted && - !MergeContext.HasContext(element.Store.TransactionManager.CurrentTransaction.TopLevelTransaction)) + if (!element.IsDeleted) { ModelHasModelNote link = (ModelHasModelNote)e.ModelElement; - Diagram.FixUpDiagram(link.Model, link.Note); + ModelNote note = link.Note; + if (ElementRequiresFixup(note)) + { + Diagram.FixUpDiagram(link.Model, note); + } } } #endregion // ModelNoteAddedRule @@ -1331,6 +1353,28 @@ } } #endregion // Shape Invalidation Routines + #region Merge context validation rules + /// <summary> + /// Helper method to determine if a fixup operation + /// should be attempted for an added element. Fixup + /// is not needed if presentation elements are dropped, + /// but it is needed if non-presentation elements are dropped + /// directly. + /// </summary> + /// <param name="element">An element that might require a shape.</param> + /// <returns><see langword="true"/> to continue with fixup.</returns> + public static bool ElementRequiresFixup(ModelElement element) + { + Transaction transaction = element.Store.TransactionManager.CurrentTransaction.TopLevelTransaction; + if (DesignSurfaceMergeContext.GetRootPresentationElements(transaction).Count == 0) + { + IList rootElements = DesignSurfaceMergeContext.GetRootModelElements(transaction); + // Merge if no context is given + return rootElements.Count == 0 || rootElements.Contains(element); + } + return false; + } + #endregion // Merge context validation rules #endregion // View Fixup Rules } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-09-10 05:10:29
|
Revision: 1454 http://orm.svn.sourceforge.net/orm/?rev=1454&view=rev Author: mcurland Date: 2010-09-10 05:10:23 +0000 (Fri, 10 Sep 2010) Log Message: ----------- Miscellaneous bug fixes: * RMap fix: Moving an object type from an rmap-ineligible to an rmap-eligible state does reconsider implicitly or explicitly objectified fact types that use that object type in the preferred (usually internal) identifier. * Role path rule verbalization: Path root references are not verbalizing as calculation inputs. refs #395 * Changed error message for frequency constraint error making 1..* frequency ranges invalid to use the positive 'always satisfied' form instead of 'never violated'. * Fixed sample population editor crash on role order change of non-uniqueness set constraints. Modified Paths: -------------- trunk/ORMModel/Framework/Diagnostics/TransactionLogViewer.resx trunk/ORMModel/ObjectModel/GeneratedCode/DomainModelResx.resx trunk/ORMModel/ObjectModel/ORMCore.dsl trunk/ORMModel/ObjectModel/ORMModel.resx trunk/ORMModel/ObjectModel/Verbalization.cs trunk/ORMModel/Shell/SamplePopulationEditor.cs trunk/Oial/ORMOialBridge/ORMElementGateway.cs Modified: trunk/ORMModel/Framework/Diagnostics/TransactionLogViewer.resx =================================================================== --- trunk/ORMModel/Framework/Diagnostics/TransactionLogViewer.resx 2010-08-18 20:16:38 UTC (rev 1453) +++ trunk/ORMModel/Framework/Diagnostics/TransactionLogViewer.resx 2010-09-10 05:10:23 UTC (rev 1454) @@ -343,8 +343,8 @@ <value>100</value> </data> <data name="FilterLabel.ToolTip" xml:space="preserve"> - <value>Double-click on an item in the grid to apply a filter that includes only similar item. -Multiple filters can be applied simultaneously with additional clicks on other fields. + <value>Double-click on an item in the grid to apply a filter that includes only similar items. +Multiple filters can be applied simultaneously with additional double-clicks in other fields. Press the Escape key to clear a current filter.</value> </data> Modified: trunk/ORMModel/ObjectModel/GeneratedCode/DomainModelResx.resx =================================================================== --- trunk/ORMModel/ObjectModel/GeneratedCode/DomainModelResx.resx 2010-08-18 20:16:38 UTC (rev 1453) +++ trunk/ORMModel/ObjectModel/GeneratedCode/DomainModelResx.resx 2010-09-10 05:10:23 UTC (rev 1454) @@ -1715,7 +1715,7 @@ <comment>Description for DomainClass 'FrequencyConstraintNonRestrictiveRangeError'</comment> </data> <data name="ORMSolutions.ORMArchitect.Core.ObjectModel.FrequencyConstraintNonRestrictiveRangeError.DisplayName" xml:space="preserve"> - <value>One to Unbounded Frequency Range Never Violated</value> + <value>One to Unbounded Frequency Range Always Satisfied</value> <comment>DisplayName for DomainClass 'FrequencyConstraintNonRestrictiveRangeError'</comment> </data> <data name="ORMSolutions.ORMArchitect.Core.ObjectModel.ReadingRequiresUserModificationError.Description" xml:space="preserve"> Modified: trunk/ORMModel/ObjectModel/ORMCore.dsl =================================================================== --- trunk/ORMModel/ObjectModel/ORMCore.dsl 2010-08-18 20:16:38 UTC (rev 1453) +++ trunk/ORMModel/ObjectModel/ORMCore.dsl 2010-09-10 05:10:23 UTC (rev 1454) @@ -1541,7 +1541,7 @@ </BaseClass> </DomainClass> - <DomainClass Name="FrequencyConstraintNonRestrictiveRangeError" Namespace="ORMSolutions.ORMArchitect.Core.ObjectModel" Id="0F5D1CDC-DD98-41CF-9FA8-5328B6F7B8A6" DisplayName="One to Unbounded Frequency Range Never Violated" Description=""> + <DomainClass Name="FrequencyConstraintNonRestrictiveRangeError" Namespace="ORMSolutions.ORMArchitect.Core.ObjectModel" Id="0F5D1CDC-DD98-41CF-9FA8-5328B6F7B8A6" DisplayName="One to Unbounded Frequency Range Always Satisfied" Description=""> <BaseClass> <DomainClassMoniker Name="ModelError"/> </BaseClass> Modified: trunk/ORMModel/ObjectModel/ORMModel.resx =================================================================== --- trunk/ORMModel/ObjectModel/ORMModel.resx 2010-08-18 20:16:38 UTC (rev 1453) +++ trunk/ORMModel/ObjectModel/ORMModel.resx 2010-09-10 05:10:23 UTC (rev 1454) @@ -309,7 +309,7 @@ <comment>The frequency constraint minimum must be less than or equal to the maximum. {0}=constraint name {1}=model name</comment> </data> <data name="ModelError.Constraint.FrequencyConstraintNonRestrictiveRangeError.Text" xml:space="preserve"> - <value>Constraint '{0}' in model '{1}' has an unbounded range with a minimum of one. This frequency pattern is never violated.</value> + <value>Constraint '{0}' in model '{1}' has an unbounded range with a minimum of one. This frequency pattern is always satisfied.</value> <comment>A frequency constraint with a minimum of 1 and an unbounded maximum is always true and should not be specified. {0}=constraint name {1}=model name</comment> </data> <data name="ModelError.Constraint.FrequencyConstraintViolatedByUniquenessConstraintError.Text" xml:space="preserve"> Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2010-08-18 20:16:38 UTC (rev 1453) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2010-09-10 05:10:23 UTC (rev 1454) @@ -3880,12 +3880,17 @@ { int restoreBuilder = builder.Length; PathedRole sourceRole; + RolePathObjectTypeRoot sourceRoot; CalculatedPathValue sourceCalculation; PathConstant sourceConstant; if (null != (sourceRole = calculatedValueInput.SourcePathedRole)) { builder.Append(rendererContext.RenderAssociatedRolePlayer(sourceRole, null, RolePathRolePlayerRenderingOptions.None)); } + else if (null != (sourceRoot = calculatedValueInput.SourcePathRoot)) + { + builder.Append(rendererContext.RenderAssociatedRolePlayer(sourceRoot, null, RolePathRolePlayerRenderingOptions.None)); + } else if (null != (sourceCalculation = calculatedValueInput.SourceCalculatedValue)) { builder.Append(RenderCalculation(sourceCalculation, rendererContext, builder)); Modified: trunk/ORMModel/Shell/SamplePopulationEditor.cs =================================================================== --- trunk/ORMModel/Shell/SamplePopulationEditor.cs 2010-08-18 20:16:38 UTC (rev 1453) +++ trunk/ORMModel/Shell/SamplePopulationEditor.cs 2010-09-10 05:10:23 UTC (rev 1454) @@ -1703,7 +1703,11 @@ { return; } - TestRepopulateForIdentifierPart(((UniquenessConstraint)e.SourceElement).PreferredIdentifierFor); + UniquenessConstraint uniqueness; + if (null != (uniqueness = e.SourceElement as UniquenessConstraint)) + { + TestRepopulateForIdentifierPart(uniqueness.PreferredIdentifierFor); + } } #endregion // Entity Type Instance Event Handlers #region Misc Event Handlers Modified: trunk/Oial/ORMOialBridge/ORMElementGateway.cs =================================================================== --- trunk/Oial/ORMOialBridge/ORMElementGateway.cs 2010-08-18 20:16:38 UTC (rev 1453) +++ trunk/Oial/ORMOialBridge/ORMElementGateway.cs 2010-09-10 05:10:23 UTC (rev 1454) @@ -298,6 +298,15 @@ FilterModifiedObjectType(preferredFor); } } + Objectification objectification; + if (null != (objectification = factType.ImpliedByObjectification)) + { + ObjectType objectifyingType = objectification.NestingType; + if (IsElementExcluded(objectifyingType)) + { + FilterModifiedObjectType(objectifyingType); + } + } } } else if (exclusionLink == null) @@ -416,6 +425,11 @@ ExcludeObjectType(preferredFor, model, false, notifyExcluded); } } + Objectification objectification; + if (null != (objectification = factType.ImpliedByObjectification)) + { + ExcludeObjectType(objectification.NestingType, model, false, notifyExcluded); + } } } private static void ExcludeObjectType(ObjectType objectType) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-07-22 19:25:50
|
Revision: 1452 http://orm.svn.sourceforge.net/orm/?rev=1452&view=rev Author: mcurland Date: 2010-07-22 19:25:43 +0000 (Thu, 22 Jul 2010) Log Message: ----------- * Fix automatic join path creation for uniqueness patterns using more than one role in an objectified fact type and at least one external role. refs #395 * Fix verbalization of introduced variables occurring immediately before a split branch * Fixed verbalization indentation issue with list separators overwriting a nested list Modified Paths: -------------- trunk/ORMModel/ObjectModel/Constraint.cs trunk/ORMModel/ObjectModel/Verbalization.cs trunk/Setup/Readme.htm Modified: trunk/ORMModel/ObjectModel/Constraint.cs =================================================================== --- trunk/ORMModel/ObjectModel/Constraint.cs 2010-07-20 06:01:53 UTC (rev 1451) +++ trunk/ORMModel/ObjectModel/Constraint.cs 2010-07-22 19:25:43 UTC (rev 1452) @@ -4635,7 +4635,17 @@ #if BLOCK_TRIVIAL_JOINPATHS usesOppositeObjectification = true; #endif // BLOCK_TRIVIAL_JOINPATHS + // All roles from the same objectified fact type will + // have the same opposite role player. They all need to + // be moved to the opposite role. usedObjectifyingRole[0] = true; + for (int j = 1; j < constraintRoleCount; ++j) + { + if (j != i && constraintRoles[j].Role.FactType == firstFactType) + { + usedObjectifyingRole[j] = true; + } + } } else { @@ -4661,7 +4671,15 @@ #if BLOCK_TRIVIAL_JOINPATHS usesOppositeObjectification = true; #endif // BLOCK_TRIVIAL_JOINPATHS + // Use objectification for all roles on the original fact type usedObjectifyingRole[0] = true; + for (int j = 1; j < constraintRoleCount; ++j) + { + if (j != i && constraintRoles[j].Role.FactType == firstFactType) + { + usedObjectifyingRole[j] = true; + } + } continue; } } @@ -4710,7 +4728,16 @@ { resolvedOppositeRolePlayer = compatibleSupertype; resolvedOppositeRolePlayerAlternate = null; + + // Use objectification for all roles on the original fact type usedObjectifyingRole[0] = true; + for (int j = 1; j < constraintRoleCount; ++j) + { + if (j != i && constraintRoles[j].Role.FactType == firstFactType) + { + usedObjectifyingRole[j] = true; + } + } #if BLOCK_TRIVIAL_JOINPATHS usesOppositeObjectification = true; multipleCompatibleOppositeRolePlayers = true; Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2010-07-20 06:01:53 UTC (rev 1451) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2010-07-22 19:25:43 UTC (rev 1452) @@ -2912,12 +2912,18 @@ /// <summary> /// A space separated list of list closure snippet names from this /// enum that reverse an indentation. Trailing outdents can be tracked - /// specially during formatting so that external text on the same line - /// as the outdent keeps the same indentation level. + /// specially during formatting so that external text or outer list + /// separator and close elements on the same line as the outdent keeps + /// the same indentation level. /// </summary> ListCloseOutdentSnippets, /// <summary> + /// A space separated list of list separators and close elements that + /// must be placed before any active trailing outdent snippets. /// </summary> + OutdentAwareTrailingListSnippets, + /// <summary> + /// </summary> ChainedListOpen, /// <summary> /// A separator for a chained list where the chained restriction @@ -3384,9 +3390,9 @@ case RolePathVerbalizerSnippetType.AggregateSetProjection: return @"<span class=""quantifier"">each distinct</span> {0}"; case RolePathVerbalizerSnippetType.VariableIntroductionClause: - return @"<span class=""quantifier"">for</span> {0}<span class=""listSeparator"">, </span> "; + return @"<span class=""quantifier"">for</span> {0}<span class=""listSeparator"">, </span>"; case RolePathVerbalizerSnippetType.VariableIntroductionSeparator: - return @"<span class=""listSeparator"">, </span>"; + return @"<span class=""logicalOperator""> and </span>"; case RolePathVerbalizerSnippetType.VariableExistence: return @"{0} <span class=""quantifier"">exists</span>"; case RolePathVerbalizerSnippetType.NegatedVariableExistence: @@ -3395,6 +3401,8 @@ // List management case RolePathVerbalizerSnippetType.ListCloseOutdentSnippets: return @"ChainedListClose NegatedChainedListClose AndTailListClose AndNestedListClose NegatedAndLeadListClose NegatedAndTailListClose NegatedAndNestedListClose OrTailListClose OrNestedListClose NegatedOrLeadListClose NegatedOrTailListClose NegatedOrNestedListClose XorLeadListClose XorTailListClose XorNestedListClose NegatedXorLeadListClose NegatedXorTailListClose NegatedXorNestedListClose"; + case RolePathVerbalizerSnippetType.OutdentAwareTrailingListSnippets: + return @"NegatedAndLeadListSeparator NegatedAndNestedListSeparator NegatedAndTailListSeparator NegatedOrLeadListSeparator NegatedOrNestedListSeparator NegatedOrTailListSeparator XorLeadListSeparator XorNestedListSeparator XorTailListSeparator NegatedXorLeadListSeparator NegatedXorNestedListSeparator NegatedXorTailListSeparator"; case RolePathVerbalizerSnippetType.ChainedListOpen: return "<span>"; case RolePathVerbalizerSnippetType.ChainedListLocalRestrictionSeparator: @@ -5979,6 +5987,11 @@ /// the correct outdent level. Initialized on demand. /// </summary> private BitTracker myOutdentSnippetBits; + /// <summary> + /// Bits to track which trailing list snippets need to be placed + /// before an active outdent position. Initialized on demand. + /// </summary> + private BitTracker myOutdentAwareSnippetBits; #endregion // Member Variables #region Constructor /// <summary> @@ -6642,42 +6655,62 @@ } /// <summary> /// Determine if a specific <see cref="RolePathVerbalizerSnippetType"/> - /// value is marked as an outdent bit by the dyamic <see cref="RolePathVerbalizerSnippetType.ListCloseOutdentSnippets"/> - /// snippet. + /// value is marked as an outdent snippet by the dyamic + /// <see cref="RolePathVerbalizerSnippetType.ListCloseOutdentSnippets"/> snippet. /// </summary> private bool IsOutdentSnippet(RolePathVerbalizerSnippetType snippetType) { BitTracker tracker = myOutdentSnippetBits; if (tracker.Count == 0) { - #region Translate outdent snippet to bits - tracker.Resize((int)RolePathVerbalizerSnippetType.Last + 1); - string[] outdentSnippets = myRenderer.ResolveVerbalizerSnippet(RolePathVerbalizerSnippetType.ListCloseOutdentSnippets).Split((char[])null, StringSplitOptions.RemoveEmptyEntries); - if (outdentSnippets != null) + myOutdentSnippetBits = tracker = TranslateSnippetTypeDirective(RolePathVerbalizerSnippetType.ListCloseOutdentSnippets); + } + return tracker[(int)snippetType]; + } + /// <summary> + /// Determine if a specific <see cref="RolePathVerbalizerSnippetType"/> + /// value is marked as an outdent aware snippet by the dyamic + /// <see cref="RolePathVerbalizerSnippetType.OutdentAwareTrailingListSnippets"/> snippet. + /// </summary> + private bool IsOutdentAwareSnippet(RolePathVerbalizerSnippetType snippetType) + { + BitTracker tracker = myOutdentAwareSnippetBits; + if (tracker.Count == 0) + { + myOutdentAwareSnippetBits = tracker = TranslateSnippetTypeDirective(RolePathVerbalizerSnippetType.OutdentAwareTrailingListSnippets); + } + return tracker[(int)snippetType]; + } + /// <summary> + /// Helper method to return a bit tracker with true values for + /// any snippet type in the space separated string. + /// </summary> + private BitTracker TranslateSnippetTypeDirective(RolePathVerbalizerSnippetType snippetType) + { + BitTracker retVal = new BitTracker((int)RolePathVerbalizerSnippetType.Last + 1); + string[] outdentSnippets = myRenderer.ResolveVerbalizerSnippet(snippetType).Split((char[])null, StringSplitOptions.RemoveEmptyEntries); + if (outdentSnippets != null) + { + Type enumType = typeof(RolePathVerbalizerSnippetType); + for (int i = 0; i < outdentSnippets.Length; ++i) { - Type enumType = typeof(RolePathVerbalizerSnippetType); - for (int i = 0; i < outdentSnippets.Length; ++i) + string outdentSnippetName = outdentSnippets[i]; + object result = null; + try { - string outdentSnippetName = outdentSnippets[i]; - object result = null; - try - { - result = Enum.Parse(enumType, outdentSnippets[i], true); - } - catch (ArgumentException) - { - // Swallow it - } - if (result != null) - { - tracker[(int)(RolePathVerbalizerSnippetType)result] = true; - } + result = Enum.Parse(enumType, outdentSnippets[i], true); } + catch (ArgumentException) + { + // Swallow it + } + if (result != null) + { + retVal[(int)(RolePathVerbalizerSnippetType)result] = true; + } } - myOutdentSnippetBits = tracker; - #endregion // Translate outdent snippet to bits } - return tracker[(int)snippetType]; + return retVal; } private void ResolveReadings(VerbalizationPlanNode verbalizationNode, LinkedNode<VerbalizationPlanNode> verbalizationNodeLink, bool canCollapseLead, ref RolePlayerVariable contextLeadVariable, ref RolePlayerVariable contextTrailingVariable) { @@ -8742,27 +8775,55 @@ !NodeStartsWithVariable(childNode, variableUse.PrimaryRolePlayerVariable)) { childNode.RenderedRequiredContextVariable = true; - LinkedNode<VerbalizationPlanNode> blockLeadRoleModificationNodeLink = childNode.FirstChildNode; - while (blockLeadRoleModificationNodeLink != null) + LinkedNode<VerbalizationPlanNode> modifyNodeLink = childNode.FirstChildNode; + if (modifyNodeLink != null) { - VerbalizationPlanNode blockLeadRoleModificationNode = blockLeadRoleModificationNodeLink.Value; - switch (blockLeadRoleModificationNode.NodeType) + LinkedNode<VerbalizationPlanNode> blockLeadRoleModificationNodeLink = modifyNodeLink; + while (blockLeadRoleModificationNodeLink != null) { - case VerbalizationPlanNodeType.Branch: - blockLeadRoleModificationNodeLink = blockLeadRoleModificationNodeLink.Value.FirstChildNode; - break; - case VerbalizationPlanNodeType.FactType: - readingOptions = blockLeadRoleModificationNode.ReadingOptions; - if (0 != (readingOptions & (VerbalizationPlanReadingOptions.FullyCollapseFirstRole | VerbalizationPlanReadingOptions.BackReferenceFirstRole))) - { - blockLeadRoleModificationNode.ReadingOptions = readingOptions | VerbalizationPlanReadingOptions.BlockFullyCollapseFirstRole | VerbalizationPlanReadingOptions.BlockBackReferenceFirstRole; - } - blockLeadRoleModificationNodeLink = null; - break; - default: - blockLeadRoleModificationNodeLink = null; - break; + VerbalizationPlanNode blockLeadRoleModificationNode = blockLeadRoleModificationNodeLink.Value; + switch (blockLeadRoleModificationNode.NodeType) + { + case VerbalizationPlanNodeType.Branch: + blockLeadRoleModificationNodeLink = blockLeadRoleModificationNodeLink.Value.FirstChildNode; + break; + case VerbalizationPlanNodeType.FactType: + readingOptions = blockLeadRoleModificationNode.ReadingOptions; + if (0 != (readingOptions & (VerbalizationPlanReadingOptions.FullyCollapseFirstRole | VerbalizationPlanReadingOptions.BackReferenceFirstRole))) + { + blockLeadRoleModificationNode.ReadingOptions = readingOptions | VerbalizationPlanReadingOptions.BlockFullyCollapseFirstRole | VerbalizationPlanReadingOptions.BlockBackReferenceFirstRole; + } + blockLeadRoleModificationNodeLink = null; + break; + default: + blockLeadRoleModificationNodeLink = null; + break; + } } + + // Also turn off lead role collapsing on a subsequent child node. Backreferencing is still valid. + blockLeadRoleModificationNodeLink = modifyNodeLink.Next; + while (blockLeadRoleModificationNodeLink != null) + { + VerbalizationPlanNode blockLeadRoleModificationNode = blockLeadRoleModificationNodeLink.Value; + switch (blockLeadRoleModificationNode.NodeType) + { + case VerbalizationPlanNodeType.Branch: + blockLeadRoleModificationNodeLink = blockLeadRoleModificationNodeLink.Value.FirstChildNode; + break; + case VerbalizationPlanNodeType.FactType: + readingOptions = blockLeadRoleModificationNode.ReadingOptions; + if (0 != (readingOptions & VerbalizationPlanReadingOptions.FullyCollapseFirstRole)) + { + blockLeadRoleModificationNode.ReadingOptions = readingOptions | VerbalizationPlanReadingOptions.BlockFullyCollapseFirstRole; + } + blockLeadRoleModificationNodeLink = null; + break; + default: + blockLeadRoleModificationNodeLink = null; + break; + } + } } requiredVariableContextPhrase = QuantifyVariableUse(variableUse, false, false, default(VerbalizationHyphenBinder), -1); requiredVariableUseKeyLink = requiredVariableUseKeyLink.Next; @@ -8795,7 +8856,14 @@ { case VerbalizationPlanBranchType.Chain: case VerbalizationPlanBranchType.NegatedChain: - isTailBranch = nodeLink.Previous != null; + if (node.RenderedRequiredContextVariable) + { + isNestedBranch = true; + } + else + { + isTailBranch = nodeLink.Previous != null; + } break; default: isNestedBranch = true; @@ -8849,6 +8917,7 @@ { snippet = (RolePathVerbalizerSnippetType)((int)snippet + 1); } + nestedOutdent = -1; // Ignore previous nested outdents for lead snippets } else { @@ -8871,15 +8940,15 @@ snippet = RolePathVerbalizerSnippetType.ChainedListCollapsedSeparator; } // Check for a 'TailList', which will render its own lead separator in place of the chain separator. - else if (!(childNode.NodeType == VerbalizationPlanNodeType.Branch && + else if (!(!childNode.RenderedRequiredContextVariable && + childNode.NodeType == VerbalizationPlanNodeType.Branch && BranchSplits(childBranchType = childNode.BranchType) && GetRenderingStyleFromBranchType(childBranchType) == VerbalizationPlanBranchRenderingStyle.OperatorSeparated)) { snippet = (0 != (readingOptions & VerbalizationPlanReadingOptions.FullyCollapseFirstRole)) ? ((isTailBranch || isNestedBranch) ? RolePathVerbalizerSnippetType.ChainedListComplexRestrictionCollapsedLeadSeparator : RolePathVerbalizerSnippetType.ChainedListTopLevelComplexRestrictionCollapsedLeadSeparator) : ((childNode.RestrictsPreviousFactType || - previousChildNodeType == VerbalizationPlanNodeType.ChainedRootVariable || - previousChildNode.RenderedRequiredContextVariable) ? + previousChildNodeType == VerbalizationPlanNodeType.ChainedRootVariable) ? (LeadTextIsBackReference(childNode) ? RolePathVerbalizerSnippetType.ChainedListLocalRestrictionBackReferenceSeparator : RolePathVerbalizerSnippetType.ChainedListLocalRestrictionSeparator) : ((isTailBranch || isNestedBranch) ? (LeadTextIsBackReference(childNode) ? RolePathVerbalizerSnippetType.ChainedListComplexRestrictionBackReferenceSeparator : RolePathVerbalizerSnippetType.ChainedListComplexRestrictionSeparator) : @@ -8906,9 +8975,21 @@ break; } } - if (snippet != (RolePathVerbalizerSnippetType)(-1)) + string separatorText; + if (snippet != (RolePathVerbalizerSnippetType)(-1) && + !string.IsNullOrEmpty(separatorText = renderer.ResolveVerbalizerSnippet(snippet))) { - builder.Append(renderer.ResolveVerbalizerSnippet(snippet)); + if (nestedOutdent != -1 && + IsOutdentAwareSnippet(snippet) && + (nestedOutdent + restoreBuilder) < builder.Length) + { + builder.Insert(nestedOutdent + restoreBuilder, separatorText); + nestedOutdent += separatorText.Length; + } + else + { + builder.Append(separatorText); + } } if (requiredVariableContextPhrase != null) { @@ -8965,12 +9046,23 @@ string closeSnippet = renderer.ResolveVerbalizerSnippet(snippet); if (!string.IsNullOrEmpty(closeSnippet)) { - if (0 != (myOptions & RolePathVerbalizerOptions.MarkTrailingOutdentStart) && - IsOutdentSnippet(snippet)) + if (nestedOutdent != -1 && + IsOutdentAwareSnippet(snippet) && + (nestedOutdent + restoreBuilder) < builder.Length) { - outdentPosition = nestedOutdent != -1 ? nestedOutdent : (builder.Length - restoreBuilder); + builder.Insert(nestedOutdent + restoreBuilder, closeSnippet); + outdentPosition = IsOutdentSnippet(snippet) ? + nestedOutdent : // Nested outdent snippets, the position does not move + nestedOutdent + closeSnippet.Length; // Current node nested, outdent moves after it } - builder.Append(closeSnippet); + else + { + if (IsOutdentSnippet(snippet)) + { + outdentPosition = nestedOutdent != -1 ? nestedOutdent : (builder.Length - restoreBuilder); + } + builder.Append(closeSnippet); + } } else if (nestedOutdent != -1) { @@ -8982,7 +9074,10 @@ PopPairingUsePhase(); } } - if (nodeLink == null && outdentPosition != -1 && outdentPosition < (builder.Length - restoreBuilder)) + if (nodeLink == null && // Outermost + 0 != (myOptions & RolePathVerbalizerOptions.MarkTrailingOutdentStart) && // Options require an outdent mark + outdentPosition != -1 && // Have a trailing outdent with no visible text after it + outdentPosition < (builder.Length - restoreBuilder)) // Outdent has some text after it { builder.Insert(restoreBuilder + outdentPosition, "{0}"); } @@ -9392,6 +9487,7 @@ /// </summary> private bool NodeStartsWithVariable(VerbalizationPlanNode node, RolePlayerVariable variable) { + LinkedNode<VerbalizationPlanNode> childNodeLink; switch (node.NodeType) { case VerbalizationPlanNodeType.FactType: @@ -9400,11 +9496,13 @@ variable == GetRolePlayerVariableUse(entryPathedRole = node.FactTypeEntry).Value.PrimaryRolePlayerVariable && entryPathedRole.Role == node.Reading.RoleCollection[0].Role; case VerbalizationPlanNodeType.Branch: - switch (node.BranchType) + VerbalizationPlanBranchType branchType = node.BranchType; + switch (branchType) { case VerbalizationPlanBranchType.NegatedChain: - VerbalizationPlanNode negatedChildNode = node.FirstChildNode.Value; - if (0 != (negatedChildNode.ReadingOptions & VerbalizationPlanReadingOptions.BasicLeadRole)) + VerbalizationPlanNode negatedChildNode; + if (null != (childNodeLink = node.FirstChildNode) && + 0 != ((negatedChildNode = childNodeLink.Value).ReadingOptions & VerbalizationPlanReadingOptions.BasicLeadRole)) { if (0 != (ResolveDynamicNegatedExitRole(negatedChildNode) & VerbalizationPlanReadingOptions.NegatedExitRole) || GetCollapsibleLeadAllowedFromBranchType(VerbalizationPlanBranchType.NegatedChain)) @@ -9413,6 +9511,13 @@ } } break; + default: + if (null != (childNodeLink = node.FirstChildNode) && + GetCollapsibleLeadAllowedFromBranchType(branchType)) + { + return NodeStartsWithVariable(childNodeLink.Value, variable); + } + break; } break; } Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2010-07-20 06:01:53 UTC (rev 1451) +++ trunk/Setup/Readme.htm 2010-07-22 19:25:43 UTC (rev 1452) @@ -42,7 +42,7 @@ <hr/> <h2>July 2010 CTP Changes</h2> -<div>The July 2010 CTP release includes all modifications through changeset 1451. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The July 2010 CTP release includes all modifications through changeset 1452. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li><a href="#Uniqueness Frequency Join Path Verbalization 2010-07">Uniqueness and frequency constraint join path verbalization</a> </li> <li><a href="#One-to-one Relational Mapping 2010-07">One-to-one Relational Mapping Refinement</a> </li> @@ -54,6 +54,7 @@ <li>Model Browser selection is cached for inactive documents to make document deactivation less intrusive to the current working state. Selection is remembered unless the Model Browser window is closed at any point while the document is inactive.</li> <li>The IsPersonal property is read-only and true for any direct or indirect subtype of an IsPersonal object type. To allow the property to change back to false, the original value of IsPersonal for the subtype does not change, it is just ignored if one or more supertypes are personal.</li> <li>Verbalization for constraints with join paths has been optimized to make more use of back reference constructs and collapse additional lead roles instead of repeating the lead role player.</li> +<li>Automatic join path generation has been expanded to support uniqueness constraints spanning roles in an objectified fact type and roles on fact types with the objectifying entity type as a role player.</li> </ol> </li> <li>Bug Fixes: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-07-20 06:02:01
|
Revision: 1451 http://orm.svn.sourceforge.net/orm/?rev=1451&view=rev Author: mcurland Date: 2010-07-20 06:01:53 +0000 (Tue, 20 Jul 2010) Log Message: ----------- Change version numbers for July 2010 CTP release. refs #193 Modified Paths: -------------- trunk/Setup/Readme.htm trunk/VersionGenerator.exe.config Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2010-07-20 05:45:44 UTC (rev 1450) +++ trunk/Setup/Readme.htm 2010-07-20 06:01:53 UTC (rev 1451) @@ -3,7 +3,7 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"/> -<title>NORMA June 2010 CTP Readme</title> +<title>NORMA July 2010 CTP Readme</title> <style type="text/css"> .new {font-size:x-small; background-color:Gold; color:Blue; } li {padding-bottom: 3px;} @@ -12,9 +12,9 @@ <body> -<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA June 2010 CTP Readme</a> </b></p> +<p><b><a id="The Top" style="font-family:Verdana;font-size:medium">NORMA July 2010 CTP Readme</a> </b></p> <p>This file supersedes the previous readme.txt and older readme.htm files. This readme has parallel indexing mechanisms: by topic, and by release date (starting with the October 2008 (2008-10) release). The file will be extended for future product releases.<br/><br/> -The June 2010 release is an incremental release with addition verbalization for uniqueness and frequency constraints and some relational mapping changes to make one-to-one fact type patterns map more consistently. The internal role path structure has also been extensively modified. Previous .orm files will be updated automatically, but saved files will not save in older versions of the tool. See detailed change notes below for specifics. +The July 2010 release is an incremental release with addition verbalization for uniqueness and frequency constraints and some relational mapping changes to make one-to-one fact type patterns map more consistently. The internal role path structure has also been extensively modified. Previous .orm files will be updated automatically, but saved files will not save in older versions of the tool. See detailed change notes below for specifics. <br/><br/></p> <h2>Contents</h2> <ul> @@ -41,11 +41,11 @@ </ul>--> <hr/> -<h2>June 2010 CTP Changes</h2> -<div>The June 2010 CTP release includes all modifications through changeset 1449. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<h2>July 2010 CTP Changes</h2> +<div>The July 2010 CTP release includes all modifications through changeset 1451. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> -<li><a href="#Uniqueness Frequency Join Path Verbalization 2010-06">Uniqueness and frequency constraint join path verbalization</a> </li> -<li><a href="#One-to-one Relational Mapping 2010-06">One-to-one Relational Mapping Refinement</a> </li> +<li><a href="#Uniqueness Frequency Join Path Verbalization 2010-07">Uniqueness and frequency constraint join path verbalization</a> </li> +<li><a href="#One-to-one Relational Mapping 2010-07">One-to-one Relational Mapping Refinement</a> </li> <li>Other Features: <ol> <li>The majority of changes in this release are internal and relate to ongoing work to make our <em>role path</em> structure relationally complete. Role paths are used for specifying derivation rules and join paths in terms of basic ORM elements (object types and roles). Role path definitions are a large undertaking that will result in major expressibility advances in ORM models, and your patience is appreciated as we refine and test this feature set internally before full public disclosure.</li> @@ -363,7 +363,7 @@ Join paths for set comparison constraints (subset, equality, exclusion) are correctly verbalized. Join paths for simple, unambiguous patterns where joined fact types share a role player or pass through an objectification are generated automatically. More complicated join paths are also verbalized, but cannot be entered with this release of NORMA. The tool(s) to enter these paths will be available in future releases and versions of the product. Note that paths are also automatically generated for uniqueness, frequency, and ring constraints, but join paths are not yet verbalized for these patterns. </li> <li> -<a id="Uniqueness Frequency Join Path Verbalization 2010-06" class="new" title="June 2010 CTP: Uniqueness and frequency constraint join path verbalization">2010-06</a> +<a id="Uniqueness Frequency Join Path Verbalization 2010-07" class="new" title="July 2010 CTP: Uniqueness and frequency constraint join path verbalization">2010-07</a> Join paths for uniqueness and frequency constraints verbalized correctly, leaving joined ring constraints as the only non-verbalized constraint types (adjustment to previous item). Verbalization is now correct for common uniqueness patterns such as using objectified and non-objectified roles in the same constraint. </li> </ol> @@ -475,7 +475,7 @@ <li>Additional abbreviation of individual ObjectType names as well as specific phrases are available in the 'Abbreviations' dialog for any of the Name Generation Settings nodes. Phrase abbreviations can include multiple words and can map to empty strings, which will omit the phrase. Phrases are treated case insensitively for replacement. Note that each child node in the Name Generation Settings branch is a refinement of the parent node and affects the scope where the abbreviation is supplied and all children. For example, changes made with the <em>Relational Names</em> node selected apply to both column and table names.</li> <li><a id="Relational compound name interpretation 2009-06" class="new" title="June 2009 CTP: Relational compound name interpretation">2009-06</a> Name collapsing (showing only one of two equivalent adjacent names) is performed on a whole-word basis to avoid overaggressive collapsing of partial words. For example, in previous releases, <em>BidId</em> would reduce to <em>Bid</em> and <em>FemaleMale</em> to <em>Female</em>, which was clearly incorrect. To balance this fix, the notion of a whole word has been enhanced by recognizing each part of a multi-part word in the conceptual model as a whole word. Any word with embedded capitalization that does not also have two adjacent capitals is automatically treated as a multi-part word (<em>ObjectType</em>, etc). Recognition of these word patterns also enables easier word replacement. For example, replacing the phrase <em>Employee</em> with <em>Emp</em> will affect both <em>Employee</em> and <em>ContractEmployee</em>.</li> -<li><a id="One-to-one Relational Mapping 2010-06" class="new" title="June 2010 CTP: One-to-one Relational Mapping Refinement">2010-06</a> +<li><a id="One-to-one Relational Mapping 2010-07" class="new" title="July 2010 CTP: One-to-one Relational Mapping Refinement">2010-07</a> Analysis of chained 1-1 fact types has been enhanced to provide an experience more consistent with non-chained 1-1 fact types in two ways:<ul><li>If there are multiple 1-1 fact types that can fully absorb an object type (similar to a subtype absorption) towards different object types, then consider the choice arbitrary and do not allow either absorption option.</li><li>Prioritize otherwise equivalent 1-1 chains based on mandatory patterns.</li></ul></li> </ol> <a href="#The Top">Return to top</a> Modified: trunk/VersionGenerator.exe.config =================================================================== --- trunk/VersionGenerator.exe.config 2010-07-20 05:45:44 UTC (rev 1450) +++ trunk/VersionGenerator.exe.config 2010-07-20 06:01:53 UTC (rev 1451) @@ -2,7 +2,7 @@ <configuration> <appSettings> <add key="RevisionStartYearMonth" value="2006-01"/> - <add key="ReleaseYearMonth" value="2010-06"/> + <add key="ReleaseYearMonth" value="2010-07"/> <!-- ReleaseType: "CTP" or "RTM" --> <add key="ReleaseType" value="CTP"/> <!-- Changes to the major and/or minor version numbers have extreme effects across every part of the product. --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-06-04 02:08:07
|
Revision: 1446 http://orm.svn.sourceforge.net/orm/?rev=1446&view=rev Author: mcurland Date: 2010-06-04 02:08:00 +0000 (Fri, 04 Jun 2010) Log Message: ----------- Fixed SetComparisonConstraint verbalization problem with compatible columns. The initial object type list now shows a shared supertype of the role players in each column instead of the type from the first sequence, which would change the constraint verbalization meaning as the sequence order changed. Also added generic signatures for the ObjectType.GetNearestCompatibleType methods. refs #395 Modified Paths: -------------- trunk/ORMModel/ObjectModel/ObjectType.cs trunk/ORMModel/ObjectModel/Verbalization.cs trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs trunk/ORMModel/ObjectModel/VerbalizationGenerator.xml trunk/ORMModel/ObjectModel/VerbalizationGenerator.xsd trunk/ORMModel/ObjectModel/VerbalizationGenerator.xslt trunk/Setup/Readme.htm Modified: trunk/ORMModel/ObjectModel/ObjectType.cs =================================================================== --- trunk/ORMModel/ObjectModel/ObjectType.cs 2010-06-03 22:10:49 UTC (rev 1445) +++ trunk/ORMModel/ObjectModel/ObjectType.cs 2010-06-04 02:08:00 UTC (rev 1446) @@ -1461,25 +1461,39 @@ #endregion // Helper class for GetNearestCompatibleTypes /// <summary> /// Return an ObjectType array containing the nearest compatible - /// types for the given role collection. + /// types for the given collection of role collections. /// </summary> /// <param name="roleCollectionCollection">Set of collections of roles to walk</param> /// <param name="column">The column to test</param> /// <returns>ObjectType[]</returns> public static ObjectType[] GetNearestCompatibleTypes(IEnumerable<IEnumerable<Role>> roleCollectionCollection, int column) { - return GetNearestCompatibleTypes(GetColumnRoleCollection(roleCollectionCollection, column)); + return GetNearestCompatibleTypes(GetRolePlayerCollection(GetColumnCollection(roleCollectionCollection, column), delegate(Role role) { return role.RolePlayer; })); } - private static IEnumerable<Role> GetColumnRoleCollection(IEnumerable<IEnumerable<Role>> roleCollectionCollection, int column) + /// <summary> + /// Return an ObjectType array containing the nearest compatible + /// types for collection of collections of elements that can be + /// converted to an <see cref="ObjectType"/>. + /// </summary> + /// <param name="collectionCollection">Set of collections of convertible elements to walk</param> + /// <param name="column">The column to test</param> + /// <param name="converter">A <see cref="Converter{T,ObjectType}"/> to transform elements.</param> + /// <returns>ObjectType[]</returns> + public static ObjectType[] GetNearestCompatibleTypes<T>(IEnumerable<IEnumerable<T>> collectionCollection, int column, Converter<T, ObjectType> converter) { - foreach (IEnumerable<Role> row in roleCollectionCollection) + return GetNearestCompatibleTypes(GetRolePlayerCollection(GetColumnCollection(collectionCollection, column), converter)); + } + private static IEnumerable<T> GetColumnCollection<T>(IEnumerable<IEnumerable<T>> collectionCollection, int column) + { + foreach (IEnumerable<T> row in collectionCollection) { int currentColumn = 0; - foreach (Role role in row) + foreach (T t in row) { if (currentColumn == column) { - yield return role; + yield return t; + break; } ++currentColumn; } @@ -1493,13 +1507,25 @@ /// <returns>ObjectType[]</returns> public static ObjectType[] GetNearestCompatibleTypes(IEnumerable<Role> roleCollection) { - return GetNearestCompatibleTypes(GetRolePlayerCollection(roleCollection)); + return GetNearestCompatibleTypes(GetRolePlayerCollection(roleCollection, delegate(Role role) { return role.RolePlayer; })); } - private static IEnumerable<ObjectType> GetRolePlayerCollection(IEnumerable<Role> roleCollection) + /// <summary> + /// Return an ObjectType array containing the nearest compatible + /// types for the given collection of elements that can be + /// converted to an <see cref="ObjectType"/>. + /// </summary> + /// <param name="collection">Set of elements to walk</param> + /// <param name="converter">A <see cref="Converter{T,ObjectType}"/> to transform elements.</param> + /// <returns>ObjectType[]</returns> + public static ObjectType[] GetNearestCompatibleTypes<T>(IEnumerable<T> collection, Converter<T, ObjectType> converter) { - foreach (Role role in roleCollection) + return GetNearestCompatibleTypes(GetRolePlayerCollection(collection, converter)); + } + private static IEnumerable<ObjectType> GetRolePlayerCollection<T>(IEnumerable<T> collection, Converter<T, ObjectType> converter) + { + foreach (T t in collection) { - yield return role.RolePlayer; + yield return converter(t); } } /// <summary> Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2010-06-03 22:10:49 UTC (rev 1445) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2010-06-04 02:08:00 UTC (rev 1446) @@ -3101,6 +3101,12 @@ /// suppresses subscripts in this situation. /// </summary> MinimizeHeadSubscripting = 4, + /// <summary> + /// The role player directly associated with a role player key should be replaced + /// with a role player of a resolved supertype. Determination of the associated + /// resolved supertype is dependent on the type of verbalization. + /// </summary> + ResolveSupertype = 8, } #endregion // RolePathRolePlayerRenderingOptions enum #region IRolePathRendererContext interface @@ -7430,6 +7436,18 @@ } } /// <summary> + /// Determine an alternate key for variable rendering that corresponds + /// to a variable with a resolved supertype appropriate associated with + /// the role player key. + /// </summary> + /// <param name="rolePlayerFor">The requested role player key</param> + /// <returns>An alternate key. The default implementation returns + /// the same key.</returns> + protected virtual object ResolveSupertypeKey(object rolePlayerFor) + { + return rolePlayerFor; + } + /// <summary> /// Override to add a filtering to establish which paths should be verbalized. /// Return <see langword="true"/> to allow verbalization of the path. /// </summary> @@ -7647,7 +7665,7 @@ #endregion // Analysis Methods #region Rendering Methods /// <summary> - /// Begin a verbalization of the path(s) and and associate head statement + /// Begin a verbalization of the path(s) and associated head statement /// </summary> public void BeginVerbalization() { @@ -7709,6 +7727,10 @@ { string retVal = null; RoleBase roleBase; // Fallback for common case with non-projected role + if (0 != (renderingOptions & RolePathRolePlayerRenderingOptions.ResolveSupertype)) + { + rolePlayerFor = ResolveSupertypeKey(rolePlayerFor); + } RolePlayerVariableUse? nullableVariableUse = GetRolePlayerVariableUse(rolePlayerFor); bool firstUse = true; if (nullableVariableUse.HasValue) @@ -8904,6 +8926,22 @@ allSequencedRoleLinks[i] = sequencedRoleLinks; } RolePlayerVariable[] columnVariables = new RolePlayerVariable[columnCount]; + + // Determine a shared supertype for each column and register a variable of the appropriate + // type for each column. + for (int i = 0; i < columnCount; ++i) + { + ObjectType[] compatibleTypes = ObjectType.GetNearestCompatibleTypes( + allSequencedRoleLinks, + i, + delegate(ConstraintRoleSequenceHasRole constraintRole) { return constraintRole.Role.RolePlayer; }); + while (compatibleTypes.Length > 1) + { + compatibleTypes = ObjectType.GetNearestCompatibleTypes(compatibleTypes); + } + columnVariables[i] = AddExternalVariable(i, null, compatibleTypes.Length != 0 ? compatibleTypes[0] : null, RolePathNode.Empty); + } + myColumnVariables = columnVariables; for (int i = 0; i < sequenceCount; ++i) { @@ -8948,6 +8986,19 @@ BeginQuantificationUsePhase(); } /// <summary> + /// The resolved supertype for each column is keyed by the column + /// number. Return the column number for a constraint role. + /// </summary> + protected override object ResolveSupertypeKey(object rolePlayerFor) + { + ConstraintRoleSequenceHasRole constraintRole; + if (null != (constraintRole = rolePlayerFor as ConstraintRoleSequenceHasRole)) + { + return constraintRole.ConstraintRoleSequence.RoleCollection.IndexOf(constraintRole.Role); + } + return base.ResolveSupertypeKey(rolePlayerFor); + } + /// <summary> /// Verbalize a path if it is projected /// </summary> protected override bool VerbalizesPath(RolePathOwner pathOwner, LeadRolePath rolePath) Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2010-06-03 22:10:49 UTC (rev 1445) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2010-06-04 02:08:00 UTC (rev 1446) @@ -11755,7 +11755,7 @@ } for (int RoleIter1 = 0; RoleIter1 < 1; ++RoleIter1) { - sbTemp.Append(pathVerbalizer.RenderAssociatedRolePlayer(includedConstraintRoles[RoleIter1], null, RolePathRolePlayerRenderingOptions.UsedInVerbalizationHead | RolePathRolePlayerRenderingOptions.MinimizeHeadSubscripting)); + sbTemp.Append(pathVerbalizer.RenderAssociatedRolePlayer(includedConstraintRoles[RoleIter1], null, RolePathRolePlayerRenderingOptions.UsedInVerbalizationHead | RolePathRolePlayerRenderingOptions.MinimizeHeadSubscripting | RolePathRolePlayerRenderingOptions.ResolveSupertype)); } snippet1Replace1Replace1 = sbTemp.ToString(); } @@ -11915,7 +11915,7 @@ listSnippet = CoreVerbalizationSnippetType.SimpleLogicalAndListSeparator; } sbTemp.Append(snippets.GetSnippet(listSnippet, isDeontic, isNegative)); - sbTemp.Append(pathVerbalizer.RenderAssociatedRolePlayer(includedConstraintRoles[RoleIter1], null, RolePathRolePlayerRenderingOptions.UsedInVerbalizationHead | RolePathRolePlayerRenderingOptions.MinimizeHeadSubscripting)); + sbTemp.Append(pathVerbalizer.RenderAssociatedRolePlayer(includedConstraintRoles[RoleIter1], null, RolePathRolePlayerRenderingOptions.UsedInVerbalizationHead | RolePathRolePlayerRenderingOptions.MinimizeHeadSubscripting | RolePathRolePlayerRenderingOptions.ResolveSupertype)); if (RoleIter1 == columnArity - 1) { sbTemp.Append(snippets.GetSnippet(CoreVerbalizationSnippetType.SimpleLogicalAndListClose, isDeontic, isNegative)); @@ -12079,7 +12079,7 @@ listSnippet = CoreVerbalizationSnippetType.SimpleLogicalAndListSeparator; } sbTemp.Append(snippets.GetSnippet(listSnippet, isDeontic, isNegative)); - sbTemp.Append(pathVerbalizer.RenderAssociatedRolePlayer(includedConstraintRoles[RoleIter1], null, RolePathRolePlayerRenderingOptions.UsedInVerbalizationHead | RolePathRolePlayerRenderingOptions.MinimizeHeadSubscripting)); + sbTemp.Append(pathVerbalizer.RenderAssociatedRolePlayer(includedConstraintRoles[RoleIter1], null, RolePathRolePlayerRenderingOptions.UsedInVerbalizationHead | RolePathRolePlayerRenderingOptions.MinimizeHeadSubscripting | RolePathRolePlayerRenderingOptions.ResolveSupertype)); if (RoleIter1 == columnArity - 1) { sbTemp.Append(snippets.GetSnippet(CoreVerbalizationSnippetType.SimpleLogicalAndListClose, isDeontic, isNegative)); @@ -12494,7 +12494,7 @@ listSnippet = CoreVerbalizationSnippetType.SimpleLogicalAndListSeparator; } sbTemp.Append(snippets.GetSnippet(listSnippet, isDeontic, isNegative)); - sbTemp.Append(pathVerbalizer.RenderAssociatedRolePlayer(includedConstraintRoles[RoleIter1], null, RolePathRolePlayerRenderingOptions.UsedInVerbalizationHead | RolePathRolePlayerRenderingOptions.MinimizeHeadSubscripting)); + sbTemp.Append(pathVerbalizer.RenderAssociatedRolePlayer(includedConstraintRoles[RoleIter1], null, RolePathRolePlayerRenderingOptions.UsedInVerbalizationHead | RolePathRolePlayerRenderingOptions.MinimizeHeadSubscripting | RolePathRolePlayerRenderingOptions.ResolveSupertype)); if (RoleIter1 == columnArity - 1) { sbTemp.Append(snippets.GetSnippet(CoreVerbalizationSnippetType.SimpleLogicalAndListClose, isDeontic, isNegative)); @@ -12918,7 +12918,7 @@ listSnippet = CoreVerbalizationSnippetType.SimpleLogicalAndListSeparator; } sbTemp.Append(snippets.GetSnippet(listSnippet, isDeontic, isNegative)); - sbTemp.Append(pathVerbalizer.RenderAssociatedRolePlayer(includedConstraintRoles[RoleIter1], null, RolePathRolePlayerRenderingOptions.UsedInVerbalizationHead | RolePathRolePlayerRenderingOptions.MinimizeHeadSubscripting)); + sbTemp.Append(pathVerbalizer.RenderAssociatedRolePlayer(includedConstraintRoles[RoleIter1], null, RolePathRolePlayerRenderingOptions.UsedInVerbalizationHead | RolePathRolePlayerRenderingOptions.MinimizeHeadSubscripting | RolePathRolePlayerRenderingOptions.ResolveSupertype)); if (RoleIter1 == columnArity - 1) { sbTemp.Append(snippets.GetSnippet(CoreVerbalizationSnippetType.SimpleLogicalAndListClose, isDeontic, isNegative)); @@ -13157,7 +13157,7 @@ listSnippet = CoreVerbalizationSnippetType.SimpleLogicalAndListSeparator; } sbTemp.Append(snippets.GetSnippet(listSnippet, isDeontic, isNegative)); - sbTemp.Append(pathVerbalizer.RenderAssociatedRolePlayer(includedConstraintRoles[RoleIter1], null, RolePathRolePlayerRenderingOptions.UsedInVerbalizationHead | RolePathRolePlayerRenderingOptions.MinimizeHeadSubscripting)); + sbTemp.Append(pathVerbalizer.RenderAssociatedRolePlayer(includedConstraintRoles[RoleIter1], null, RolePathRolePlayerRenderingOptions.UsedInVerbalizationHead | RolePathRolePlayerRenderingOptions.MinimizeHeadSubscripting | RolePathRolePlayerRenderingOptions.ResolveSupertype)); if (RoleIter1 == columnArity - 1) { sbTemp.Append(snippets.GetSnippet(CoreVerbalizationSnippetType.SimpleLogicalAndListClose, isDeontic, isNegative)); Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.xml =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.xml 2010-06-03 22:10:49 UTC (rev 1445) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.xml 2010-06-04 02:08:00 UTC (rev 1446) @@ -1644,7 +1644,7 @@ <Snippet ref="ImpliedModalNecessityOperator"> <Snippet ref="ForEachIndentedQuantifier"> <IterateSequences listStyle="null" pass="first"> - <IterateRoles listStyle="null" match="providedConstraintRoles" pass="first" markProvidedConstraintRolesAsHead="true" minimizeProvidedConstraintRoleHeadSubscripting="true"/> + <IterateRoles listStyle="null" match="providedConstraintRoles" pass="first" markProvidedConstraintRolesAsHead="true" minimizeProvidedConstraintRoleHeadSubscripting="true" resolveProvidedConstraintRoleSupertype="true"/> </IterateSequences> <Snippet ref="Equality"> <IterateSequences listStyle="null" pass="first"> @@ -1675,7 +1675,7 @@ <Snippet ref="ImpliedModalNecessityOperator"> <Snippet ref="ForEachIndentedQuantifier"> <IterateSequences listStyle="null" pass="first"> - <IterateRoles listStyle="SimpleLogicalAndList" match="providedConstraintRoles" markProvidedConstraintRolesAsHead="true" minimizeProvidedConstraintRoleHeadSubscripting="true"/> + <IterateRoles listStyle="SimpleLogicalAndList" match="providedConstraintRoles" markProvidedConstraintRolesAsHead="true" minimizeProvidedConstraintRoleHeadSubscripting="true" resolveProvidedConstraintRoleSupertype="true"/> </IterateSequences> <Snippet ref="Equality"> <IterateSequences listStyle="null" pass="first"> @@ -1706,7 +1706,7 @@ <Snippet ref="ImpliedModalNecessityOperator"> <Snippet ref="ForEachCompactQuantifier"> <IterateSequences listStyle="null" pass="first"> - <IterateRoles match="providedConstraintRoles" listStyle="SimpleLogicalAndList" markProvidedConstraintRolesAsHead="true" minimizeProvidedConstraintRoleHeadSubscripting="true"/> + <IterateRoles match="providedConstraintRoles" listStyle="SimpleLogicalAndList" markProvidedConstraintRolesAsHead="true" minimizeProvidedConstraintRoleHeadSubscripting="true" resolveProvidedConstraintRoleSupertype="true"/> </IterateSequences> <Snippet ref="GroupEquality"> <IterateSequences listStyle="MultilineIndentedCompoundList" compositeList="true"> @@ -1733,7 +1733,7 @@ <Snippet ref="ImpliedModalNecessityOperator"> <Snippet ref="ForEachCompactQuantifier"> <IterateSequences listStyle="null" pass="first"> - <IterateRoles match="providedConstraintRoles" listStyle="SimpleLogicalAndList" markProvidedConstraintRolesAsHead="true" minimizeProvidedConstraintRoleHeadSubscripting="true"/> + <IterateRoles match="providedConstraintRoles" listStyle="SimpleLogicalAndList" markProvidedConstraintRolesAsHead="true" minimizeProvidedConstraintRoleHeadSubscripting="true" resolveProvidedConstraintRoleSupertype="true"/> </IterateSequences> <ConditionalSnippet> <Snippet ref="GroupExclusiveOr" conditionalMatch="ExclusionIsExclusiveOrConstraint"/> @@ -1791,7 +1791,7 @@ </IterateSequences> </Snippet> <IterateSequences listStyle="null" pass="first"> - <IterateRoles match="providedConstraintRoles" listStyle="SimpleLogicalAndList" markProvidedConstraintRolesAsHead="true" minimizeProvidedConstraintRoleHeadSubscripting="true"/> + <IterateRoles match="providedConstraintRoles" listStyle="SimpleLogicalAndList" markProvidedConstraintRolesAsHead="true" minimizeProvidedConstraintRoleHeadSubscripting="true" resolveProvidedConstraintRoleSupertype="true"/> </IterateSequences> </ConditionalReplacement> <ConditionalReplacement> @@ -1822,7 +1822,7 @@ <Snippet ref="ImpliedModalNecessityOperator"> <Snippet ref="ForEachCompactQuantifier"> <IterateSequences listStyle="null" pass="first"> - <IterateRoles match="providedConstraintRoles" listStyle="SimpleLogicalAndList" markProvidedConstraintRolesAsHead="true" minimizeProvidedConstraintRoleHeadSubscripting="true"/> + <IterateRoles match="providedConstraintRoles" listStyle="SimpleLogicalAndList" markProvidedConstraintRolesAsHead="true" minimizeProvidedConstraintRoleHeadSubscripting="true" resolveProvidedConstraintRoleSupertype="true"/> </IterateSequences> <Snippet ref="GroupExclusion"> <IterateSequences listStyle="MultilineIndentedCompoundList" compositeList="true"> Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.xsd =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.xsd 2010-06-03 22:10:49 UTC (rev 1445) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.xsd 2010-06-04 02:08:00 UTC (rev 1446) @@ -1447,6 +1447,11 @@ <xs:documentation>Used with the providedConstraintRoles match style. Do not subscript a head variable of a type that is used for a single variable and also used fully existentially.</xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="resolveProvidedConstraintRoleSupertype" type="xs:boolean" default="false"> + <xs:annotation> + <xs:documentation>Used with the providedConstraintRoles match style. Request that a resolved supertype variable be used in place of the role player directly associated with the constraint role.</xs:documentation> + </xs:annotation> + </xs:attribute> <xs:attribute name="quantifyProvidedConstraintRoles" default="false" type="xs:boolean"> <xs:annotation> <xs:documentation>Used with the providedConstraintRoles match style. Quantify the returned replacement field.</xs:documentation> Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.xslt =================================================================== (Binary files differ) Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2010-06-03 22:10:49 UTC (rev 1445) +++ trunk/Setup/Readme.htm 2010-06-04 02:08:00 UTC (rev 1446) @@ -42,7 +42,7 @@ <hr/> <h2>May 2010 CTP Changes</h2> -<div>The May 2010 CTP release includes all modifications through changeset 1445. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The May 2010 CTP release includes all modifications through changeset 1446. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li><a href="#Uniqueness Frequency Join Path Verbalization 2010-05">Uniqueness and frequency constraint join path verbalization</a> </li> <li><a href="#One-to-one Relational Mapping 2010-05">One-to-one Relational Mapping Refinement</a> </li> @@ -57,6 +57,7 @@ <li>The <em>Is Mandatory</em> menu was incorrectly enabled for a unary role.</li> <li>Value constraints on remote identifying roles\x97where an entity type is (possibly recursively) identified by another entity type\x97were not correctly revalidated on a preferred identifier change.</li> <li>Style specifications used in the core verbalization were not included in the generated report styles. All report styles have now been brought up to date.</li> +<li>Set comparison constraint verbalization across compatible types was not choosing a shared column supertype for the initial object type list, resulting in verbalizations with different meanings when the constraint sequence order was changed.</li> </ol> </li> </ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-06-03 22:10:55
|
Revision: 1445 http://orm.svn.sourceforge.net/orm/?rev=1445&view=rev Author: mcurland Date: 2010-06-03 22:10:49 +0000 (Thu, 03 Jun 2010) Log Message: ----------- Miscellaneous bug fixes for [1444]. refs #395 Modified Paths: -------------- trunk/ORMModel/ObjectModel/RolePath.cs trunk/ORMModel/ObjectModel/Verbalization.cs trunk/Setup/Readme.htm Modified: trunk/ORMModel/ObjectModel/RolePath.cs =================================================================== --- trunk/ORMModel/ObjectModel/RolePath.cs 2010-06-03 05:50:56 UTC (rev 1444) +++ trunk/ORMModel/ObjectModel/RolePath.cs 2010-06-03 22:10:49 UTC (rev 1445) @@ -1878,17 +1878,15 @@ /// </summary> private static void PathedRoleUnificationDeletedRule(ElementDeletedEventArgs e) { - PathObjectUnifierUnifiesPathedRole link = (PathObjectUnifierUnifiesPathedRole)e.ModelElement; - PathObjectUnifier objectUnifier; - LeadRolePath rolePath; - if (!link.IsDeleted && - null != (rolePath = (objectUnifier = link.ObjectUnifier).LeadRolePath)) + PathObjectUnifier objectUnifier = ((PathObjectUnifierUnifiesPathedRole)e.ModelElement).ObjectUnifier; + if (!objectUnifier.IsDeleted) { + LeadRolePath rolePath; if (1 >= (objectUnifier.PathedRoleCollection.Count + objectUnifier.PathRootCollection.Count)) { objectUnifier.Delete(); } - else + else if (null != (rolePath = objectUnifier.LeadRolePath)) { AddDelayedPathValidation(rolePath); } @@ -1942,17 +1940,15 @@ /// </summary> private static void RolePathRootUnificationDeletedRule(ElementDeletedEventArgs e) { - PathObjectUnifierUnifiesRolePathRoot link = (PathObjectUnifierUnifiesRolePathRoot)e.ModelElement; - PathObjectUnifier objectUnifier; - LeadRolePath rolePath; - if (!link.IsDeleted && - null != (rolePath = (objectUnifier = link.ObjectUnifier).LeadRolePath)) + PathObjectUnifier objectUnifier = ((PathObjectUnifierUnifiesRolePathRoot)e.ModelElement).ObjectUnifier; + if (!objectUnifier.IsDeleted) { + LeadRolePath rolePath; if (1 >= (objectUnifier.PathedRoleCollection.Count + objectUnifier.PathRootCollection.Count)) { objectUnifier.Delete(); } - else + else if (null != (rolePath = objectUnifier.LeadRolePath)) { AddDelayedPathValidation(rolePath); } @@ -5105,7 +5101,7 @@ /// </summary> private static void FunctionAddedRule(ElementAddedEventArgs e) { - FrameworkDomainModel.DelayValidateElement(e.ModelElement, DelayValidateFunction); + FrameworkDomainModel.DelayValidateElement(((ModelDefinesFunction)e.ModelElement).Function, DelayValidateFunction); } private static void DelayValidateFunction(ModelElement element) { Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2010-06-03 05:50:56 UTC (rev 1444) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2010-06-03 22:10:49 UTC (rev 1445) @@ -7904,7 +7904,7 @@ case VerbalizationPlanNodeType.Branch: int restoreBuilder = builder.Length; VerbalizationPlanBranchType branchType = node.BranchType; - VerbalizationPlanBranchRenderingStyle renderingStyle = VerbalizationPlanBranchRenderingStyle.OperatorSeparated; + VerbalizationPlanBranchRenderingStyle renderingStyle = node.BranchRenderingStyle; childNodeLink = node.FirstChildNode; bool first = true; bool isNestedBranch = false; @@ -7918,19 +7918,22 @@ { snippet = (RolePathVerbalizerSnippetType)(-1); childNode = childNodeLink.Value; + switch (renderingStyle) + { + case VerbalizationPlanBranchRenderingStyle.HeaderList: + if (!first) + { + PopPairingUsePhase(); + } + PushPairingUsePhase(); + break; + case VerbalizationPlanBranchRenderingStyle.IsolatedList: + BeginQuantificationUsePhase(); + break; + } if (first) { first = false; - renderingStyle = GetRenderingStyleFromBranchType(branchType); - switch (renderingStyle) - { - case VerbalizationPlanBranchRenderingStyle.HeaderList: - PushPairingUsePhase(); - break; - case VerbalizationPlanBranchRenderingStyle.IsolatedList: - BeginQuantificationUsePhase(); - break; - } VerbalizationPlanNode parentNode = node.ParentNode; if (parentNode != null) { Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2010-06-03 05:50:56 UTC (rev 1444) +++ trunk/Setup/Readme.htm 2010-06-03 22:10:49 UTC (rev 1445) @@ -42,7 +42,7 @@ <hr/> <h2>May 2010 CTP Changes</h2> -<div>The May 2010 CTP release includes all modifications through changeset 1444. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The May 2010 CTP release includes all modifications through changeset 1445. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li><a href="#Uniqueness Frequency Join Path Verbalization 2010-05">Uniqueness and frequency constraint join path verbalization</a> </li> <li><a href="#One-to-one Relational Mapping 2010-05">One-to-one Relational Mapping Refinement</a> </li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-05-27 23:05:22
|
Revision: 1442 http://orm.svn.sourceforge.net/orm/?rev=1442&view=rev Author: mcurland Date: 2010-05-27 23:05:16 +0000 (Thu, 27 May 2010) Log Message: ----------- Add element-level custom deletion hooks to allow elements more flexibility in specifying how they are to be deleted. Handles role path scenario supporting ownership transfer of a path from one container to another. refs #395 Modified Paths: -------------- trunk/ORMModel/Framework/FrameworkServices.cs trunk/ORMModel/ShapeModel/ReadingShape.cs trunk/ORMModel/ShapeModel/RoleNameShape.cs trunk/ORMModel/Shell/ORMDesignerCommandManager.cs trunk/ORMModel/Shell/ORMModelBrowser.cs Modified: trunk/ORMModel/Framework/FrameworkServices.cs =================================================================== --- trunk/ORMModel/Framework/FrameworkServices.cs 2010-05-27 06:01:30 UTC (rev 1441) +++ trunk/ORMModel/Framework/FrameworkServices.cs 2010-05-27 23:05:16 UTC (rev 1442) @@ -197,14 +197,30 @@ bool MergeRelateIndirect(T mergeContext, ModelElement sourceElement, ElementGroup elementGroup); } #endregion // IMergeIndirectElements<T> interface - #region IAllowsStandardCommands interface + #region IAllowStandardCommands interface /// <summary> - /// Implement the <see cref="IAllowStandardCommands"/> to turn - /// on standard command handling for a shape or element. Standard - /// commands allow element and shape deletion, shape alignment, and layout. + /// Implement IAllowStandardCommands to enable standard command + /// handling for a shape or element. Standard commands allow + /// element and shape deletion, shape alignment, and layout. /// </summary> public interface IAllowStandardCommands { } - #endregion // IAllowsStandardCommands interface + #endregion // IAllowStandardCommands interface + #region ICustomElementDeletion interface + /// <summary> + /// Implement ICustomElementDeletion to replace the standard + /// <see cref="ModelElement.Delete()"/> to handle deletion of + /// the implementing element. ICustomElementDeletion can be + /// coupled with <see cref="IAllowStandardCommands"/> to + /// enable deletion on extension elements. + /// </summary> + public interface ICustomElementDeletion + { + /// <summary> + /// Delete the current element. + /// </summary> + void DeleteCustomElement(); + } + #endregion // ICustomElementDeletion interface } Modified: trunk/ORMModel/ShapeModel/ReadingShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ReadingShape.cs 2010-05-27 06:01:30 UTC (rev 1441) +++ trunk/ORMModel/ShapeModel/ReadingShape.cs 2010-05-27 23:05:16 UTC (rev 1442) @@ -37,7 +37,7 @@ namespace ORMSolutions.ORMArchitect.Core.ShapeModel { - public partial class ReadingShape : IModelErrorActivation, ISelectionContainerFilter, IDynamicColorGeometryHost + public partial class ReadingShape : IModelErrorActivation, ISelectionContainerFilter, IDynamicColorGeometryHost, ICustomElementDeletion { #region IDynamicColorGeometryHost Implementation /// <summary> @@ -1231,6 +1231,26 @@ } } #endregion // ISelectionContainerFilter Implementation + #region ICustomElementDeletion Implementation + /// <summary> + /// Implements <see cref="ICustomElementDeletion.DeleteCustomElement"/> + /// A reading shape selection should delete the fact type. + /// </summary> + protected void DeleteCustomElement() + { + ReadingOrder readingOrder; + FactType factType; + if (null != (readingOrder = ModelElement as ReadingOrder) && + null != (factType = readingOrder.FactType)) + { + factType.Delete(); + } + } + void ICustomElementDeletion.DeleteCustomElement() + { + DeleteCustomElement(); + } + #endregion // ICustomElementDeletion Implementation #region Mouse handling /// <summary> /// Attempt model error activation Modified: trunk/ORMModel/ShapeModel/RoleNameShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/RoleNameShape.cs 2010-05-27 06:01:30 UTC (rev 1441) +++ trunk/ORMModel/ShapeModel/RoleNameShape.cs 2010-05-27 23:05:16 UTC (rev 1442) @@ -31,7 +31,7 @@ namespace ORMSolutions.ORMArchitect.Core.ShapeModel { - public partial class RoleNameShape : ISelectionContainerFilter, IProxyDisplayProvider, IDynamicColorGeometryHost + public partial class RoleNameShape : ISelectionContainerFilter, IProxyDisplayProvider, IDynamicColorGeometryHost, ICustomElementDeletion { #region Member Variables private static AutoSizeTextField myTextField; @@ -359,5 +359,23 @@ return ElementDisplayedAs(element, forError); } #endregion // IProxyDisplayProvider Implementation + #region ICustomElementDeletion Implementation + /// <summary> + /// Implements <see cref="ICustomElementDeletion.DeleteCustomElement"/> + /// Clear the role name on deletion instead of deleting the role itself. + /// </summary> + protected void DeleteCustomElement() + { + Role role = ModelElement as Role; + if (role != null) + { + role.Name = ""; + } + } + void ICustomElementDeletion.DeleteCustomElement() + { + DeleteCustomElement(); + } + #endregion // ICustomElementDeletion Implementation } } Modified: trunk/ORMModel/Shell/ORMDesignerCommandManager.cs =================================================================== --- trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2010-05-27 06:01:30 UTC (rev 1441) +++ trunk/ORMModel/Shell/ORMDesignerCommandManager.cs 2010-05-27 23:05:16 UTC (rev 1442) @@ -1733,7 +1733,7 @@ // up before committing. bool complexSelection = 0 == (enabledCommands & ORMDesignerCommands.Delete); - Diagram d = null; + Diagram diagram = null; // Use the localized text from the command for our transaction name using (Transaction t = store.TransactionManager.BeginTransaction(commandText.Replace("&", string.Empty))) { @@ -1746,6 +1746,7 @@ object selectedObject = selectedElements[i]; ShapeElement pel; // just the shape ModelElement mel; + ICustomElementDeletion customDeletion; bool deleteReferenceModeValueTypeInContext = false; if (null != (pel = selectedObject as ShapeElement)) { @@ -1759,11 +1760,17 @@ { continue; } - if (d == null) + if (diagram == null) { - d = pel.Diagram; + diagram = pel.Diagram; } + if (null != (customDeletion = pel as ICustomElementDeletion)) + { + customDeletion.DeleteCustomElement(); + continue; + } + // Get the actual object inside the pel before // removing the pel. mel = pel.ModelElement; @@ -1771,52 +1778,53 @@ // Remove the actual object in the model if (mel != null && !mel.IsDeleted) { - Role role; - if (null != (role = mel as Role) && pel is RoleNameShape) + // Check if the object shape was in expanded mode + bool testRefModeCollapse = complexSelection || 0 != (enabledCommands & ORMDesignerCommands.DeleteObjectType); + ObjectTypeShape objectShape; + ObjectifiedFactTypeNameShape objectifiedShape; + if (testRefModeCollapse && + ((null != (objectShape = pel as ObjectTypeShape) && + !objectShape.ExpandRefMode) || + (null != (objectifiedShape = pel as ObjectifiedFactTypeNameShape) && + !objectifiedShape.ExpandRefMode)) + ) { - role.Name = ""; + if (!deleteReferenceModeValueTypeInContext) + { + contextInfo[ObjectType.DeleteReferenceModeValueType] = null; + deleteReferenceModeValueTypeInContext = true; + } } + else if (deleteReferenceModeValueTypeInContext) + { + deleteReferenceModeValueTypeInContext = false; + contextInfo.Remove(ObjectType.DeleteReferenceModeValueType); + } + + // Get rid of the model element. Delete propagation on the PresentationViewsSubject + // relationship will automatically delete the pel. + if (null != (customDeletion = mel as ICustomElementDeletion)) + { + customDeletion.DeleteCustomElement(); + } else { - ReadingOrder readingOrder = mel as ReadingOrder; - if (readingOrder != null) - { - mel = readingOrder.FactType; - } - // Check if the object shape was in expanded mode - bool testRefModeCollapse = complexSelection || 0 != (enabledCommands & ORMDesignerCommands.DeleteObjectType); - ObjectTypeShape objectShape; - ObjectifiedFactTypeNameShape objectifiedShape; - if (testRefModeCollapse && - ((null != (objectShape = pel as ObjectTypeShape) && - !objectShape.ExpandRefMode) || - (null != (objectifiedShape = pel as ObjectifiedFactTypeNameShape) && - !objectifiedShape.ExpandRefMode)) - ) - { - if (!deleteReferenceModeValueTypeInContext) - { - contextInfo[ObjectType.DeleteReferenceModeValueType] = null; - deleteReferenceModeValueTypeInContext = true; - } - } - else if (deleteReferenceModeValueTypeInContext) - { - deleteReferenceModeValueTypeInContext = false; - contextInfo.Remove(ObjectType.DeleteReferenceModeValueType); - } - - // Get rid of the model element. Delete propagation on the PresentationViewsSubject - // relationship will automatically delete the pel. mel.Delete(); } } } else if (null != (mel = selectedObject as ModelElement) && !mel.IsDeleted) { - // Remove the item - mel.Delete(); + customDeletion = mel as ICustomElementDeletion; + if (customDeletion != null) + { + customDeletion.DeleteCustomElement(); + } + else + { + mel.Delete(); + } } } @@ -1826,7 +1834,7 @@ } } - if (d != null) + if (diagram != null) { // Clearing the selection selects the diagram view.CurrentDesigner.Selection.Clear(); Modified: trunk/ORMModel/Shell/ORMModelBrowser.cs =================================================================== --- trunk/ORMModel/Shell/ORMModelBrowser.cs 2010-05-27 06:01:30 UTC (rev 1441) +++ trunk/ORMModel/Shell/ORMModelBrowser.cs 2010-05-27 23:05:16 UTC (rev 1442) @@ -468,7 +468,15 @@ } if (executeDelete) { - deleteTarget.Delete(); + ICustomElementDeletion customDeletion = deleteTarget as ICustomElementDeletion; + if (customDeletion != null) + { + customDeletion.DeleteCustomElement(); + } + else + { + deleteTarget.Delete(); + } } } if (t.HasPendingChanges) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-04-14 06:53:50
|
Revision: 1438 http://orm.svn.sourceforge.net/orm/?rev=1438&view=rev Author: mcurland Date: 2010-04-14 06:53:40 +0000 (Wed, 14 Apr 2010) Log Message: ----------- * Fixed some verbalization cases with subtype navigation. refs #395 * Fixed crash changing a remote correlation target Modified Paths: -------------- trunk/ORMModel/ObjectModel/RolePath.cs trunk/ORMModel/ObjectModel/Verbalization.cs Modified: trunk/ORMModel/ObjectModel/RolePath.cs =================================================================== --- trunk/ORMModel/ObjectModel/RolePath.cs 2010-04-02 22:27:07 UTC (rev 1437) +++ trunk/ORMModel/ObjectModel/RolePath.cs 2010-04-14 06:53:40 UTC (rev 1438) @@ -1252,7 +1252,7 @@ private static void RemoteCorrelationRolePlayerChangedRule(RolePlayerChangedEventArgs e) { // This will always change within the same lead path. Just use the new role player. - AddDelayedPathValidation((RolePath)e.NewRolePlayer); + AddDelayedPathValidation(((PathedRole)e.NewRolePlayer).RolePath); } /// <summary> /// AddRule: typeof(RolePathOwner) Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2010-04-02 22:27:07 UTC (rev 1437) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2010-04-14 06:53:40 UTC (rev 1438) @@ -4054,7 +4054,7 @@ /// the same set.</remarks> public bool AddCorrelatedVariable(RolePlayerVariable variable) { - if (myPrimaryVariable == variable) + if (myPrimaryVariable == variable || variable == null) { return false; } @@ -4298,6 +4298,18 @@ explicitParent = retVal.CorrelatingParent; } } + if (retVal.Role is SubtypeMetaRole && retVal.PathedRolePurpose == PathedRolePurpose.SameFactType) + { + foreach (PathedRole precedingPathedRole in GetPrecedingPathedRoles(retVal, false)) + { + // UNDONE: Consider supporting this pattern for negation as well. + if (precedingPathedRole.Role is SupertypeMetaRole && !retVal.IsNegated) + { + retVal = GetCorrelationRootPathedRole(precedingPathedRole); + } + break; + } + } return retVal; } /// <summary> @@ -6759,11 +6771,7 @@ useMap.TryGetValue(subtypePathedRole, out subtypeVariableUse)) { currentNode.Detach(ref headChildNode); - // Note that both variables are already registered, this just modifies the settings - // and adjust or adds the the join for the subtype variable. There is no need to remove - // other parts of the registered variable information. If there is a chained subtype, then - // the middle correlations steps will just be ignored. - RegisterRolePlayerUse(subtypePathedRole.Role.RolePlayer, supertypeVariableUse.PrimaryRolePlayerVariable, subtypePathedRole, null); + // Note that the variables are already correlated, all we need to do is pull the path. } } } @@ -7025,10 +7033,22 @@ RolePlayerVariableUse existingVariableUse; if (useMap.TryGetValue(usedFor, out existingVariableUse)) { - if (existingVariableUse.JoinedToVariable != joinToVariable) + if (joinToVariable != null && existingVariableUse.JoinedToVariable != joinToVariable) { existingVariableUse.JoinedToVariable = joinToVariable; - UpdateRolePlayerVariableUse(usedFor, existingVariableUse); + if (correlateWith == usedFor) + { + // Anything in the join should be in the head list as well + existingVariableUse.AddCorrelatedVariable(joinToVariable); + } + else if (correlateWith != null && correlationRootVariableUse.AddCorrelatedVariable(joinToVariable)) + { + if (correlationRootVariableUse.AddCorrelatedVariable(joinToVariable)) + { + useMap[correlateWith] = correlationRootVariableUse; + } + } + useMap[usedFor] = existingVariableUse; } } else @@ -7038,7 +7058,7 @@ if (addNewVariableToCorrelationRoot && correlationRootVariableUse.AddCorrelatedVariable(existingVariable)) { // An external variable was found that is not in the local correlation list - UpdateRolePlayerVariableUse(correlateWith, correlationRootVariableUse); + useMap[correlateWith] = correlationRootVariableUse; } } // Track use phase during registration to see if the root variable is @@ -7096,9 +7116,21 @@ { joinToVariable = null; } - if (existingVariableUse.JoinedToVariable != joinToVariable) + if (joinToVariable != null && existingVariableUse.JoinedToVariable != joinToVariable) { existingVariableUse.JoinedToVariable = joinToVariable; + if (correlateWith == usedFor) + { + // Anything in the join should be in the head list as well + existingVariableUse.AddCorrelatedVariable(joinToVariable); + } + else if (correlateWith != null && correlationRootVariableUse.AddCorrelatedVariable(joinToVariable)) + { + if (correlationRootVariableUse.AddCorrelatedVariable(joinToVariable)) + { + useMap[correlateWith] = correlationRootVariableUse; + } + } useMap[usedFor] = existingVariableUse; } } @@ -7138,7 +7170,7 @@ } if (addNewVariableToCorrelationRoot && existingVariable != null && correlationRootVariableUse.AddCorrelatedVariable(existingVariable)) { - UpdateRolePlayerVariableUse(correlateWith, correlationRootVariableUse); + useMap[correlateWith] = correlationRootVariableUse; } if (joinToVariable != null && joinedToExternalVariable && !existingVariable.IsExternalVariable) { @@ -7163,13 +7195,6 @@ return null; } /// <summary> - /// Update the <see cref="RolePlayerVariableUse"/> registered for a given key - /// </summary> - protected void UpdateRolePlayerVariableUse(object usedFor, RolePlayerVariableUse variableUse) - { - myUseToVariableMap[usedFor] = variableUse; - } - /// <summary> /// A chance for a subtype to add path projections using the /// <see cref="AddExternalVariable"/> method. /// </summary> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-03-24 06:25:48
|
Revision: 1436 http://orm.svn.sourceforge.net/orm/?rev=1436&view=rev Author: mcurland Date: 2010-03-24 06:25:42 +0000 (Wed, 24 Mar 2010) Log Message: ----------- Updated style information in report verbalization snippets to correspond to various changes in the primary snippets. Corresponds to verbalization changes [1014] [1175] [1369] [1435] refs #315 Modified Paths: -------------- trunk/ORMModel/ObjectModel/VerbalizationReportGenerator.cs trunk/ORMModel/ObjectModel/VerbalizationReportSnippets/VerbalizationReportSnippets.xml Modified: trunk/ORMModel/ObjectModel/VerbalizationReportGenerator.cs =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationReportGenerator.cs 2010-03-24 04:09:20 UTC (rev 1435) +++ trunk/ORMModel/ObjectModel/VerbalizationReportGenerator.cs 2010-03-24 06:25:42 UTC (rev 1436) @@ -394,10 +394,15 @@ .smallIndent { left: 8px; position: relative;} .listSeparator { color: windowtext; font-weight: 200;} .logicalOperator { color: MediumBlue; font-weight: bold;} - .note { color: DarkGray; font-style: italic; font-weight: normal; } + .note { color: Black; font-style: italic; font-weight: normal; } + .definition { color: Black; font-style: italic; font-weight: normal; } .notAvailable { font-style: italic; } .instance { color: Brown; font-weight: normal; } - + + table.hidden, tr.hidden, td.hidden {{ margin: 0em; padding: 0em; border-collapse: collapse;}} + td.hidden {{ vertical-align: top; }} + table.hidden {{ display:inline; }} + div.disclaimer { font-weight:bold; Modified: trunk/ORMModel/ObjectModel/VerbalizationReportSnippets/VerbalizationReportSnippets.xml =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationReportSnippets/VerbalizationReportSnippets.xml 2010-03-24 04:09:20 UTC (rev 1435) +++ trunk/ORMModel/ObjectModel/VerbalizationReportSnippets/VerbalizationReportSnippets.xml 2010-03-24 06:25:42 UTC (rev 1436) @@ -247,10 +247,15 @@ .smallIndent { left: 8px; position: relative;} .listSeparator { color: windowtext; font-weight: 200;} .logicalOperator { color: MediumBlue; font-weight: bold;} - .note { color: DarkGray; font-style: italic; font-weight: normal; } + .note { color: Black; font-style: italic; font-weight: normal; } + .definition { color: Black; font-style: italic; font-weight: normal; } .notAvailable { font-style: italic; } .instance { color: Brown; font-weight: normal; } - + + table.hidden, tr.hidden, td.hidden {{ margin: 0em; padding: 0em; border-collapse: collapse;}} + td.hidden {{ vertical-align: top; }} + table.hidden {{ display:inline; }} + div.disclaimer { font-weight:bold; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-03-11 22:26:09
|
Revision: 1432 http://orm.svn.sourceforge.net/orm/?rev=1432&view=rev Author: mcurland Date: 2010-03-11 22:26:03 +0000 (Thu, 11 Mar 2010) Log Message: ----------- Fix a bad issue with the new internationalization support for value constraints. Unfortunately this requires a repost of the February 2010 release after a minimal number of downloads. * Fix for serialization issue in [1431] (a range upper bound needs to be set for the culture-invariant form of the lower bound to serialize). refs #402 * Role path verbalization negation lost if forward reading from the negated role is not available. refs #395 Modified Paths: -------------- trunk/ORMModel/ObjectModel/DataType.cs trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.cs trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.xml trunk/ORMModel/ObjectModel/Verbalization.cs trunk/Setup/Readme.htm Modified: trunk/ORMModel/ObjectModel/DataType.cs =================================================================== --- trunk/ORMModel/ObjectModel/DataType.cs 2010-03-09 08:33:53 UTC (rev 1431) +++ trunk/ORMModel/ObjectModel/DataType.cs 2010-03-11 22:26:03 UTC (rev 1432) @@ -3,6 +3,7 @@ * Natural Object-Role Modeling Architect for Visual Studio * * * * Copyright © Neumont University. All rights reserved. * +* Copyright © ORM Solutions, LLD. All rights reserved. * * * * The use and distribution terms for this software are covered by the * * Common Public License 1.0 (http://opensource.org/licenses/cpl) which * Modified: trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.cs =================================================================== --- trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.cs 2010-03-09 08:33:53 UTC (rev 1431) +++ trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.cs 2010-03-11 22:26:03 UTC (rev 1432) @@ -3304,7 +3304,7 @@ } if (domainPropertyInfo.Id == ValueRange.InvariantMinValueDomainPropertyId) { - if (string.IsNullOrEmpty(this.InvariantMaxValue)) + if (string.IsNullOrEmpty(this.InvariantMinValue)) { return new CustomSerializedPropertyInfo(null, null, null, false, CustomSerializedAttributeWriteStyle.NotWritten, null); } Modified: trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.xml =================================================================== --- trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.xml 2010-03-09 08:33:53 UTC (rev 1431) +++ trunk/ORMModel/ObjectModel/ORMCore.SerializationExtensions.xml 2010-03-11 22:26:03 UTC (rev 1432) @@ -517,7 +517,7 @@ <se:Condition WriteStyle="NotWritten"> <plx:callStatic name="IsNullOrEmpty" dataTypeName=".string"> <plx:passParam> - <plx:callThis name="InvariantMaxValue" type="property"/> + <plx:callThis name="InvariantMinValue" type="property"/> </plx:passParam> </plx:callStatic> </se:Condition> Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2010-03-09 08:33:53 UTC (rev 1431) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2010-03-11 22:26:03 UTC (rev 1432) @@ -6064,6 +6064,7 @@ VerbalizationPlanNode parentNode; bool checkOppositeNegation = roleCount == 2 && + roles[0] == factTypeEntry.Role && verbalizationNodeLink != null && verbalizationNodeLink.Previous == null && null != (parentNode = verbalizationNode.ParentNode) && @@ -7518,7 +7519,9 @@ { // The dynamic flag if there is a trailing pathed role in the same role path ReadOnlyCollection<PathedRole> childPathedRoles = myRolePathCache.PathedRoleCollection(entryPathedRole.RolePath); - if (GetRolePlayerVariableUse(childPathedRoles[childPathedRoles.IndexOf(entryPathedRole) + 1]).Value.PrimaryRolePlayerVariable.HasBeenUsed(CurrentQuantificationUsePhase, true)) + int testChildIndex = childPathedRoles.IndexOf(entryPathedRole) + 1; + if (testChildIndex < childPathedRoles.Count && + GetRolePlayerVariableUse(childPathedRoles[testChildIndex]).Value.PrimaryRolePlayerVariable.HasBeenUsed(CurrentQuantificationUsePhase, true)) { readingOptions |= VerbalizationPlanReadingOptions.NegatedExitRole; childNode.ReadingOptions = readingOptions; Modified: trunk/Setup/Readme.htm =================================================================== --- trunk/Setup/Readme.htm 2010-03-09 08:33:53 UTC (rev 1431) +++ trunk/Setup/Readme.htm 2010-03-11 22:26:03 UTC (rev 1432) @@ -42,7 +42,7 @@ <hr/> <h2>February 2010 CTP Changes</h2> -<div>The February 2010 CTP release includes all modifications through changeset 1431. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> +<div>The February 2010 CTP release includes all modifications through changeset 1432. Full changeset descriptions can be found at the <a href="http://orm.svn.sourceforge.net/viewvc/orm/trunk/?view=log">sourceforge code repository</a> (be patient with this link, the page contains a full changeset history).</div> <ul> <li><a href="#Localized Value Constraints 2010-02">Localized value constraints</a> </li> <li><a href="#Value Constraint Special String Characters 2010-02">Value constraint special string characters</a> </li> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-02-26 01:12:44
|
Revision: 1430 http://orm.svn.sourceforge.net/orm/?rev=1430&view=rev Author: mcurland Date: 2010-02-26 01:12:38 +0000 (Fri, 26 Feb 2010) Log Message: ----------- Stop blocking join paths for ring constraints. Join paths on rings are conceptually valid. refs #395 Modified Paths: -------------- trunk/ORMModel/ObjectModel/Constraint.cs trunk/ORMModel/ObjectModel/ORM2Core.xsd Modified: trunk/ORMModel/ObjectModel/Constraint.cs =================================================================== --- trunk/ORMModel/ObjectModel/Constraint.cs 2010-02-25 19:26:10 UTC (rev 1429) +++ trunk/ORMModel/ObjectModel/Constraint.cs 2010-02-26 01:12:38 UTC (rev 1430) @@ -4416,7 +4416,6 @@ // case ConstraintType.SimpleMandatory: // case ConstraintType.ImpliedMandatory: case ConstraintType.DisjunctiveMandatory: - case ConstraintType.Ring: return false; } } @@ -4519,7 +4518,6 @@ case ConstraintType.ImpliedMandatory: case ConstraintType.SimpleMandatory: case ConstraintType.DisjunctiveMandatory: - case ConstraintType.Ring: // These never have join paths, do not bother tracking them return; } @@ -4550,7 +4548,6 @@ case ConstraintType.ImpliedMandatory: case ConstraintType.SimpleMandatory: case ConstraintType.DisjunctiveMandatory: - case ConstraintType.Ring: // These types never have a join path, and this is enforced // by the XML schema so they cannot be present on load. return; Modified: trunk/ORMModel/ObjectModel/ORM2Core.xsd =================================================================== --- trunk/ORMModel/ObjectModel/ORM2Core.xsd 2010-02-25 19:26:10 UTC (rev 1429) +++ trunk/ORMModel/ObjectModel/ORM2Core.xsd 2010-02-26 01:12:38 UTC (rev 1430) @@ -2072,7 +2072,7 @@ <xs:documentation>A constraint specifying relationships between elements of the same type in a set population.</xs:documentation> </xs:annotation> <xs:complexContent> - <xs:extension base="SetConstraintType"> + <xs:extension base="SetConstraintWithJoinType"> <xs:sequence> <xs:element name="Extensions" type="ExtensionsType" minOccurs="0"/> </xs:sequence> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-02-25 19:26:17
|
Revision: 1429 http://orm.svn.sourceforge.net/orm/?rev=1429&view=rev Author: mcurland Date: 2010-02-25 19:26:10 +0000 (Thu, 25 Feb 2010) Log Message: ----------- Fix absorption issue with 1-1 (both roles non-mandatory) binary fact types always absorbing towards the second role. Fixes bug introduced in [1361] refs #386 Modified Paths: -------------- trunk/Oial/ORMOialBridge/OialModelIsForORMModel.cs trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test1.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.WithIndependent.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.AfterReorder.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.OriginalOrder.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test4.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.FullyAbsorbed.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateObjectification.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateRemoteSupertype.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test6.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test7.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test8.Compare.orm trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test9.Compare.orm Modified: trunk/Oial/ORMOialBridge/OialModelIsForORMModel.cs =================================================================== --- trunk/Oial/ORMOialBridge/OialModelIsForORMModel.cs 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/Oial/ORMOialBridge/OialModelIsForORMModel.cs 2010-02-25 19:26:10 UTC (rev 1429) @@ -35,7 +35,7 @@ /// <summary> /// The algorithm version written to the file /// </summary> - public const string CurrentAlgorithmVersion = "1.005"; + public const string CurrentAlgorithmVersion = "1.006"; #endregion // CurrentAlgorithmVersion constant #region ValidationPriority enum /// <summary> @@ -408,7 +408,7 @@ if (!secondRoleIsUniqueAndPreferred) { // Shallow map toward secondRolePlayer. - possibilityBits = FIRST_SECOND_SHALLOW; + possibilityBits |= FIRST_SECOND_SHALLOW; } } else if (firstRoleIsMandatory && !secondRoleIsMandatory) // ...only firstRole is mandatory... Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test1.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test1.Compare.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test1.Compare.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -11263,7 +11263,7 @@ </orm:NameGenerator> <orm:GenerationState id="_8E0783DA-E25D-4F51-BB04-6E2AC65759C4"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_52A37F5B-1E80-4FCB-802E-AA9FA4315D0D" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_52A37F5B-1E80-4FCB-802E-AA9FA4315D0D" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_AFA60651-CCAD-47F2-B397-70E5855BF20B" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_CD0EC594-EDEA-44FC-9593-1DE35929D199" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.WithIndependent.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.WithIndependent.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.WithIndependent.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -282,7 +282,7 @@ </orm:NameGenerator> <orm:GenerationState id="_54101972-8FEE-4228-AD12-FC8C396A2A2C"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_216FCBEF-24A6-4138-9F8D-255066420DD2" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_216FCBEF-24A6-4138-9F8D-255066420DD2" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_FE3D35D4-8BFA-4604-B769-6F8224F4CC89" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_AB43283A-160B-4A51-9E75-F464582D1F72" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test2.Compare.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -288,7 +288,7 @@ </orm:NameGenerator> <orm:GenerationState id="_CE6A5C67-194C-4538-B61D-09DC277235CA"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_1ECF9C7E-EC03-4118-9BF0-78AC98140751" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_1ECF9C7E-EC03-4118-9BF0-78AC98140751" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_4EE0E222-C3E6-4E2F-93BD-2832FD0CA530" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_B469B281-6731-4214-9C2C-6CFDAC31C903" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.AfterReorder.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.AfterReorder.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.AfterReorder.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -745,7 +745,7 @@ </orm:NameGenerator> <orm:GenerationState id="_3A3C7338-9795-4DF8-85A8-D7F91EBD4E8B"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_93A125B5-363A-454B-A6FC-473B4987BBF7" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_93A125B5-363A-454B-A6FC-473B4987BBF7" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_B227B9F1-E66D-4885-9EBB-FA6C30E3AC66" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_75FDA8E6-2EB8-493D-A6BF-CB382F439713" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.OriginalOrder.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.OriginalOrder.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.OriginalOrder.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -745,7 +745,7 @@ </orm:NameGenerator> <orm:GenerationState id="_FF27DDAF-62F8-41E6-AB38-0D295BDBB29E"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_4CA750F7-00B1-492A-9BC2-CF24B78D16D1" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_4CA750F7-00B1-492A-9BC2-CF24B78D16D1" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_B227B9F1-E66D-4885-9EBB-FA6C30E3AC66" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_2FD2BA8B-8F38-413C-A5ED-5C43A9F3ED0C" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test3.Compare.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -745,7 +745,7 @@ </orm:NameGenerator> <orm:GenerationState id="_B5DD8E65-E6E9-4E8C-8B4D-FF5958987841"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_4F4B5F39-12A2-4488-9BA9-EEF2F2BB5E6D" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_4F4B5F39-12A2-4488-9BA9-EEF2F2BB5E6D" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_21511FEB-5B88-4FBD-A74C-06B4A3C70480" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_6E61D4EE-E269-4EB5-8CD2-5D643CA8F6AB" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test4.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test4.Compare.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test4.Compare.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -379,7 +379,7 @@ </orm:NameGenerator> <orm:GenerationState id="_867D2D7E-B67D-4BFD-8F04-F5FBEAA5D1B9"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_7C818355-A612-4252-B259-D23C1B8B80CB" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_7C818355-A612-4252-B259-D23C1B8B80CB" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_479BA1D0-80FB-48DE-894E-50E9E8FC0F0B" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_035C2A13-BCD7-4021-B939-C7B0714C8324" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.FullyAbsorbed.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.FullyAbsorbed.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.FullyAbsorbed.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -883,7 +883,7 @@ </orm:NameGenerator> <orm:GenerationState id="_3013089A-3E52-4FFC-B4C9-C0D50877459E"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_953B9230-0B01-406E-B73F-E99E73B31F8D" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_953B9230-0B01-406E-B73F-E99E73B31F8D" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_B6DA4F58-8BCF-478E-82AE-C04CD0DD68C9" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_0C331C48-4E21-4197-8186-4A3769048023" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateObjectification.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateObjectification.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateObjectification.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -883,7 +883,7 @@ </orm:NameGenerator> <orm:GenerationState id="_131855A5-E2F4-4B93-859A-3BF1DCE156A4"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_077B1376-3174-4CAC-9C4A-B8245485F67E" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_077B1376-3174-4CAC-9C4A-B8245485F67E" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_C50661E8-E857-43F3-A1D2-9EF787A84EFE" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_CC0244D5-F67A-4DE3-8E18-4B16640FB1F1" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateRemoteSupertype.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateRemoteSupertype.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.SeparateRemoteSupertype.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -919,7 +919,7 @@ </orm:NameGenerator> <orm:GenerationState id="_A9552E0E-47F2-4584-A070-747217388A07"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_F689860F-F598-413B-B7D2-0DD7D4CACE41" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_F689860F-F598-413B-B7D2-0DD7D4CACE41" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_B774300C-8F49-43EB-AB62-17534D8DBB42" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_0F8EAA5B-2586-41D4-9523-EDE35695503A" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test5.Compare.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -919,7 +919,7 @@ </orm:NameGenerator> <orm:GenerationState id="_A9552E0E-47F2-4584-A070-747217388A07"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_F689860F-F598-413B-B7D2-0DD7D4CACE41" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_F689860F-F598-413B-B7D2-0DD7D4CACE41" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_B774300C-8F49-43EB-AB62-17534D8DBB42" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_0F8EAA5B-2586-41D4-9523-EDE35695503A" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test6.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test6.Compare.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test6.Compare.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -325,7 +325,7 @@ </orm:NameGenerator> <orm:GenerationState id="_942823FC-FB64-4C91-8D0E-805B5D2DFE0A"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_D7A0794A-6A4E-4F57-AABD-1EAA875ADCEC" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_D7A0794A-6A4E-4F57-AABD-1EAA875ADCEC" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_82B2C906-24E6-4CF4-ADE5-30AEAE09EC10" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_92EDE6BB-60EE-45AE-8D58-B58A04114F45" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test7.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test7.Compare.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test7.Compare.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -697,7 +697,7 @@ </orm:NameGenerator> <orm:GenerationState id="_80CC0747-9D3C-4ED5-8A82-11720C90EBAD"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_65638CB4-2653-4514-A38D-9380F676A78C" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_65638CB4-2653-4514-A38D-9380F676A78C" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_AB78A179-3D57-4D6D-A2C8-A7FD52DCC729" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting CoreAlgorithmVersion="1.004" id="_E6A31A5A-A145-4F45-A0E9-47F04AA49D97" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test8.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test8.Compare.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test8.Compare.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -202,7 +202,7 @@ </orm:NameGenerator> <orm:GenerationState id="_3FB952A5-A1B8-4A7B-9C17-10B2D5D9B95D"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_CA317692-2D5E-4094-9CC9-F7B049F0A505" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_CA317692-2D5E-4094-9CC9-F7B049F0A505" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_9C9BECFF-37EA-4156-B4BF-55AD6ED21CD2" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_7A16F888-F499-4270-94C6-894CF461C356" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> Modified: trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test9.Compare.orm =================================================================== --- trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test9.Compare.orm 2010-02-25 06:07:12 UTC (rev 1428) +++ trunk/TestSuites/RelationalTests/FullRegeneration/Tests.Test9.Compare.orm 2010-02-25 19:26:10 UTC (rev 1429) @@ -361,7 +361,7 @@ </orm:NameGenerator> <orm:GenerationState id="_60A97CA1-7A34-40BD-A48A-DE043570D047"> <orm:GenerationSettings> - <ormtooial:AbstractionModelGenerationSetting id="_FA93223F-D82D-479F-A103-D8886756E8E2" AlgorithmVersion="1.005"> + <ormtooial:AbstractionModelGenerationSetting id="_FA93223F-D82D-479F-A103-D8886756E8E2" AlgorithmVersion="1.006"> <ormtooial:AbstractionModel ref="_2F7377B5-BC91-4951-B9DC-8D6389C48738" /> </ormtooial:AbstractionModelGenerationSetting> <oialtocdb:SchemaGenerationSetting id="_833EE616-E4B4-4F9E-9DBC-522A018D54FC" CoreAlgorithmVersion="1.004" NameAlgorithmVersion="1.011"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2010-02-08 21:40:38
|
Revision: 1427 http://orm.svn.sourceforge.net/orm/?rev=1427&view=rev Author: mcurland Date: 2010-02-08 21:40:32 +0000 (Mon, 08 Feb 2010) Log Message: ----------- * Fix a couple of crashes in role path verbalization introduced in [1426] refs #395 * Display role numbers with duplicate replacement fields in reading shapes. * Fixed issue with disabled context menu items for diagram tabs on secondary monitors to the left of or above the primary monitor. Modified Paths: -------------- trunk/ORMModel/Framework/Shell/MultiDiagramDocViewControl.cs trunk/ORMModel/ObjectModel/Verbalization.cs trunk/ORMModel/Resources/ResourceStringsGenerator.cs trunk/ORMModel/Resources/ResourceStringsGenerator.xml trunk/ORMModel/ShapeModel/ORMDiagram.resx trunk/ORMModel/ShapeModel/ReadingShape.cs trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test1a.Compare.orm trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test1b.Compare.orm trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test1c.Compare.orm trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test2a.Compare.orm trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test2b.Compare.orm Modified: trunk/ORMModel/Framework/Shell/MultiDiagramDocViewControl.cs =================================================================== --- trunk/ORMModel/Framework/Shell/MultiDiagramDocViewControl.cs 2010-02-06 10:22:08 UTC (rev 1426) +++ trunk/ORMModel/Framework/Shell/MultiDiagramDocViewControl.cs 2010-02-08 21:40:32 UTC (rev 1427) @@ -333,8 +333,10 @@ if (contextMenuMessage = (m.Msg == WM_CONTEXTMENU)) { uint lParam = (uint)m.LParam; - int x = (int)(lParam & 0xFFFF); - int y = (int)((lParam >> 16) & 0xFFFF); + // Convert to short instead of int to get the sign correct + // for multi-monitor systems with negative mouse positions. + int x = (short)(lParam & 0xFFFF); + int y = (short)((lParam >> 16) & 0xFFFF); DiagramTabPage diagramTabPage = (x == -1 && y == -1) ? SelectedDiagramTab : GetTabAtPoint(base.PointToClient(new Point(x, y))); myTrustDesignerForContextMenu = true; myDesignerForContextMenu = (diagramTabPage != null) ? diagramTabPage.Designer : null; Modified: trunk/ORMModel/ObjectModel/Verbalization.cs =================================================================== --- trunk/ORMModel/ObjectModel/Verbalization.cs 2010-02-06 10:22:08 UTC (rev 1426) +++ trunk/ORMModel/ObjectModel/Verbalization.cs 2010-02-08 21:40:32 UTC (rev 1427) @@ -1597,15 +1597,20 @@ formatText, formatProvider, predicatePartDecorator, - delegate(int fieldIndex) - { - // The default order passed in here is assumed to be the same one - // passed to the constructor. If the format is modified, then the - // replacement fields have been reordered in the format string to - // correspond to this order, so there is no translation needed here. - string useFormat = formatFields[fieldIndex]; - return (useFormat == null) ? replacementProvider(defaultOrder[fieldIndex]) : string.Format(formatProvider, useFormat, replacementProvider(defaultOrder[fieldIndex])); - }); + (formatFields == null) ? + (ReadingTextFieldReplace)delegate(int fieldIndex) + { + return replacementProvider(defaultOrder[fieldIndex]); + } : + delegate(int fieldIndex) + { + // The default order passed in here is assumed to be the same one + // passed to the constructor. If the format is modified, then the + // replacement fields have been reordered in the format string to + // correspond to this order, so there is no translation needed here. + string useFormat = formatFields[fieldIndex]; + return (useFormat == null) ? replacementProvider(defaultOrder[fieldIndex]) : string.Format(formatProvider, useFormat, replacementProvider(defaultOrder[fieldIndex])); + }); } } #endregion // Member Functions @@ -3705,7 +3710,7 @@ public RelatedRolePlayerVariables(RolePlayerVariable rolePlayerVariable, bool usedFullyExistentially) { myHeadNode = rolePlayerVariable != null ? new LinkedNode<RolePlayerVariable>(rolePlayerVariable) : null; - myUsedFullyExistentially = false; + myUsedFullyExistentially = usedFullyExistentially; } /// <summary> /// The head <see cref="ObjectType"/> node. This @@ -5044,12 +5049,13 @@ // UNDONE: RolePathCombination verbalization } } - RolePlayerVariable contextLeadVariable = null; - RolePlayerVariable contextTrailingVariable = null; - ResolveReadings(myRootPlanNode, null, false, ref contextLeadVariable, ref contextTrailingVariable); VerbalizationPlanNode newRootNode = myRootPlanNode; if (newRootNode != null) { + RolePlayerVariable contextLeadVariable = null; + RolePlayerVariable contextTrailingVariable = null; + ResolveReadings(newRootNode, null, false, ref contextLeadVariable, ref contextTrailingVariable); + Dictionary<RolePathOwner, VerbalizationPlanNode> planMap = myPathOwnerToVerbalizationPlanMap; if (planMap != null) { Modified: trunk/ORMModel/Resources/ResourceStringsGenerator.cs =================================================================== --- trunk/ORMModel/Resources/ResourceStringsGenerator.cs 2010-02-06 10:22:08 UTC (rev 1426) +++ trunk/ORMModel/Resources/ResourceStringsGenerator.cs 2010-02-08 21:40:32 UTC (rev 1427) @@ -2580,6 +2580,14 @@ return ResourceStrings.GetString(ResourceManagers.Diagram, "ReadingShape.AttachedRoleDisplay"); } } + /// <summary>The string used to display a reading with a non-primary order when the role is attached and the role player is duplicated in the reading. Replacement fields: {0}=role player name, {1}=displayed role index.</summary> + public static string ReadingShapeAttachedDuplicateRoleDisplay + { + get + { + return ResourceStrings.GetString(ResourceManagers.Diagram, "ReadingShape.AttachedDuplicateRoleDisplay"); + } + } /// <summary>The string used to display a reading with a non-primary order when the role is not attached.</summary> public static string ReadingShapeUnattachedRoleDisplay { Modified: trunk/ORMModel/Resources/ResourceStringsGenerator.xml =================================================================== --- trunk/ORMModel/Resources/ResourceStringsGenerator.xml 2010-02-06 10:22:08 UTC (rev 1426) +++ trunk/ORMModel/Resources/ResourceStringsGenerator.xml 2010-02-08 21:40:32 UTC (rev 1427) @@ -372,6 +372,7 @@ <ResourceString name="ReadingShapeReadingSeparator" model="Diagram" resourceName="ReadingShape.ReadingSeparator"/> <ResourceString name="ReadingShapeEllipsis" model="Diagram" resourceName="ReadingShape.Ellipsis"/> <ResourceString name="ReadingShapeAttachedRoleDisplay" model="Diagram" resourceName="ReadingShape.AttachedRoleDisplay"/> + <ResourceString name="ReadingShapeAttachedDuplicateRoleDisplay" model="Diagram" resourceName="ReadingShape.AttachedDuplicateRoleDisplay"/> <ResourceString name="ReadingShapeUnattachedRoleDisplay" model="Diagram" resourceName="ReadingShape.UnattachedRoleDisplay"/> <ResourceString name="NMinusOneRuleInternalSpan" model="Model" resourceName="ModelError.FactType.NMinusOneRule.Text"/> <ResourceString name="ModelErrorConstraintRoleSequenceJoinPathRequiredError" model="Model" resourceName="ModelError.ConstraintRoleSequence.JoinPathRequiredError.Text"/> Modified: trunk/ORMModel/ShapeModel/ORMDiagram.resx =================================================================== --- trunk/ORMModel/ShapeModel/ORMDiagram.resx 2010-02-06 10:22:08 UTC (rev 1426) +++ trunk/ORMModel/ShapeModel/ORMDiagram.resx 2010-02-08 21:40:32 UTC (rev 1427) @@ -867,7 +867,11 @@ <value xml:space="preserve">[{0}]</value> <comment xml:space="preserve">The string used to display a reading with a non-primary order when the role is attached.</comment> </data> - <data name="ReadingShape.Ellipsis"> + <data name="ReadingShape.AttachedDuplicateRoleDisplay"> + <value xml:space="preserve">[{0}{1:d}]</value> + <comment xml:space="preserve">The string used to display a reading with a non-primary order when the role is attached and the role player is duplicated in the reading. Replacement fields: {0}=role player name, {1}=displayed role index.</comment> + </data> + <data name="ReadingShape.Ellipsis"> <value xml:space="preserve">…</value> <comment xml:space="preserve">The character to use as the object placeholder in a ReadingShape.</comment> </data> @@ -876,8 +880,8 @@ <comment xml:space="preserve">The string used to divide multiple readings shown in a ReadingShape.</comment> </data> <data name="ReadingShape.UnattachedRoleDisplay"> - <value xml:space="preserve">[Missing{0}]</value> - <comment xml:space="preserve">The string used to display a reading with a non-primary order when the role is not attached.</comment> + <value xml:space="preserve">[Missing{0:d}]</value> + <comment xml:space="preserve">The string used to display a reading with a non-primary order when the role is not attached. Replement fields: {0}=displayed role index</comment> </data> <data name="RelatedTypesDisplay.AttachAllTypes"> <value xml:space="preserve">Subtypes and Supertypes</value> Modified: trunk/ORMModel/ShapeModel/ReadingShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/ReadingShape.cs 2010-02-06 10:22:08 UTC (rev 1426) +++ trunk/ORMModel/ShapeModel/ReadingShape.cs 2010-02-08 21:40:32 UTC (rev 1427) @@ -3,6 +3,7 @@ * Natural Object-Role Modeling Architect for Visual Studio * * * * Copyright © Neumont University. All rights reserved. * +* Copyright © ORM Solutions, LLC. All rights reserved. * * * * The use and distribution terms for this software are covered by the * * Common Public License 1.0 (http://opensource.org/licenses/cpl) which * @@ -595,7 +596,6 @@ } else { - // UNDONE: Unary binarization is likely to hit this assert Debug.Assert(roleCount == 2, "A unary fact should not have more than one reading order."); ReadingOrder firstOrder; ReadingOrder secondOrder; @@ -620,24 +620,55 @@ { LinkedElementCollection<RoleBase> factRoles = factShape.DisplayedRoleOrder; string[] roleTranslator = new string[roleCount]; - for (int readRoleNum = 0; readRoleNum < roleCount; ++readRoleNum) + bool reverseNumbering = factShape.DisplayOrientation == DisplayOrientation.VerticalRotatedLeft; // Number top down, not bottom up + BitTracker fullyProcessed = new BitTracker(roleCount); + for (int readingRoleIndex = 0; readingRoleIndex < roleCount; ++readingRoleIndex) { - RoleBase currentRole = orderedRoles[readRoleNum]; + RoleBase currentRole = orderedRoles[readingRoleIndex]; ObjectType rolePlayer = currentRole.Role.RolePlayer; - string formatString; - string replacementField; if (rolePlayer == null) { - replacementField = (factRoles.IndexOf(currentRole) + 1).ToString(CultureInfo.InvariantCulture); - formatString = ResourceStrings.ReadingShapeUnattachedRoleDisplay; + roleTranslator[readingRoleIndex] = string.Format(CultureInfo.InvariantCulture, ResourceStrings.ReadingShapeUnattachedRoleDisplay, reverseNumbering ? roleCount - factRoles.IndexOf(currentRole) : factRoles.IndexOf(currentRole) + 1); + fullyProcessed[readingRoleIndex] = true; } else { - replacementField = rolePlayer.Name; - formatString = ResourceStrings.ReadingShapeAttachedRoleDisplay; + roleTranslator[readingRoleIndex] = rolePlayer.Name; + // Decorate later when we can look for duplicated names and + // add additional diplayed role index information. } - roleTranslator[readRoleNum] = string.Format(CultureInfo.InvariantCulture, formatString, replacementField); } + + // Second pass, look for duplicates + for (int readingRoleIndex = 0; readingRoleIndex < roleCount; ++readingRoleIndex) + { + if (!fullyProcessed[readingRoleIndex]) + { + string rolePlayerName = roleTranslator[readingRoleIndex]; + bool haveDuplicate = false; + for (int duplicateIndex = readingRoleIndex + 1; duplicateIndex < roleCount; ++duplicateIndex) + { + if (!fullyProcessed[duplicateIndex]) + { + if (roleTranslator[duplicateIndex] == rolePlayerName) + { + roleTranslator[duplicateIndex] = string.Format(CultureInfo.InvariantCulture, ResourceStrings.ReadingShapeAttachedDuplicateRoleDisplay, rolePlayerName, reverseNumbering ? roleCount - factRoles.IndexOf(orderedRoles[duplicateIndex]) : factRoles.IndexOf(orderedRoles[duplicateIndex]) + 1); + fullyProcessed[duplicateIndex] = true; + haveDuplicate = true; + } + } + } + if (haveDuplicate) + { + roleTranslator[readingRoleIndex] = string.Format(CultureInfo.InvariantCulture, ResourceStrings.ReadingShapeAttachedDuplicateRoleDisplay, rolePlayerName, reverseNumbering ? roleCount - factRoles.IndexOf(orderedRoles[readingRoleIndex]) : factRoles.IndexOf(orderedRoles[readingRoleIndex]) + 1); + } + else + { + roleTranslator[readingRoleIndex] = string.Format(CultureInfo.InvariantCulture, ResourceStrings.ReadingShapeAttachedRoleDisplay, rolePlayerName); + } + fullyProcessed[readingRoleIndex] = true; + } + } retVal = string.Format(CultureInfo.InvariantCulture, (readingFormatString == null) ? defaultOrder.ReadingText : readingFormatString, roleTranslator); } if (derivationDecorator != null) @@ -1328,19 +1359,24 @@ { } /// <summary> - /// Update the shape size if the derivation status is set. Fixes an earlier - /// problem where the shape was not correctly sized, and accounts for decorator - /// markings being modified over time and/or localized. + /// Update the shape size to correspond to current drawing standards and + /// to account for modified and/or localized derivation decorator display. /// </summary> protected sealed override void ProcessElement(ReadingShape element, Store store, INotifyElementAdded notifyAdded) { ReadingOrder order; FactType factType; - FactTypeDerivationExpression derivationExpression; if (!element.IsDeleted && null != (order = (ReadingOrder)element.ModelElement) && null != (factType = order.FactType) && - null != (derivationExpression = factType.DerivationExpression)) + (null != factType.DerivationRule || + null != factType.DerivationExpression || + // We did not used to index duplicate role player names, + // now we do, making the shape require more space. It isn't + // worth the search for duplicates here, but the role count + // should narrow this down quite a bit as most models use + // predominantly binary fact types. + 2 < factType.RoleCollection.Count)) { element.AutoResize(); } Modified: trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test1a.Compare.orm =================================================================== --- trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test1a.Compare.orm 2010-02-06 10:22:08 UTC (rev 1426) +++ trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test1a.Compare.orm 2010-02-08 21:40:32 UTC (rev 1427) @@ -467,7 +467,7 @@ </ormDiagram:ObjectTypeShape> <ormDiagram:FactTypeShape id="_CE23A438-DDA2-4D12-9523-06C5060C599E" IsExpanded="true" AbsoluteBounds="2.1875, 1.7875, 0.5438888889923692, 0.24388888899236916"> <ormDiagram:RelativeShapes> - <ormDiagram:ReadingShape id="_D7FE3C29-C834-4E34-9AFD-9D0DA9070D99" IsExpanded="true" AbsoluteBounds="2.1875, 2.0500000000000003, 0.8125, 0.125"> + <ormDiagram:ReadingShape id="_D7FE3C29-C834-4E34-9AFD-9D0DA9070D99" IsExpanded="true" AbsoluteBounds="2.1875, 2.0500000000000003, 0.81412529945373535, 0.12950302660465241"> <ormDiagram:Subject ref="_F950097E-AE89-41FB-A35F-290CA84963B8" /> </ormDiagram:ReadingShape> </ormDiagram:RelativeShapes> Modified: trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test1b.Compare.orm =================================================================== --- trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test1b.Compare.orm 2010-02-06 10:22:08 UTC (rev 1426) +++ trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test1b.Compare.orm 2010-02-08 21:40:32 UTC (rev 1427) @@ -467,7 +467,7 @@ </ormDiagram:ObjectTypeShape> <ormDiagram:FactTypeShape id="_CE23A438-DDA2-4D12-9523-06C5060C599E" IsExpanded="true" AbsoluteBounds="2.1875, 1.7875, 0.5438888889923692, 0.24388888899236916"> <ormDiagram:RelativeShapes> - <ormDiagram:ReadingShape id="_D7FE3C29-C834-4E34-9AFD-9D0DA9070D99" IsExpanded="true" AbsoluteBounds="2.1875, 2.0500000000000003, 0.8125, 0.125"> + <ormDiagram:ReadingShape id="_D7FE3C29-C834-4E34-9AFD-9D0DA9070D99" IsExpanded="true" AbsoluteBounds="2.1875, 2.0500000000000003, 0.81412529945373535, 0.12950302660465241"> <ormDiagram:Subject ref="_F950097E-AE89-41FB-A35F-290CA84963B8" /> </ormDiagram:ReadingShape> </ormDiagram:RelativeShapes> Modified: trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test1c.Compare.orm =================================================================== --- trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test1c.Compare.orm 2010-02-06 10:22:08 UTC (rev 1426) +++ trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test1c.Compare.orm 2010-02-08 21:40:32 UTC (rev 1427) @@ -464,7 +464,7 @@ </ormDiagram:ObjectTypeShape> <ormDiagram:FactTypeShape id="_CE23A438-DDA2-4D12-9523-06C5060C599E" IsExpanded="true" AbsoluteBounds="2.1875, 1.7875, 0.5438888889923692, 0.24388888899236916"> <ormDiagram:RelativeShapes> - <ormDiagram:ReadingShape id="_D7FE3C29-C834-4E34-9AFD-9D0DA9070D99" IsExpanded="true" AbsoluteBounds="2.1875, 2.0500000000000003, 0.8125, 0.125"> + <ormDiagram:ReadingShape id="_D7FE3C29-C834-4E34-9AFD-9D0DA9070D99" IsExpanded="true" AbsoluteBounds="2.1875, 2.0500000000000003, 0.81412529945373535, 0.12950302660465241"> <ormDiagram:Subject ref="_F950097E-AE89-41FB-A35F-290CA84963B8" /> </ormDiagram:ReadingShape> </ormDiagram:RelativeShapes> Modified: trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test2a.Compare.orm =================================================================== --- trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test2a.Compare.orm 2010-02-06 10:22:08 UTC (rev 1426) +++ trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test2a.Compare.orm 2010-02-08 21:40:32 UTC (rev 1427) @@ -467,7 +467,7 @@ </ormDiagram:ObjectTypeShape> <ormDiagram:FactTypeShape AbsoluteBounds="2.1875, 1.7875, 0.5438888889923692, 0.24388888899236916" IsExpanded="true" id="_CE23A438-DDA2-4D12-9523-06C5060C599E"> <ormDiagram:RelativeShapes> - <ormDiagram:ReadingShape IsExpanded="true" id="_D7FE3C29-C834-4E34-9AFD-9D0DA9070D99" AbsoluteBounds="2.1875, 2.0500000000000003, 0.8125, 0.125"> + <ormDiagram:ReadingShape IsExpanded="true" id="_D7FE3C29-C834-4E34-9AFD-9D0DA9070D99" AbsoluteBounds="2.1875, 2.0500000000000003, 0.81412529945373535, 0.12950302660465241"> <ormDiagram:Subject ref="_F950097E-AE89-41FB-A35F-290CA84963B8" /> </ormDiagram:ReadingShape> </ormDiagram:RelativeShapes> Modified: trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test2b.Compare.orm =================================================================== --- trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test2b.Compare.orm 2010-02-06 10:22:08 UTC (rev 1426) +++ trunk/TestSuites/TestSample/NMinus1Tests/NMinus1Tests.NMinus1Test2b.Compare.orm 2010-02-08 21:40:32 UTC (rev 1427) @@ -464,7 +464,7 @@ </ormDiagram:ObjectTypeShape> <ormDiagram:FactTypeShape id="_CE23A438-DDA2-4D12-9523-06C5060C599E" IsExpanded="true" AbsoluteBounds="2.1875, 1.7875, 0.5438888889923692, 0.24388888899236916"> <ormDiagram:RelativeShapes> - <ormDiagram:ReadingShape id="_D7FE3C29-C834-4E34-9AFD-9D0DA9070D99" IsExpanded="true" AbsoluteBounds="2.1875, 2.0500000000000003, 0.8125, 0.125"> + <ormDiagram:ReadingShape id="_D7FE3C29-C834-4E34-9AFD-9D0DA9070D99" IsExpanded="true" AbsoluteBounds="2.1875, 2.0500000000000003, 0.81412529945373535, 0.12950302660465241"> <ormDiagram:Subject ref="_F950097E-AE89-41FB-A35F-290CA84963B8" /> </ormDiagram:ReadingShape> </ormDiagram:RelativeShapes> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mcu...@us...> - 2009-12-31 07:19:43
|
Revision: 1424 http://orm.svn.sourceforge.net/orm/?rev=1424&view=rev Author: mcurland Date: 2009-12-31 07:19:36 +0000 (Thu, 31 Dec 2009) Log Message: ----------- Miscellaneous fixes: * Changes in [1392] resulted in no object type name for an objectified fact type off the toolbox. refs #321 * FactEditor commit with object type name of objectified fact type selected repositioned the object type name shape to the default location. * Verbalize list separator 'and' and 'or' instances uses the logicalOperator style (bold blue) instead of the listSeparator style (non-bold window text (generally black)) * Added model browser support for 'Select on Diagram' and 'Select on Diagram Spy' with link elements. * Added defensive code to fix occasional model browser exception due to event order when a referenced element is deleted * Deserialization of duplicate non-empty objectified link elements caused end element mismatch, eliminated remainder of file (can't duplicated with NORMA-saved files, occurred with some externally generated .orm files). * Remove dead ReadingEditor command set code. Reading editor commands are handled by the designer command set. Modified Paths: -------------- trunk/ORMModel/Framework/Shell/DynamicSurveyTreeGrid/MainList.cs trunk/ORMModel/Framework/Shell/SerializationEngine.cs trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs trunk/ORMModel/ShapeModel/FactTypeShape.cs trunk/ORMModel/Shell/ORMModelBrowser.cs trunk/ORMModel/Shell/ORMReadingEditor.cs Modified: trunk/ORMModel/Framework/Shell/DynamicSurveyTreeGrid/MainList.cs =================================================================== --- trunk/ORMModel/Framework/Shell/DynamicSurveyTreeGrid/MainList.cs 2009-12-22 08:38:42 UTC (rev 1423) +++ trunk/ORMModel/Framework/Shell/DynamicSurveyTreeGrid/MainList.cs 2009-12-31 07:19:36 UTC (rev 1424) @@ -395,9 +395,15 @@ if (reference != null && null != (referencedElement = reference.ReferencedElement)) { + NodeLocation targetLocation; + if (!surveyTree.myNodeDictionary.TryGetValue(referencedElement, out targetLocation)) + { + // Defensive code to handle callbacks on partially removed references + // resulting from event side effects. + return retVal; + } referenceOptions = reference.SurveyNodeReferenceOptions; filterTargetQuestions = 0 != (referenceOptions & SurveyNodeReferenceOptions.FilterReferencedAnswers); - NodeLocation targetLocation = surveyTree.myNodeDictionary[referencedElement = reference.ReferencedElement]; referenceNode = targetLocation.ElementNode; referenceSurvey = targetLocation.Survey; } Modified: trunk/ORMModel/Framework/Shell/SerializationEngine.cs =================================================================== --- trunk/ORMModel/Framework/Shell/SerializationEngine.cs 2009-12-22 08:38:42 UTC (rev 1423) +++ trunk/ORMModel/Framework/Shell/SerializationEngine.cs 2009-12-31 07:19:36 UTC (rev 1424) @@ -4318,6 +4318,7 @@ if (element == oppositeRolePlayers[i]) { createLink = false; + PassEndElement(reader); break; } } Modified: trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml 2009-12-22 08:38:42 UTC (rev 1423) +++ trunk/ORMModel/ObjectModel/VerbalizationCoreSnippets/VerbalizationCoreSnippets.xml 2009-12-31 07:19:36 UTC (rev 1424) @@ -111,9 +111,9 @@ <Snippet type="IndentedCompoundListFinalSeparator"><![CDATA[<span class="listSeparator">; </span>]]></Snippet> <Snippet type="IndentedCompoundListClose"><![CDATA[</span>]]></Snippet> <Snippet type="IndentedListOpen"><![CDATA[<br/><span class="smallIndent">]]></Snippet> - <Snippet type="IndentedListPairSeparator"><![CDATA[<span class="listSeparator"> and </span><br/>]]></Snippet> - <Snippet type="IndentedListSeparator"><![CDATA[<span class="listSeparator"> and </span><br/>]]></Snippet> - <Snippet type="IndentedListFinalSeparator"><![CDATA[<span class="listSeparator"> and </span><br/>]]></Snippet> + <Snippet type="IndentedListPairSeparator"><![CDATA[<span class="logicalOperator"> and </span><br/>]]></Snippet> + <Snippet type="IndentedListSeparator"><![CDATA[<span class="logicalOperator"> and </span><br/>]]></Snippet> + <Snippet type="IndentedListFinalSeparator"><![CDATA[<span class="logicalOperator"> and </span><br/>]]></Snippet> <Snippet type="IndentedListClose"><![CDATA[</span>]]></Snippet> <Snippet type="IndentedLogicalOrListOpen"><![CDATA[<br/><span class="smallIndent">]]></Snippet> <Snippet type="IndentedLogicalOrListPairSeparator"><![CDATA[<br/><span class="logicalOperator">or </span>]]></Snippet> @@ -155,9 +155,9 @@ <Snippet type="CompoundListClose"><![CDATA[]]></Snippet> <Snippet type="SimpleListOpen"><![CDATA[]]></Snippet> - <Snippet type="SimpleListPairSeparator"><![CDATA[<span class="listSeparator"> and </span>]]></Snippet> + <Snippet type="SimpleListPairSeparator"><![CDATA[<span class="logicalOperator"> and </span>]]></Snippet> <Snippet type="SimpleListSeparator"><![CDATA[<span class="listSeparator">, </span>]]></Snippet> - <Snippet type="SimpleListFinalSeparator"><![CDATA[<span class="listSeparator">, and </span>]]></Snippet> + <Snippet type="SimpleListFinalSeparator"><![CDATA[<span class="listSeparator">,</span><span class="logicalOperator"> and </span>]]></Snippet> <Snippet type="SimpleListClose"><![CDATA[]]></Snippet> <Snippet type="CompactSimpleListOpen"><![CDATA[]]></Snippet> <Snippet type="CompactSimpleListPairSeparator"><![CDATA[<span class="listSeparator">, </span>]]></Snippet> Modified: trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs =================================================================== --- trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2009-12-22 08:38:42 UTC (rev 1423) +++ trunk/ORMModel/ObjectModel/VerbalizationGenerator.cs 2009-12-31 07:19:36 UTC (rev 1424) @@ -458,10 +458,10 @@ @"<span class=""listSeparator"">; </span>", @"<span class=""listSeparator"">; </span>", "</span>", - @"<span class=""listSeparator""> and </span><br/>", + @"<span class=""logicalOperator""> and </span><br/>", @"<br/><span class=""smallIndent"">", - @"<span class=""listSeparator""> and </span><br/>", - @"<span class=""listSeparator""> and </span><br/>", + @"<span class=""logicalOperator""> and </span><br/>", + @"<span class=""logicalOperator""> and </span><br/>", "</span>", @"<br/><span class=""logicalOperator"">and that </span>", @"<br/><span class=""smallIndent"">", @@ -516,9 +516,9 @@ @"<span class=""smallIndent""><span class=""quantifier"">Reference Scheme:</span> {0}</span>", "{0}", "", - @"<span class=""listSeparator"">, and </span>", + @"<span class=""listSeparator"">,</span><span class=""logicalOperator""> and </span>", "", - @"<span class=""listSeparator""> and </span>", + @"<span class=""logicalOperator""> and </span>", @"<span class=""listSeparator"">, </span>", "", @"<span class=""logicalOperator""> and </span>", @@ -656,10 +656,10 @@ @"<span class=""listSeparator"">; </span>", @"<span class=""listSeparator"">; </span>", "</span>", - @"<span class=""listSeparator""> and </span><br/>", + @"<span class=""logicalOperator""> and </span><br/>", @"<br/><span class=""smallIndent"">", - @"<span class=""listSeparator""> and </span><br/>", - @"<span class=""listSeparator""> and </span><br/>", + @"<span class=""logicalOperator""> and </span><br/>", + @"<span class=""logicalOperator""> and </span><br/>", "</span>", @"<br/><span class=""logicalOperator"">and that </span>", @"<br/><span class=""smallIndent"">", @@ -714,9 +714,9 @@ @"<span class=""smallIndent""><span class=""quantifier"">Reference Scheme:</span> {0}</span>", "{0}", "", - @"<span class=""listSeparator"">, and </span>", + @"<span class=""listSeparator"">,</span><span class=""logicalOperator""> and </span>", "", - @"<span class=""listSeparator""> and </span>", + @"<span class=""logicalOperator""> and </span>", @"<span class=""listSeparator"">, </span>", "", @"<span class=""logicalOperator""> and </span>", @@ -854,10 +854,10 @@ @"<span class=""listSeparator"">; </span>", @"<span class=""listSeparator"">; </span>", "</span>", - @"<span class=""listSeparator""> and </span><br/>", + @"<span class=""logicalOperator""> and </span><br/>", @"<br/><span class=""smallIndent"">", - @"<span class=""listSeparator""> and </span><br/>", - @"<span class=""listSeparator""> and </span><br/>", + @"<span class=""logicalOperator""> and </span><br/>", + @"<span class=""logicalOperator""> and </span><br/>", "</span>", @"<br/><span class=""logicalOperator"">and that </span>", @"<br/><span class=""smallIndent"">", @@ -912,9 +912,9 @@ @"<span class=""smallIndent""><span class=""quantifier"">Reference Scheme:</span> {0}</span>", "{0}", "", - @"<span class=""listSeparator"">, and </span>", + @"<span class=""listSeparator"">,</span><span class=""logicalOperator""> and </span>", "", - @"<span class=""listSeparator""> and </span>", + @"<span class=""logicalOperator""> and </span>", @"<span class=""listSeparator"">, </span>", "", @"<span class=""logicalOperator""> and </span>", @@ -1052,10 +1052,10 @@ @"<span class=""listSeparator"">; </span>", @"<span class=""listSeparator"">; </span>", "</span>", - @"<span class=""listSeparator""> and </span><br/>", + @"<span class=""logicalOperator""> and </span><br/>", @"<br/><span class=""smallIndent"">", - @"<span class=""listSeparator""> and </span><br/>", - @"<span class=""listSeparator""> and </span><br/>", + @"<span class=""logicalOperator""> and </span><br/>", + @"<span class=""logicalOperator""> and </span><br/>", "</span>", @"<br/><span class=""logicalOperator"">and that </span>", @"<br/><span class=""smallIndent"">", @@ -1110,9 +1110,9 @@ @"<span class=""smallIndent""><span class=""quantifier"">Reference Scheme:</span> {0}</span>", "{0}", "", - @"<span class=""listSeparator"">, and </span>", + @"<span class=""listSeparator"">,</span><span class=""logicalOperator""> and </span>", "", - @"<span class=""listSeparator""> and </span>", + @"<span class=""logicalOperator""> and </span>", @"<span class=""listSeparator"">, </span>", "", @"<span class=""logicalOperator""> and </span>", Modified: trunk/ORMModel/ShapeModel/FactTypeShape.cs =================================================================== --- trunk/ORMModel/ShapeModel/FactTypeShape.cs 2009-12-22 08:38:42 UTC (rev 1423) +++ trunk/ORMModel/ShapeModel/FactTypeShape.cs 2009-12-31 07:19:36 UTC (rev 1424) @@ -5100,11 +5100,13 @@ // Part 1: Resize the existing fact shapes bool missingNameShapes = false; + bool hasShape = false; foreach (PresentationElement pel in PresentationViewsSubject.GetPresentation(nestedFactType)) { FactTypeShape factShape = pel as FactTypeShape; if (factShape != null) { + hasShape = true; factShape.AutoResize(); if (!missingNameShapes) { @@ -5135,6 +5137,7 @@ ObjectTypeShape objectShape = pels[i] as ObjectTypeShape; if (objectShape != null) { + hasShape = true; ORMDiagram currentDiagram = (ORMDiagram)objectShape.Diagram; // Search the current diagram and see if we have a shape for the FactType @@ -5226,6 +5229,11 @@ #endif // TRACKNEWSHAPES // Make sure we have name shapes for all fact type shapes + if (!hasShape) + { + Diagram.FixUpDiagram(nestedFactType.Model, nestedFactType); + missingNameShapes = true; + } if (missingNameShapes) { Diagram.FixUpDiagram(nestedFactType, nestingType); @@ -5958,7 +5966,10 @@ { AutoResize(); SizeD size = Size; - Location = new PointD(0, -1.5 * size.Height); + if (createdDuringViewFixup) + { + Location = new PointD(0, -1.5 * size.Height); + } foreach (ShapeElement childShape in RelativeChildShapes) { ORMBaseShape shape = childShape as ORMBaseShape; Modified: trunk/ORMModel/Shell/ORMModelBrowser.cs =================================================================== --- trunk/ORMModel/Shell/ORMModelBrowser.cs 2009-12-22 08:38:42 UTC (rev 1423) +++ trunk/ORMModel/Shell/ORMModelBrowser.cs 2009-12-31 07:19:36 UTC (rev 1424) @@ -164,9 +164,13 @@ else if (0 != (commandFlags & (ORMDesignerCommands.DiagramList))) { OleMenuCommand cmd = command as OleMenuCommand; + object selectedNode = currentWindow.SelectedNode; + IElementReference elementReference; ModelElement element; string diagramName = null; - if (null != (element = currentWindow.SelectedNode as ModelElement)) + if (null != (elementReference = selectedNode as IElementReference) ? + null != (element = elementReference.ReferencedElement as ModelElement) : + null != (element = selectedNode as ModelElement)) { int diagramIndex = cmd.MatchedCommandId; ORMBaseShape.VisitAssociatedShapes( @@ -643,7 +647,11 @@ protected virtual void OnMenuDiagramList(int diagramIndex, NavigateToWindow targetWindow) { ModelElement element; - if (null != (element = SelectedNode as ModelElement)) + IElementReference elementReference; + object selectedNode = SelectedNode; + if (null != (elementReference = selectedNode as IElementReference) ? + null != (element = elementReference.ReferencedElement as ModelElement) : + null != (element = selectedNode as ModelElement)) { ORMBaseShape.VisitAssociatedShapes( element, Modified: trunk/ORMModel/Shell/ORMReadingEditor.cs =================================================================== --- trunk/ORMModel/Shell/ORMReadingEditor.cs 2009-12-22 08:38:42 UTC (rev 1423) +++ trunk/ORMModel/Shell/ORMReadingEditor.cs 2009-12-31 07:19:36 UTC (rev 1424) @@ -85,27 +85,7 @@ } } - - private object myCommandSet; - private bool myCommandsPopulated; /// <summary> - /// returns the menu service and instantiates a new command set if none exists - /// </summary> - public override IMenuCommandService MenuService - { - get - { - IMenuCommandService retVal = base.MenuService; - if (retVal != null && !myCommandsPopulated) - { - myCommandsPopulated = true; - myCommandSet = new ReadingEditorCommandSet(myCtorServiceProvider, retVal); - } - return retVal; - } - } - - /// <summary> /// Gets the title that will be displayed on the tool window. /// </summary> public override string WindowTitle @@ -753,120 +733,5 @@ } } #endregion - #region Nested Tool Window Class - private sealed class ReadingEditorCommandSet : MarshalByRefObject, IDisposable - { - private IMenuCommandService myMenuService; - private IMonitorSelectionService myMonitorSelection; - private IServiceProvider myServiceProvider; - private MenuCommand[] myCommands; - - public ReadingEditorCommandSet(IServiceProvider provider, IMenuCommandService menuService) - { - myServiceProvider = provider; - myMenuService = menuService; - #region command array - myCommands = new MenuCommand[]{ - new DynamicStatusMenuCommand( - new EventHandler(OnStatusDelete), - new EventHandler(OnMenuDelete), - StandardCommands.Delete)}; - #endregion //command array - AddCommands(myCommands); - } - - private void AddCommands(MenuCommand[] commands) - { - IMenuCommandService menuService = MenuService; //force creation of myMenuService - if (menuService != null) - { - int count = commands.Length; - for (int i = 0; i < count; ++i) - { - menuService.AddCommand(commands[i]); - } - } - } - - private void RemoveCommands(MenuCommand[] commands) - { - IMenuCommandService menuService = myMenuService; - if (menuService != null) - { - int count = commands.Length; - for (int i = 0; i < count; ++i) - { - menuService.RemoveCommand(commands[i]); - } - } - } - - private IMenuCommandService MenuService - { - get - { - Debug.Assert(myMenuService != null); // Should be passed into the constructor - return myMenuService; - } - } - private ORMReadingEditorToolWindow CurrentToolWindow - { - get - { - return MonitorSelection.CurrentWindow as ORMReadingEditorToolWindow; - } - } - /// <summary> - /// Load the monitor selection service - /// </summary> - private IMonitorSelectionService MonitorSelection - { - get - { - IMonitorSelectionService monitorSelect = myMonitorSelection; - if (monitorSelect == null) - { - myMonitorSelection = monitorSelect = (IMonitorSelectionService)myServiceProvider.GetService(typeof(IMonitorSelectionService)); - } - return monitorSelect; - } - } - - #region IDisposable Members - - public void Dispose() - { - if (myCommands != null) - { - RemoveCommands(myCommands); - } - myMenuService = null; - myMonitorSelection = null; - myServiceProvider = null; - myCommands = null; - } - - public void OnStatusDelete(Object sender, EventArgs e) - { - //IMonitorSelectionService service = MonitorSelection; - //ORMReadingEditorToolWindow.OnStatusCommand(sender, ORMDesignerCommands.Delete, service.CurrentWindow as ORMReadingEditorToolWindow); - } - public void OnMenuDelete(Object sender, EventArgs e) - { - //ORMReadingEditorToolWindow currentWindow = CurrentToolWindow; - //if (currentWindow != null) - //{ - // currentWindow.OnMenuDelete((sender as OleMenuCommand).Text); - //} - } - #endregion - } - - #region Nested Click Location Class - - #endregion //Nested Click Location Class - - - #endregion //Nested Tool Window Class } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |