Example #1
0
 public RawShape(ShapeCanvas canvas, string name, Font font, Font fontCategory, Font fontProperty)
 {
     OriginatingLineStyle = new LinkLine(font);
     OriginatingLineStyle.Parent = this;
     Text = name;
     Font = font;
     FontCategory = fontCategory;
     FontProperty = fontProperty;
     Canvas = canvas;
 }
Example #2
0
 public RawShape(ShapeCanvas canvas, string name, Font font, Font fontCategory, Font fontProperty)
 {
     OriginatingLineStyle        = new LinkLine(font);
     OriginatingLineStyle.Parent = this;
     Text         = name;
     Font         = font;
     FontCategory = fontCategory;
     FontProperty = fontProperty;
     Canvas       = canvas;
 }
        void OriginatingLineStyle_MouseClick(object sender, MouseEventArgs e)
        {
            SelectedLinkLine = (LinkLine)sender;

            //if (e.Button == MouseButtons.Right)
            //    ShowContextMenuForDiscriminator();
        }
        void MapLine_MiddleImageClick(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                SelectedLinkLine = (LinkLine)sender;
                EntityImpl entity = (EntityImpl)SelectedLinkLine.DataObject;

                //UserControls.FormDiscriminator form = new UserControls.FormDiscriminator(entity);
                //form.StartPosition = FormStartPosition.CenterParent;//.Manual;
                //form.ShowDialog(this);

                //SelectedLinkLine.MiddleText = GetDiscriminatorText(entity);

                //if (string.IsNullOrEmpty(SelectedLinkLine.MiddleText))
                //{
                //    SelectedLinkLine.MiddleImage = FilterImageDisabled;
                //    SelectedLinkLine.MiddleImageFocused = FilterImageDisabled;
                //}
                //else
                //{
                //    SelectedLinkLine.MiddleImage = FilterImage;
                //    SelectedLinkLine.MiddleImageFocused = FilterImageFocused;
                //}
                Point pt = ((LinkLine)sender).MidPoint;
                pt.Offset(-1 * MappingEditor.Width / 2, -1 * MappingEditor.Height / 2);

                if (pt.Y < 2)
                    pt.Offset(0, 5 - pt.Y);

                MappingEditor.EntityOnLeft = false;
                MappingEditor.Entity = entity;
                MappingEditor.Table = Table;
                MappingEditor.Location = pt;
                MappingEditor.BringToFront();
                MappingEditor.Visible = true;
                MappingEditor.Refresh();
            }
            //else
            //{
            //    ShowContextMenuForDiscriminator();
            //}
        }
Example #5
0
 public LineEndWithFocus(LinkLine line, EndTypes endType)
 {
     Line = line;
     EndType = endType;
 }
Example #6
0
        internal LinkLine ProcessMouseClick(MouseEventArgs e)
        {
            LinkLine focusedLinkLine = null;

            if (this.GPath != null &&
                this.GPath.IsVisible(e.X, e.Y))
            {
                bool subShapeHasClick = false;

                foreach (RawCategory cat in this.Categories)
                {
                    //if (cat.Bounds.Contains(e.Location))
                    //{
                    //    cat.ProcessMouseClick(e);
                    //    subShapeHasClick = true;
                    //    break;
                    //}
                    if (!Canvas.CtrlKeyDown && e.Button == MouseButtons.Left)
                    {
                        cat.SelectedProperties.Clear();
                    }

                    foreach (RawProperty prop in cat.Properties)
                    {
                        if (prop.Bounds.Contains(e.Location))
                        {
                            if (e.Button == MouseButtons.Left)
                            {
                                if (prop.IsSelected)
                                {
                                    cat.SelectedProperties.Remove(prop);
                                }
                                else
                                {
                                    cat.SelectedProperties.Add(prop);
                                    prop.ProcessMouseClick(e);
                                    subShapeHasClick = true;
                                }
                            }
                            else if (e.Button == MouseButtons.Right)
                            {
                                prop.ProcessMouseClick(e);
                                subShapeHasClick = true;
                            }
                            // Break if ctrl key down, because we don't need to 'de-select' the other properties
                            if (Canvas.CtrlKeyDown && e.Button == MouseButtons.Left)
                            {
                                break;
                            }
                        }
                        else if (!Canvas.CtrlKeyDown &&
                                 !Canvas.ShiftKeyDown &&
                                 e.Button == MouseButtons.Left)
                        {
                            prop.IsSelected = false;
                        }
                    }
                    if (e.Button == MouseButtons.Right &&
                        cat.SelectedProperties.Count > 0 &&
                        cat.Bounds.Contains(e.Location))
                    {
                        if (!cat.GPathHeader.IsVisible(e.X, e.Y))
                        {
                            cat.RaiseMultiPropertiesClicked();
                        }

                        subShapeHasClick = true;
                    }
                    else if (e.Button == MouseButtons.Right &&
                             cat.Bounds.Contains(e.Location))
                    {
                        cat.ProcessMouseClick(e);
                    }
                }
                this.HasFocus = true;

                if (!subShapeHasClick)
                {
                    this.RaiseMouseClick(e);
                }
            }
            else
            {
                this.HasFocus = false;
            }

            if (this.OriginatingLineStyle != null)
            {
                if (this.OriginatingLineStyle.GPathMiddleImage != null &&
                    this.OriginatingLineStyle.GPathMiddleImage.IsVisible(e.X, e.Y))
                {
                    this.OriginatingLineStyle.IsFocused = true;
                    this.OriginatingLineStyle.RaiseMiddleImageClick(e);
                    focusedLinkLine = this.OriginatingLineStyle;
                }
                else if (this.OriginatingLineStyle.GPathStartImage != null &&
                         this.OriginatingLineStyle.GPathStartImage.IsVisible(e.X, e.Y))
                {
                    this.OriginatingLineStyle.IsFocused = true;
                    this.OriginatingLineStyle.RaiseStartImageClick(e);
                    focusedLinkLine = this.OriginatingLineStyle;
                }
                else if (this.OriginatingLineStyle.GPathEndImage != null &&
                         this.OriginatingLineStyle.GPathEndImage.IsVisible(e.X, e.Y))
                {
                    this.OriginatingLineStyle.IsFocused = true;
                    this.OriginatingLineStyle.RaiseEndImageClick(e);
                    focusedLinkLine = this.OriginatingLineStyle;
                }
                else if (this.OriginatingLineStyle.GPath != null &&
                         this.OriginatingLineStyle.GPath.IsVisible(e.X, e.Y))
                {
                    this.OriginatingLineStyle.IsFocused = true;
                    this.OriginatingLineStyle.RaiseMouseClick(e);
                    focusedLinkLine = this.OriginatingLineStyle;
                }
                else
                {
                    this.OriginatingLineStyle.IsFocused = false;
                }
            }
            foreach (RawCategory category in Categories)
            {
                if (category.Bounds.Contains(e.Location))
                {
                    category.ProcessMouseClick(e);
                }
            }
            return(focusedLinkLine);
        }