Inheritance: BaseLinkElement, IControllable, ILabelElement
Esempio n. 1
0
        public BaseLinkElement AddLink(ConnectorElement connStart, ConnectorElement connEnd)
        {
            if (CanAddLink(connStart, connEnd))
            {
                BaseLinkElement lnk;

                if (linkType == LinkType.Straight)
                {
                    lnk = new StraightLinkElement(connStart, connEnd);
                }
                else                 // (linkType == LinkType.RightAngle)
                {
                    lnk = new RightAngleLinkElement(connStart, connEnd);
                }

                elements.Add(lnk);
                lnk.AppearanceChanged += new EventHandler(element_AppearanceChanged);
                OnAppearancePropertyChanged(new EventArgs());
                return(lnk);
            }
            else
            {
                return(null);
            }
        }
        public RightAngleLinkController(RightAngleLinkElement element)
        {
            el = element;

            //Create corners
            if (el.lines.Length == 3)
            {
                selectionCorner                = new RectangleElement[1];
                selectionCorner[0]             = new RectangleElement(0, 0, selCornerSize * 2, selCornerSize * 2);
                selectionCorner[0].BorderColor = Color.Black;
                selectionCorner[0].FillColor1  = Color.White;
                selectionCorner[0].FillColor2  = Color.Empty;
            }
            else
            {
                selectionCorner = new RectangleElement[0];
            }
        }
		public RightAngleLinkController(RightAngleLinkElement element)
		{
			el = element;
			
			//Create corners
			if (el.lines.Length == 3)
			{
				selectionCorner = new RectangleElement[1];
				selectionCorner[0] = new RectangleElement(0, 0, selCornerSize * 2, selCornerSize * 2);
				selectionCorner[0].BorderColor = Color.Black;
				selectionCorner[0].FillColor1 = Color.White;
				selectionCorner[0].FillColor2 = Color.Empty;
			}
			else
			{
				selectionCorner = new RectangleElement[0];
			}
		}
Esempio n. 4
0
		public BaseLinkElement AddLink(ConnectorElement connStart, ConnectorElement connEnd)
		{
			if (CanAddLink(connStart, connEnd))
			{
				BaseLinkElement lnk;
				
				if (linkType == LinkType.Straight)
					lnk = new StraightLinkElement(connStart, connEnd);
				else // (linkType == LinkType.RightAngle)
					lnk = new RightAngleLinkElement(connStart, connEnd);

				elements.Add(lnk);
				lnk.AppearanceChanged +=new EventHandler(element_AppearanceChanged);
				OnAppearancePropertyChanged(new EventArgs());
				return lnk;
			}
			else
			{
				return null;
			}
		}
Esempio n. 5
0
        public BaseLinkElement AddLink(ConnectorElement connStart, ConnectorElement connEnd)
        {
            if (CanAddLink(connStart, connEnd))
            {
                BaseLinkElement lnk;

                if (linkType == LinkType.Straight)
                {
                    lnk = new StraightLinkElement(connStart, connEnd);
                }
                else                 // (linkType == LinkType.RightAngle)
                {
                    lnk = new RightAngleLinkElement(connStart, connEnd);
                }

                AddLink(lnk);
                return(lnk);
            }
            else
            {
                return(null);
            }
        }