|
From: <mcu...@us...> - 2012-03-26 22:42:04
|
Revision: 1483
http://orm.svn.sourceforge.net/orm/?rev=1483&view=rev
Author: mcurland
Date: 2012-03-26 22:41:58 +0000 (Mon, 26 Mar 2012)
Log Message:
-----------
* Fix unconstrained unary fact types displaying as binary fact types on reload.
* Fix role name shapes appearing for fact types displayed as object types on reload.
* Add option in 'Appearance' category to not display shape shadows if shape appears more than once.
Modified Paths:
--------------
trunk/ORMModel/Resources/ResourceStrings.cs
trunk/ORMModel/ShapeModel/FactTypeShape.cs
trunk/ORMModel/ShapeModel/ModelNoteShape.cs
trunk/ORMModel/ShapeModel/ORMDiagram.resx
trunk/ORMModel/ShapeModel/ObjectTypeShape.cs
trunk/ORMModel/ShapeModel/RoleNameShape.cs
trunk/ORMModel/Shell/OptionsPage.cs
Modified: trunk/ORMModel/Resources/ResourceStrings.cs
===================================================================
--- trunk/ORMModel/Resources/ResourceStrings.cs 2012-01-23 19:35:08 UTC (rev 1482)
+++ trunk/ORMModel/Resources/ResourceStrings.cs 2012-03-26 22:41:58 UTC (rev 1483)
@@ -349,6 +349,14 @@
/// </summary>
public const string OptionsPagePropertyRoleNameDisplayDisplayNameId = "OptionsPage.Property.RoleNameDisplay.DisplayName";
/// <summary>
+ /// Description of the Role Name Display option
+ /// </summary>
+ public const string OptionsPagePropertyDisplayShadowsDescriptionId = "OptionsPage.Property.DisplayShadows.Description";
+ /// <summary>
+ /// Display Name of the Role Name Display option
+ /// </summary>
+ public const string OptionsPagePropertyDisplayShadowsDisplayNameId = "OptionsPage.Property.DisplayShadows.DisplayName";
+ /// <summary>
/// Description of the Primary Delete Behavior
/// </summary>
public const string OptionsPagePropertyPrimaryDeleteBehaviorDescriptionId = "OptionsPage.Property.PrimaryDeleteBehavior.Description";
Modified: trunk/ORMModel/ShapeModel/FactTypeShape.cs
===================================================================
--- trunk/ORMModel/ShapeModel/FactTypeShape.cs 2012-01-23 19:35:08 UTC (rev 1482)
+++ trunk/ORMModel/ShapeModel/FactTypeShape.cs 2012-03-26 22:41:58 UTC (rev 1483)
@@ -572,6 +572,10 @@
/// </summary>
protected void ConfiguringAsChildOf(NodeShape parentShape, bool createdDuringViewFixup)
{
+ EnsureUnaryRoleDisplayOrder();
+ }
+ private void EnsureUnaryRoleDisplayOrder()
+ {
// Make sure the factType shape is prepared to display as a unary
FactType factType;
Role unaryRole;
@@ -3276,7 +3280,7 @@
{
get
{
- return ORMBaseShape.ElementHasMultiplePresentations(this);
+ return OptionsPage.CurrentDisplayShadows && ORMBaseShape.ElementHasMultiplePresentations(this);
}
}
/// <summary>
@@ -6852,6 +6856,7 @@
/// </summary>
protected sealed override void ProcessElement(FactTypeShape element, Store store, INotifyElementAdded notifyAdded)
{
+ element.EnsureUnaryRoleDisplayOrder();
PointD centerPoint = RolesShape.GetBounds(element).Center;
element.RolesPosition = (element.DisplayOrientation != DisplayOrientation.Horizontal) ? centerPoint.X : centerPoint.Y;
}
Modified: trunk/ORMModel/ShapeModel/ModelNoteShape.cs
===================================================================
--- trunk/ORMModel/ShapeModel/ModelNoteShape.cs 2012-01-23 19:35:08 UTC (rev 1482)
+++ trunk/ORMModel/ShapeModel/ModelNoteShape.cs 2012-03-26 22:41:58 UTC (rev 1483)
@@ -99,7 +99,7 @@
{
get
{
- return ORMBaseShape.ElementHasMultiplePresentations(this);
+ return OptionsPage.CurrentDisplayShadows && ORMBaseShape.ElementHasMultiplePresentations(this);
}
}
/// <summary>
Modified: trunk/ORMModel/ShapeModel/ORMDiagram.resx
===================================================================
--- trunk/ORMModel/ShapeModel/ORMDiagram.resx 2012-01-23 19:35:08 UTC (rev 1482)
+++ trunk/ORMModel/ShapeModel/ORMDiagram.resx 2012-03-26 22:41:58 UTC (rev 1483)
@@ -719,6 +719,14 @@
<value xml:space="preserve">Show Description Tooltips</value>
<comment xml:space="preserve">The display name for the display definition tooltips property.</comment>
</data>
+ <data name="OptionsPage.Property.DisplayShadows.Description">
+ <value xml:space="preserve">Control if shape shadows are displayed when an element is represented by multiple shapes.</value>
+ <comment xml:space="preserve">The description for the Display Role Names option.</comment>
+ </data>
+ <data name="OptionsPage.Property.DisplayShadows.DisplayName">
+ <value xml:space="preserve">Display Shadows</value>
+ <comment xml:space="preserve">The display name for the Display Shadows option.</comment>
+ </data>
<data name="OptionsPage.Property.DelayActivateModelBrowserLabelEdits.Description">
<value xml:space="preserve">Automatically activate inline text editors in the ORM Model Browser after a short delay when selected with the mouse. Text edits can be explicitly activated with the View.EditLabel command (generally associated with the F2 key).</value>
<comment xml:space="preserve">The delay activate model browser label edits description.</comment>
Modified: trunk/ORMModel/ShapeModel/ObjectTypeShape.cs
===================================================================
--- trunk/ORMModel/ShapeModel/ObjectTypeShape.cs 2012-01-23 19:35:08 UTC (rev 1482)
+++ trunk/ORMModel/ShapeModel/ObjectTypeShape.cs 2012-03-26 22:41:58 UTC (rev 1483)
@@ -104,7 +104,7 @@
{
get
{
- return ORMBaseShape.ElementHasMultiplePresentations(this);
+ return OptionsPage.CurrentDisplayShadows && ORMBaseShape.ElementHasMultiplePresentations(this);
}
}
/// <summary>
Modified: trunk/ORMModel/ShapeModel/RoleNameShape.cs
===================================================================
--- trunk/ORMModel/ShapeModel/RoleNameShape.cs 2012-01-23 19:35:08 UTC (rev 1482)
+++ trunk/ORMModel/ShapeModel/RoleNameShape.cs 2012-03-26 22:41:58 UTC (rev 1483)
@@ -262,21 +262,10 @@
FactTypeShape fts = element as FactTypeShape;
if (fts != null)
{
- bool shouldDisplay = false;
- bool shouldRemove = false;
- if (fts.DisplayRoleNames == DisplayRoleNames.UserDefault
- && OptionsPage.CurrentRoleNameDisplay == RoleNameDisplay.On)
- {
- shouldDisplay = true;
- }
- else if (fts.DisplayRoleNames == DisplayRoleNames.On)
- {
- shouldDisplay = true;
- }
- else if (fts.DisplayRoleNames == DisplayRoleNames.Off)
- {
- shouldRemove = true;
- }
+ DisplayRoleNames display = fts.DisplayRoleNames;
+ bool asObjectType = fts.DisplayAsObjectType;
+ bool shouldDisplay = !asObjectType && display == DisplayRoleNames.On || (display == DisplayRoleNames.UserDefault && OptionsPage.CurrentRoleNameDisplay == RoleNameDisplay.On);
+ bool shouldRemove = asObjectType || display == DisplayRoleNames.Off;
foreach (RoleBase roleBase in fact.RoleCollection)
{
Role role = roleBase as Role;
Modified: trunk/ORMModel/Shell/OptionsPage.cs
===================================================================
--- trunk/ORMModel/Shell/OptionsPage.cs 2012-01-23 19:35:08 UTC (rev 1482)
+++ trunk/ORMModel/Shell/OptionsPage.cs 2012-03-26 22:41:58 UTC (rev 1483)
@@ -351,6 +351,10 @@
private static RoleNameDisplay myCurrentRoleNameDisplay = RoleNameDisplay_Default;
private RoleNameDisplay myRoleNameDisplay = RoleNameDisplay_Default;
+ private const bool DisplayShadows_Default = true;
+ private static bool myCurrentDisplayShadows = DisplayShadows_Default;
+ private bool myDisplayShadows = DisplayShadows_Default;
+
private const PortableDataType DefaultDataType_Default = PortableDataType.Unspecified;
private static PortableDataType myCurrentDefaultDataType = DefaultDataType_Default;
private PortableDataType myDefaultDataType = DefaultDataType_Default;
@@ -449,6 +453,7 @@
myCurrentObjectifiedFactDisplayShape = myObjectifiedFactDisplayShape;
myCurrentMandatoryDotPlacement = myMandatoryDotPlacement;
myCurrentRoleNameDisplay = myRoleNameDisplay;
+ myCurrentDisplayShadows = myDisplayShadows;
myCurrentDefaultDataType = myDefaultDataType;
myCurrentExternalConstraintRoleBarDisplay = myExternalConstraintRoleBarDisplay;
myCurrentPrimaryDeleteBehavior = myPrimaryDeleteBehavior;
@@ -477,6 +482,7 @@
myObjectifiedFactDisplayShape = myCurrentObjectifiedFactDisplayShape;
myMandatoryDotPlacement = myCurrentMandatoryDotPlacement;
myRoleNameDisplay = myCurrentRoleNameDisplay;
+ myDisplayShadows = myCurrentDisplayShadows;
myDefaultDataType = myCurrentDefaultDataType;
myExternalConstraintRoleBarDisplay = myCurrentExternalConstraintRoleBarDisplay;
myPrimaryDeleteBehavior = myCurrentPrimaryDeleteBehavior;
@@ -512,6 +518,7 @@
myCurrentObjectifiedFactDisplayShape == myObjectifiedFactDisplayShape &&
myCurrentObjectTypeDisplayShape == myObjectTypeDisplayShape &&
myCurrentRoleNameDisplay == myRoleNameDisplay &&
+ myCurrentDisplayShadows == myDisplayShadows &&
myCurrentExternalConstraintRoleBarDisplay == myExternalConstraintRoleBarDisplay &&
myCurrentPreferredInternalUniquenessConstraintDisplay == myPreferredInternalUniquenessConstraintDisplay &&
myCurrentReadingDirectionIndicatorDisplay == myReadingDirectionIndicatorDisplay &&
@@ -547,6 +554,7 @@
myCurrentObjectifiedFactDisplayShape = myObjectifiedFactDisplayShape;
myCurrentObjectTypeDisplayShape = myObjectTypeDisplayShape;
myCurrentRoleNameDisplay = myRoleNameDisplay;
+ myCurrentDisplayShadows = myDisplayShadows;
myCurrentExternalConstraintRoleBarDisplay = myExternalConstraintRoleBarDisplay;
myCurrentDefaultDataType = myDefaultDataType;
myCurrentPrimaryDeleteBehavior = myPrimaryDeleteBehavior;
@@ -720,6 +728,27 @@
}
/// <summary>
+ /// Display of shape shadow
+ /// </summary>
+ [DefaultValue(DisplayShadows_Default)]
+ [LocalizedCategory(ResourceStrings.OptionsPageCategoryAppearanceId)]
+ [LocalizedDescription(ResourceStrings.OptionsPagePropertyDisplayShadowsDescriptionId)]
+ [LocalizedDisplayName(ResourceStrings.OptionsPagePropertyDisplayShadowsDisplayNameId)]
+ public bool DisplayShadows
+ {
+ get { return myDisplayShadows; }
+ set { myDisplayShadows = value; }
+ }
+
+ /// <summary>
+ /// Current VS session-wide setting for DisplayShadows
+ /// </summary>
+ public static bool CurrentDisplayShadows
+ {
+ get { return myCurrentDisplayShadows; }
+ }
+
+ /// <summary>
/// Default data type for value types
/// </summary>
[DefaultValue(DefaultDataType_Default)]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|