Inheritance: NodeElement, IControllable, ILabelElement
コード例 #1
0
        private void EndAddElement(Rectangle selectionRectangle)
        {
            BaseElement el;

            switch (document.ElementType)
            {
            case ElementType.Rectangle:
                el = new RectangleElement(selectionRectangle);
                break;

            case ElementType.RectangleNode:
                el = new RectangleNode(selectionRectangle);
                break;

            case ElementType.Elipse:
                el = new ElipseElement(selectionRectangle);
                break;

            case ElementType.ElipseNode:
                el = new ElipseNode(selectionRectangle);
                break;

            case ElementType.CommentBox:
                el = new CommentBoxElement(selectionRectangle);
                break;

            case ElementType.CommentBoxNode:
                el = new CommentBoxNode(selectionRectangle);
                break;

            default:
                el = new RectangleNode(selectionRectangle);
                break;
            }

            document.AddElement(el);

            document.Action = DesignerAction.Select;
        }
コード例 #2
0
        protected virtual BaseElement CreateElementInstance(Rectangle rectangle)
        {
            BaseElement el;

            switch (Document.ElementType)
            {
            case ElementType.Rectangle:
                el = new RectangleElement(rectangle);
                break;

            case ElementType.RectangleNode:
                el = new RectangleNode(rectangle);
                break;

            case ElementType.Elipse:
                el = new ElipseElement(rectangle);
                break;

            case ElementType.ElipseNode:
                el = new ElipseNode(rectangle);
                break;

            case ElementType.CommentBox:
                el = new CommentBoxElement(rectangle);
                break;

            case ElementType.CommentBoxNode:
                el = new CommentBoxNode(rectangle);
                break;

            default:
                el = new RectangleNode(rectangle);
                break;
            }
            return(el);
        }
コード例 #3
0
ファイル: Designer.cs プロジェクト: AlexandrSurkov/PKStudio
		private void EndAddElement(Rectangle selectionRectangle)
		{
			BaseElement el;
			switch (document.ElementType)
			{
				case ElementType.Rectangle:
					el = new RectangleElement(selectionRectangle);
					break;
				case ElementType.RectangleNode:
					el = new RectangleNode(selectionRectangle);
					break;
				case ElementType.Elipse:
					el = new ElipseElement(selectionRectangle);
					break;
				case ElementType.ElipseNode:
					el = new ElipseNode(selectionRectangle);
					break;
				case ElementType.CommentBox:
					el = new CommentBoxElement(selectionRectangle);
					break;
				default:
					el = new RectangleNode(selectionRectangle);
					break;
			}
			
			document.AddElement(el);
			
			document.Action = DesignerAction.Select;	
		}
コード例 #4
0
        private StraightLinkElement AddLinkElement(string text, RectangleNode node1, int Node1connector, LineCap StartNodeAnchor, RectangleNode node2, int Node2connector, LineCap EndNodeAnchor, Color color, int XCor,int YCor)
        {
            //RightAngleLinkElement link = new RightAngleLinkElement(node1.Connectors[1], node2.Connectors[0]);

            AdvancedStraightLinkElement link = new AdvancedStraightLinkElement(node1, node1.Connectors[Node1connector], node2, node2.Connectors[Node2connector]);

            link.BorderWidth = 5;
            link.BorderColor = color;
            link.Opacity = 30;
            link.StartCap = StartNodeAnchor;
            link.EndCap = EndNodeAnchor;

            link.Label.ReadOnly = true;
            link.Label.Text = text;

            //link.Label.Location = new Point(link.Location.X+sizeChange,link.Location.Y+sizeChange);
            link.Label.XLocationCorection = XCor;
            link.Label.YLocationCorection = YCor;
            link.Label.Location = link.Location;
            link.Label.Size = link.Size;

            //link.Label.Size = new Size(link.Size.Width + sizeChange, link.Size.Height + sizeChange);


            designer1.Document.AddElement(link);

            return link;
        }
コード例 #5
0
 private StraightLinkElement AddLinkElement(string text, RectangleNode node1, int Node1connector, LineCap StartNodeAnchor, RectangleNode node2, int Node2connector, LineCap EndNodeAnchor, Color color)
 {
     return AddLinkElement(text, node1, Node1connector, StartNodeAnchor, node2, Node2connector, EndNodeAnchor, color, 0,0);
 }