Beispiel #1
0
        public override void OnDoubleClick(DiagramPointEventArgs e)
        {
            base.OnDoubleClick(e);

            var btPage = ModelElement as CloudcoreUser;

            SubProcessFiles.OpenView(Store, btPage.VisioId, btPage.SubProcess.VisioId);
        }
        public override void OnDoubleClick(DiagramPointEventArgs e)
        {
            base.OnDoubleClick(e);

            var btRule = ModelElement as WorkflowRule;
            var file = FileTypes.getFileType(FileType.SqlWorkflowRuleActivity);

            SubProcessFiles.OpenSql(Store, btRule.VisioId, btRule.SubProcess.VisioId, file);
        }
        public override void OnDoubleClick(DiagramPointEventArgs e)
        {
            base.OnDoubleClick(e);

            var corticon = ModelElement as Corticon;
            var file = FileTypes.getFileType(FileType.CloudCorticonActivity);

            SubProcessFiles.OpenClass(Store, corticon.VisioId, corticon.SubProcess.VisioId, file);
        }
        public override void OnDoubleClick(DiagramPointEventArgs e)
        {
            base.OnDoubleClick(e);

            var btEvent = ModelElement as DatabaseEvent;
            var file = FileTypes.getFileType(FileType.SqlCustomActivity);

            SubProcessFiles.OpenSql(Store, btEvent.VisioId, btEvent.SubProcess.VisioId, file);
        }
        public override void OnDoubleClick(DiagramPointEventArgs e)
        {
            base.OnDoubleClick(e);

            var btBatchCustomStart = ModelElement as CloudBatchStart;
            var file = FileTypes.getFileType(FileType.CloudBatchStartActivity);

            SubProcessFiles.OpenClass(Store, btBatchCustomStart.VisioId, btBatchCustomStart.SubProcess.VisioId, file);
        }
        public override void OnDoubleClick(DiagramPointEventArgs e)
        {
            base.OnDoubleClick(e);

            var btEvent = ModelElement as Email;
            var file = FileTypes.getFileType(FileType.CloudPostageActivity);

            SubProcessFiles.OpenClass(Store, btEvent.VisioId, btEvent.SubProcess.VisioId, file);
        }
        public override void OnDoubleClick(DiagramPointEventArgs e)
        {
            base.OnDoubleClick(e);

            var btParkCustom = ModelElement as CloudPark;
            var file = FileTypes.getFileType(FileType.CloudParkedActivity);

            SubProcessFiles.OpenClass(Store, btParkCustom.VisioId, btParkCustom.SubProcess.VisioId, file);
        }
Beispiel #8
0
		/// <summary>
		/// If the role object is part of a sticky external constraint shape
		/// object then activate it on a double click. Equivalent to the
		/// 'ActiveRoleSequence' diagram command.
		/// </summary>
		protected override void OnDoubleClick(DiagramPointEventArgs e)
		{
			// Note this looks like a strange place to put this, but this
			// is the mouse action that is active when a role is clicked on.
			if (myAllowDoubleClick)
			{
				ORMDiagram ormDiagram = Diagram as ORMDiagram;
				IStickyObject sticky;
				ExternalConstraintShape constraintShape;
				if (null != (sticky = ormDiagram.StickyObject) &&
					null != (constraintShape = sticky as ExternalConstraintShape))
				{
					foreach (Role role in e.DiagramHitTestInfo.HitDiagramItem.RepresentedElements)
					{
						if (sticky.StickySelectable(role))
						{
							IConstraint constraint = constraintShape.AssociatedConstraint;
							Role constraintRole = role;
							switch (constraint.ConstraintType)
							{
								case ConstraintType.ExternalUniqueness:
								case ConstraintType.Frequency:
									Role oppositeRole;
									ObjectType oppositeRolePlayer;
									if (null != (oppositeRole = role.OppositeRole as Role) &&
										null != (oppositeRolePlayer = oppositeRole.RolePlayer) &&
										oppositeRolePlayer.IsImplicitBooleanValue)
									{
										constraintRole = oppositeRole;
									}
									break;
							}
							foreach (ConstraintRoleSequence sequence in constraintRole.ConstraintRoleSequenceCollection)
							{
								if (constraint == sequence.Constraint)
								{
									ExternalConstraintConnectAction connectAction = ormDiagram.ExternalConstraintConnectAction;
									connectAction.ConstraintRoleSequenceToEdit = sequence;
									connectAction.ChainMouseAction(constraintShape, e.DiagramClientView);
									e.Handled = true;
									return;
								}
							}
						}
						break;
					}
				}
			}
			base.OnDoubleClick(e);
		}
 public override void OnClick(DiagramPointEventArgs e)
 {
     if (e!= null && e.HitDiagramItem != null && e.HitDiagramItem.Field != null
         && e.HitDiagramItem.Field is VDTitleImageField)
     {
         VDTitleImageField field = e.HitDiagramItem.Field as VDTitleImageField;
         VDWidgetShape parentShape = this.ParentShape as VDWidgetShape;
         if (parentShape != null)
         {
             parentShape.OnClickAdditionalTitleIcon(field.Index);
         }
     }
     base.OnClick(e);
 }
Beispiel #10
0
        public override void OnDoubleClick(DiagramPointEventArgs e)
        {
            base.OnDoubleClick(e);

            IModelBus modelBus = this.Store.GetService(typeof(SModelBus)) as IModelBus;
            ModelBusReference reference = ((FromProcessConnector)this.ModelElement).FromProcessConnectorRef;
            ModelBusAdapter adapter = modelBus.CreateAdapter(reference);
            ModelBusView view = adapter.GetDefaultView();

            if (view != null)
            {
                view.Open();
                view.SetSelection(reference);
                view.Show();
            }

            adapter.Dispose();
        }
        public override void OnClick(DiagramPointEventArgs e)
        {
            base.OnClick(e);

            foreach(var shape in this.Diagram.NestedChildShapes)
            {
                if (shape is VDWidgetShape)
                {
                    VDWidgetShape ws = shape as VDWidgetShape;
                    if (ws.DoHitTest(e.MousePosition, e.DiagramHitTestInfo))
                    {
                        ws.ZOrder += this.ZOrder;
                        ws.Invalidate(true);
                        //this.Diagram.Invalidate(true);
                        break;
                    }
                }
            }
        }
Beispiel #12
0
 /// <summary>
 /// Translate mouse events into OnSubFieldMouseEnter/OnSubFieldMouseLeave events
 /// </summary>
 /// <param name="e">DiagramPointEventArgs</param>
 public override void OnMouseEnter(DiagramPointEventArgs e)
 {
     base.OnMouseEnter(e);
     if (HasSubFieldMouseEnterLeaveHover)
     {
         DiagramItem   item       = e.DiagramHitTestInfo.HitDiagramItem;
         ShapeSubField subField   = item.SubField;
         ShapeField    shapeField = item.Field;
         // Note that we ignore any existing cached fields here. They
         // should be null at this point, but ignoring them guards against
         // the possibility that a leave event did not fire.
         if (subField == null || shapeField == null)
         {
             ActiveShapeSubField = PendingShapeSubField.Token;
             ActiveShapeField    = null;
         }
         else
         {
             ActiveShapeSubField = subField;
             ActiveShapeField    = shapeField;
             OnSubFieldMouseEnter(shapeField, subField, e);
         }
     }
 }
Beispiel #13
0
        public override void OnFieldDoubleClick(ShapeField field, DiagramPointEventArgs e)
        {
            string property_Name         = this.ModelElement.GetProperties()["Name"].GetValue(this.ModelElement.GetProperties()["Name"]).ToString();
            string property_Condition    = this.ModelElement.GetProperties()["Condition"].GetValue(this.ModelElement.GetProperties()["Condition"]).ToString();
            string property_Constraint   = this.ModelElement.GetProperties()["Constraint"].GetValue(this.ModelElement.GetProperties()["Constraint"]).ToString();
            string property_Requirements = this.ModelElement.GetProperties()["Requirements"].GetValue(this.ModelElement.GetProperties()["Requirements"]).ToString();

            RootFeatureProperties rootFeatureProperties = new RootFeatureProperties();


            rootFeatureProperties.NameTextBox.Text         = property_Name;
            rootFeatureProperties.ConditionTextBox.Text    = property_Condition;
            rootFeatureProperties.ConstraintTextBox.Text   = property_Constraint;
            rootFeatureProperties.RequirementsTextBox.Text = property_Requirements;


            if (rootFeatureProperties.DialogResult == DialogResult.OK)
            {
                this.ModelElement.GetProperties()["Name"].SetValue(this.ModelElement.GetProperties()["Name"], rootFeatureProperties.NameTextBox.Text);
                this.ModelElement.GetProperties()["Condition"].SetValue(this.ModelElement.GetProperties()["Condition"], rootFeatureProperties.ConditionTextBox.Text);
                this.ModelElement.GetProperties()["Constraint"].SetValue(this.ModelElement.GetProperties()["Constraint"], rootFeatureProperties.ConstraintTextBox.Text);
                this.ModelElement.GetProperties()["Requirements"].SetValue(this.ModelElement.GetProperties()["Requirements"], rootFeatureProperties.RequirementsTextBox.Text);
            }
        }
 /// <summary>
 ///     OnDragLeave ensure that the _clipboardObject is cleared.
 /// </summary>
 /// <param name="e"></param>
 public override void OnDragLeave(DiagramPointEventArgs e)
 {
     _clipboardObjects = null;
     base.OnDragLeave(e);
 }
Beispiel #15
0
        public override void OnClick(DiagramPointEventArgs e)
        {
            if (this.ParentShape == null || this.ParentShape.ParentShape == null) return;

            VDTabShape tabShape = this.ParentShape.ParentShape as VDTabShape;
            if (tabShape == null) return;

            VDTab tab = tabShape.ModelElement as VDTab;
            if (tab == null) return;

            VDTabHead curHead = this.ModelElement as VDTabHead;
            if (curHead == null) return;

            if (tab.ActiveHead != curHead)
            {
                using(Transaction t = this.Store.TransactionManager.BeginTransaction("Set active tab"))
                {
                    tab.ActiveHead = curHead;

                    tabShape.relayoutChildren = true; // only show active tab's body shape, hide other body shapes

                    t.Commit();
                }
            }
        }
Beispiel #16
0
 /// <summary>
 /// Fired when the mouse enters a subfield. This is called directly
 /// by OnMouseEnter.
 ///
 /// If HasSubFieldHighlighting is set, the default implementation automatically
 /// sets the HighlightedShapes of the active view to the DiagramItem representing
 /// this subfield. The subfield item will be invalidated and repainted. It is
 /// up to shapefield to check the HighlightedShapes collection and draw the subfield
 /// highlighting explicitly.
 ///
 /// Note that introducing a new ShapeSubField-derived base class would allow this
 /// to be called as the default implementation of an OnMouseEnter event on that class.
 /// However, this would need to be done at the framework level because ShapeSubField
 /// is already inherited from. Another alternative is to introduce an interface for
 /// the Enter/Leave/Hover events along with a stock implementation to help implement it.
 /// </summary>
 /// <param name="field">The parent ShapeField</param>
 /// <param name="subField">The subfield being entered</param>
 /// <param name="e">Forwarded from the OnMouseEnter event</param>
 public virtual void OnSubFieldMouseEnter(ShapeField field, ShapeSubField subField, DiagramPointEventArgs e)
 {
     if (this.HasSubFieldHighlighting)
     {
         DiagramClientView view = e.DiagramClientView;
         if (view != null)
         {
             view.HighlightedShapes.Set(new DiagramItem(this, field, subField));
         }
     }
 }
		/// <summary>
		/// Disallows expanding and collapsing of the compartment.
		/// </summary>
		public override void OnDoubleClick(DiagramPointEventArgs e)
		{
		}
		/// <summary>
		/// Translate mouse events into OnSubFieldMouseEnter/OnSubFieldMouseLeave events
		/// </summary>
		/// <param name="e">DiagramPointEventArgs</param>
		public override void OnMouseEnter(DiagramPointEventArgs e)
		{
			base.OnMouseEnter(e);
			if (HasSubFieldMouseEnterLeaveHover)
			{
				DiagramItem item = e.DiagramHitTestInfo.HitDiagramItem;
				ShapeSubField subField = item.SubField;
				ShapeField shapeField = item.Field;
				// Note that we ignore any existing cached fields here. They
				// should be null at this point, but ignoring them guards against
				// the possibility that a leave event did not fire.
				if (subField == null || shapeField == null)
				{
					ActiveShapeSubField = PendingShapeSubField.Token;
					ActiveShapeField = null;
				}
				else
				{
					ActiveShapeSubField = subField;
					ActiveShapeField = shapeField;
					OnSubFieldMouseEnter(shapeField, subField, e);
				}
			}
		}
Beispiel #19
0
 /// <summary>
 /// Fired when the mouse leaves a subfield. This is called directly
 /// by OnMouseLeave.
 ///
 /// If HasSubFieldHighlighting is set, the default implementation automatically
 /// removes the DiagramItem representing this subfield from the HighlightedShapes
 ///  of the active view. The subfield item will be invalidated and repainted. It is
 /// up to shapefield to check the HighlightedShapes collection and draw the subfield
 /// highlighting explicitly.
 ///
 /// Note that introducing a new ShapeSubField-derived base class would allow this
 /// to be called as the default implementation of an OnMouseLeave event on that class.
 /// However, this would need to be done at the framework level because ShapeSubField
 /// is already inherited from. Another alternative is to introduce an interface for
 /// the Enter/Leave/Hover events along with a stock implementation to help implement it.
 /// </summary>
 /// <param name="field">The parent ShapeField</param>
 /// <param name="subField">The subfield being left</param>
 /// <param name="e">Forwarded from the OnMouseLeave event</param>
 public virtual void OnSubFieldMouseLeave(ShapeField field, ShapeSubField subField, DiagramPointEventArgs e)
 {
     if (this.HasSubFieldHighlighting)
     {
         e.DiagramClientView.HighlightedShapes.Remove(new DiagramItem(this, field, subField));
     }
 }
Beispiel #20
0
		/// <summary>
		/// Attempt to activate an activatable error.
		/// </summary>
		/// <param name="e">DiagramPointEventArgs. Indicates the element to activate.</param>
		/// <returns>true if an error was activated</returns>
		public static bool AttemptErrorActivation(DiagramPointEventArgs e)
		{
			bool retVal = false;
			if (!e.Handled)
			{
				DiagramClientView clientView = e.DiagramClientView;
				MouseAction action = clientView.ActiveMouseAction;
				if ((action == null || !(action is ConnectAction || action is ToolboxAction)) &&
					clientView.Selection.Count == 1)
				{
					DiagramItem diagramItem = e.DiagramHitTestInfo.HitDiagramItem;
					IModelErrorActivation activator = diagramItem.Shape as IModelErrorActivation;
					if (activator != null)
					{
						IModelErrorOwner errorOwner = null;
						foreach (ModelElement mel in diagramItem.RepresentedElements)
						{
							errorOwner = EditorUtility.ResolveContextInstance(mel, false) as IModelErrorOwner;
							break;
						}
						if (errorOwner != null)
						{
							ModelErrorDisplayFilter displayFilter = null;
							ORMDiagram diagram;
							ORMModel model;
							if (null != (diagram = diagramItem.Diagram as ORMDiagram) &&
								null != (model = diagram.ModelElement as ORMModel))
							{
								displayFilter = model.ModelErrorDisplayFilter;
							}
							foreach (ModelError error in errorOwner.GetErrorCollection(ModelErrorUses.DisplayPrimary))
							{
								if (displayFilter == null || displayFilter.ShouldDisplay(error))
								{
									if (activator.ActivateModelError(error))
									{
										// UNDONE: MSBUG Report Microsoft bug DiagramClientView.OnDoubleClick is checking
										// for an active mouse action after the double click and clearing it if it is set.
										// This may be appropriate if the mouse action was set before the subfield double
										// click and did not change during the callback, but is definitely not appropriate
										// if the double click activated the mouse action.
										// Note that this bug makes it impossible to override OnDoubleClick and OnSubFieldDoubleClick
										// because e.Handled cannot be reliably checked, so there is no way to call base.OnDoubleClick
										// of base.OnSubFieldDoubleClick from a more derived class without attempting error activation
										// twice. If this is fixed, then any OnDoubleClick/OnSubFieldDoubleClick implementation
										// that simply defers to this method then calls the base can be eliminated in favor
										// of the same methods here.
										//e.Handled = true;
										retVal = true;
										break;
									}
									else
									{
										if (!retVal)
										{
											IORMToolTaskItem task;
											IORMToolServices services;
											IORMToolTaskProvider provider;
											if (null != (task = error.TaskData as IORMToolTaskItem) &&
												null != (services = error.Store as IORMToolServices) &&
												null != (provider = services.TaskProvider))
											{
												if (provider.NavigateTo(task))
												{
													retVal = true;
													break;
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
			return retVal;
		}
Beispiel #21
0
        /// <summary>
        /// Attempt to activate an activatable error.
        /// </summary>
        /// <param name="e">DiagramPointEventArgs. Indicates the element to activate.</param>
        /// <returns>true if an error was activated</returns>
        public static bool AttemptErrorActivation(DiagramPointEventArgs e)
        {
            bool retVal = false;

            if (!e.Handled)
            {
                DiagramClientView clientView = e.DiagramClientView;
                MouseAction       action     = clientView.ActiveMouseAction;
                if ((action == null || !(action is ConnectAction || action is ToolboxAction)) &&
                    clientView.Selection.Count == 1)
                {
                    DiagramItem           diagramItem = e.DiagramHitTestInfo.HitDiagramItem;
                    IModelErrorActivation activator   = diagramItem.Shape as IModelErrorActivation;
                    if (activator != null)
                    {
                        IModelErrorOwner errorOwner = null;
                        foreach (ModelElement mel in diagramItem.RepresentedElements)
                        {
                            errorOwner = EditorUtility.ResolveContextInstance(mel, false) as IModelErrorOwner;
                            break;
                        }
                        if (errorOwner != null)
                        {
                            ModelErrorDisplayFilter displayFilter = null;
                            ORMDiagram diagram;
                            ORMModel   model;
                            if (null != (diagram = diagramItem.Diagram as ORMDiagram) &&
                                null != (model = diagram.ModelElement as ORMModel))
                            {
                                displayFilter = model.ModelErrorDisplayFilter;
                            }
                            MouseAction startingMouseAction = clientView.ActiveMouseAction;
                            foreach (ModelError error in errorOwner.GetErrorCollection(ModelErrorUses.DisplayPrimary))
                            {
                                if (ModelError.IsDisplayed(error, displayFilter))
                                {
                                    if (activator.ActivateModelError(error))
                                    {
                                        // UNDONE: MSBUG Report Microsoft bug DiagramClientView.OnDoubleClick is checking
                                        // for an active mouse action after the double click and clearing it if it is set.
                                        // This may be appropriate if the mouse action was set before the subfield double
                                        // click and did not change during the callback, but is definitely not appropriate
                                        // if the double click activated the mouse action.
                                        // Note that this bug makes it impossible to override OnDoubleClick and OnSubFieldDoubleClick
                                        // because e.Handled cannot be reliably checked, so there is no way to call base.OnDoubleClick
                                        // of base.OnSubFieldDoubleClick from a more derived class without attempting error activation
                                        // twice. If this is fixed, then any OnDoubleClick/OnSubFieldDoubleClick implementation
                                        // that simply defers to this method then calls the base can be eliminated in favor
                                        // of the same methods here.
                                        if (clientView.ActiveMouseAction == startingMouseAction)
                                        {
                                            e.Handled = true;
                                        }
                                        retVal = true;
                                        break;
                                    }
                                    else
                                    {
                                        if (!retVal)
                                        {
                                            IORMToolTaskItem     task;
                                            IORMToolServices     services;
                                            IORMToolTaskProvider provider;
                                            if (null != (task = error.TaskData as IORMToolTaskItem) &&
                                                null != (services = error.Store as IORMToolServices) &&
                                                null != (provider = services.TaskProvider))
                                            {
                                                if (provider.NavigateTo(task))
                                                {
                                                    retVal = true;
                                                    break;
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(retVal);
        }
Beispiel #22
0
 /// <summary>
 /// Disallows expanding and collapsing of the compartment.
 /// </summary>
 public override void OnDoubleClick(DiagramPointEventArgs e)
 {
 }
Beispiel #23
0
		/// <summary>
		/// Handle right-clicks on the diagram
		/// </summary>
		/// <param name="mouseArgs"></param>
		protected override void OnContextMenuRequested(DiagramPointEventArgs mouseArgs)
		{
			// Command status is set when the selection is changed
			if (CommandManager.HasEnabledCommands)
			{
				base.OnContextMenuRequested(mouseArgs);
			}
			else
			{
				mouseArgs.Handled = true;
			}
		}
		/// <summary>
		/// Fired when the mouse leaves a subfield. This is called directly
		/// by OnMouseLeave.
		/// 
		/// If HasSubFieldHighlighting is set, the default implementation automatically
		/// removes the DiagramItem representing this subfield from the HighlightedShapes
		///  of the active view. The subfield item will be invalidated and repainted. It is
		/// up to shapefield to check the HighlightedShapes collection and draw the subfield
		/// highlighting explicitly.
		///
		/// Note that introducing a new ShapeSubField-derived base class would allow this
		/// to be called as the default implementation of an OnMouseLeave event on that class.
		/// However, this would need to be done at the framework level because ShapeSubField
		/// is already inherited from. Another alternative is to introduce an interface for
		/// the Enter/Leave/Hover events along with a stock implementation to help implement it.
		/// </summary>
		/// <param name="field">The parent ShapeField</param>
		/// <param name="subField">The subfield being left</param>
		/// <param name="e">Forwarded from the OnMouseLeave event</param>
		public virtual void OnSubFieldMouseLeave(ShapeField field, ShapeSubField subField, DiagramPointEventArgs e)
		{
			if (this.HasSubFieldHighlighting)
			{
				e.DiagramClientView.HighlightedShapes.Remove(new DiagramItem(this, field, subField));
			}
		}
		/// <summary>
		/// Translate mouse event into OnSubFieldMouseHover events
		/// </summary>
		/// <param name="e">DiagramPointEventArgs</param>
		public override void OnMouseHover(DiagramPointEventArgs e)
		{
			base.OnMouseHover(e);
			if (HasSubFieldMouseEnterLeaveHover)
			{
				ShapeSubField subField = ActiveShapeSubField;
				if (subField != null && !PendingShapeSubField.Token.SubFieldEquals(subField))
				{
					Debug.Assert(ActiveShapeField != null); // Should be able to set sub field without shape field
					OnSubFieldMouseHover(ActiveShapeField, subField, e);
				}
			}
		}
		/// <summary>
		/// Translate mouse events into OnSubFieldMouseEnter/OnSubFieldMouseLeave events
		/// </summary>
		/// <param name="e">DiagramPointEventArgs</param>
		public override void OnMouseLeave(DiagramPointEventArgs e)
		{
			base.OnMouseLeave(e);
			if (HasSubFieldMouseEnterLeaveHover)
			{
				ShapeSubField subField = ActiveShapeSubField;
				ActiveShapeSubField = null;
				if (subField != null && !PendingShapeSubField.Token.SubFieldEquals(subField))
				{
					ShapeField shapeField = ActiveShapeField;
					ActiveShapeField = null;
					OnSubFieldMouseLeave(shapeField, subField, e);
				}
			}
		}
        public override void OnDoubleClick(DiagramPointEventArgs e)
        {
            var association = ModelElement;
            if (association != null)
            {
                var diagram = Diagram as EntityDesignerDiagram;
                if (diagram != null)
                {
                    var ec = diagram.GetModel().EditingContext;
                    var xref = ModelToDesignerModelXRef.GetModelToDesignerModelXRef(ec);

                    var modelAssociation = xref.GetExisting(association) as Model.Entity.Association;
                    Debug.Assert(modelAssociation != null, "couldn't find model association for connector");
                    if (modelAssociation != null)
                    {
                        var commands = ReferentialConstraintDialog.LaunchReferentialConstraintDialog(modelAssociation);

                        var cpc = new CommandProcessorContext(
                            ec, EfiTransactionOriginator.EntityDesignerOriginatorId, Resources.Tx_ReferentialContraint);
                        var cp = new CommandProcessor(cpc);
                        foreach (var c in commands)
                        {
                            cp.EnqueueCommand(c);
                        }
                        cp.Invoke();
                    }
                }
            }
        }
		/// <summary>
		/// Fired when the mouse enters a subfield. This is called directly
		/// by OnMouseEnter.
		/// 
		/// If HasSubFieldHighlighting is set, the default implementation automatically
		/// sets the HighlightedShapes of the active view to the DiagramItem representing
		/// this subfield. The subfield item will be invalidated and repainted. It is
		/// up to shapefield to check the HighlightedShapes collection and draw the subfield
		/// highlighting explicitly.
		/// 
		/// Note that introducing a new ShapeSubField-derived base class would allow this
		/// to be called as the default implementation of an OnMouseEnter event on that class.
		/// However, this would need to be done at the framework level because ShapeSubField
		/// is already inherited from. Another alternative is to introduce an interface for
		/// the Enter/Leave/Hover events along with a stock implementation to help implement it.
		/// </summary>
		/// <param name="field">The parent ShapeField</param>
		/// <param name="subField">The subfield being entered</param>
		/// <param name="e">Forwarded from the OnMouseEnter event</param>
		public virtual void OnSubFieldMouseEnter(ShapeField field, ShapeSubField subField, DiagramPointEventArgs e)
		{
			if (this.HasSubFieldHighlighting)
			{
				DiagramClientView view = e.DiagramClientView;
				if (view != null)
				{
					view.HighlightedShapes.Set(new DiagramItem(this, field, subField));
				}
			}
		}
 /// <summary>
 /// Double-click => rotate by 90 degrees.
 ///
 /// http://msdn.microsoft.com/library/bb126591.aspx
 /// </summary>
 /// <param name="e"></param>
 public override void OnDoubleClick(DiagramPointEventArgs e)
 {
     base.OnDoubleClick(e);
     this.Rotate90();
     e.Handled = true; // Don't pass to parent.
 }
Beispiel #30
0
 /// <summary>
 /// Fired when the mouse hovers over a subfield. This is called directly
 /// by OnMouseHover.
 ///
 /// The default implementation is empty.
 ///
 /// Note that introducing a new ShapeSubField-derived base class would allow this
 /// to be called as the default implementation of an OnMouseHover event on that class.
 /// However, this would need to be done at the framework level because ShapeSubField
 /// is already inherited from. Another alternative is to introduce an interface for
 /// the Enter/Leave/Hover events along with a stock implementation to help implement it.
 /// </summary>
 /// <param name="field">The parent ShapeField</param>
 /// <param name="subField">The subfield being hovered over</param>
 /// <param name="e">Forwarded from the OnMouseHover event</param>
 public virtual void OnSubFieldMouseHover(ShapeField field, ShapeSubField subField, DiagramPointEventArgs e)
 {
 }
Beispiel #31
0
		/// <summary>
		/// Highlight both the name shape and the corresponding role box.
		/// </summary>
		public override void OnMouseEnter(DiagramPointEventArgs e)
		{
			DiagramClientView clientView;
			FactTypeShape parentShape;
			Role role;
			if (null != (clientView = e.DiagramClientView) &&
				null != (parentShape = ParentShape as FactTypeShape) &&
				null != (role = this.ModelElement as Role))
			{
				DiagramItemCollection items = new DiagramItemCollection();
				items.Add(new DiagramItem(this));
				items.Add(parentShape.GetDiagramItem(role));
				clientView.HighlightedShapes.Set(items);
			}
			else
			{
				base.OnMouseEnter(e);
			}
		}
		/// <summary>
		/// Fired when the mouse hovers over a subfield. This is called directly
		/// by OnMouseHover.
		/// 
		/// The default implementation is empty.
		/// 
		/// Note that introducing a new ShapeSubField-derived base class would allow this
		/// to be called as the default implementation of an OnMouseHover event on that class.
		/// However, this would need to be done at the framework level because ShapeSubField
		/// is already inherited from. Another alternative is to introduce an interface for
		/// the Enter/Leave/Hover events along with a stock implementation to help implement it.
		/// </summary>
		/// <param name="field">The parent ShapeField</param>
		/// <param name="subField">The subfield being hovered over</param>
		/// <param name="e">Forwarded from the OnMouseHover event</param>
		public virtual void OnSubFieldMouseHover(ShapeField field, ShapeSubField subField, DiagramPointEventArgs e)
		{
		}
Beispiel #33
0
		/// <summary>
		/// Highlight both the name shape and the corresponding role box.
		/// </summary>
		public override void OnMouseLeave(DiagramPointEventArgs e)
		{
			DiagramClientView clientView;
			FactTypeShape parentShape;
			Role role;
			if (null != (clientView = e.DiagramClientView) &&
				null != (parentShape = ParentShape as FactTypeShape) &&
				null != (role = this.ModelElement as Role))
			{
				clientView.HighlightedShapes.Remove(new DiagramItem[]{new DiagramItem(this), parentShape.GetDiagramItem(role)});
			}
			else
			{
				base.OnMouseLeave(e);
			}
		}
Beispiel #34
0
 /// <summary>
 /// When the user will double-click on the text field, this will show a message box
 /// and then will set the value of the field to something (here "Changed!")
 /// Instead of the Message Box the customer will need to provide his own dialogbox
 /// </summary>
 /// <param name="e"></param>
 public override void OnDoubleClick(DiagramPointEventArgs e)
 {
     base.OnDoubleClick(e);
     MessageBox.Show("Double click in the texual decorator");
     this.SetValue(e.HitDiagramItem.Shape, "Changed!");
 }
Beispiel #35
0
 /// <summary>
 /// Attempt model error activation
 /// </summary>
 public override void OnDoubleClick(DiagramPointEventArgs e)
 {
     ORMBaseShape.AttemptErrorActivation(e);
     base.OnDoubleClick(e);
 }
		/// <summary>
		/// A mouse click event has occurred on this ExternalConstraintShape
		/// </summary>
		/// <param name="e">DiagramPointEventArgs</param>
		public override void OnDoubleClick(DiagramPointEventArgs e)
		{
			if (!ORMBaseShape.AttemptErrorActivation(e))
			{
				ActivateNewRoleSequenceAction(e.DiagramClientView);
			}
			base.OnDoubleClick(e);
		}