Ejemplo n.º 1
0
        public virtual void LayoutLabel()
        {
            DiagramText text1 = this.Label;

            if (text1 != null)
            {
                GeneralNode node1 = base.Parent as GeneralNode;
                if ((node1 != null) && (node1.Orientation == Orientation.Vertical))
                {
                    if (this.LeftSide)
                    {
                        text1.Alignment = 1;
                        PointF tf1 = this.GetSpotLocation(0x20);
                        tf1.Y -= this.LabelSpacing;
                        text1.SetSpotLocation(0x80, tf1);
                    }
                    else
                    {
                        text1.Alignment = 1;
                        PointF tf2 = this.GetSpotLocation(0x80);
                        tf2.Y += this.LabelSpacing;
                        text1.SetSpotLocation(0x20, tf2);
                    }
                }
                else if (this.LeftSide)
                {
                    text1.Alignment = 0x40;
                    PointF tf3 = this.GetSpotLocation(0x100);
                    tf3.X -= this.LabelSpacing;
                    text1.SetSpotLocation(0x40, tf3);
                }
                else
                {
                    text1.Alignment = 0x100;
                    PointF tf4 = this.GetSpotLocation(0x40);
                    tf4.X += this.LabelSpacing;
                    text1.SetSpotLocation(0x100, tf4);
                }
            }
        }
Ejemplo n.º 2
0
        protected override void CopyChildren(GroupShape newgroup, CopyDictionary env)
        {
            GeneralNode node1 = (GeneralNode)newgroup;

            base.CopyChildren(newgroup, env);
            node1.myLeftPorts   = new ArrayList();
            node1.myRightPorts  = new ArrayList();
            node1.myIcon        = (DiagramShape)env[this.myIcon];
            node1.myTopLabel    = (DiagramText)env[this.myTopLabel];
            node1.myBottomLabel = (DiagramText)env[this.myBottomLabel];
            for (int num1 = 0; num1 < this.myLeftPorts.Count; num1++)
            {
                GeneralNodePort port1 = (GeneralNodePort)this.myLeftPorts[num1];
                if (port1 != null)
                {
                    GeneralNodePort port2 = (GeneralNodePort)env[port1];
                    if (port2 != null)
                    {
                        node1.myLeftPorts.Add(port2);
                        port2.SideIndex = node1.myLeftPorts.Count - 1;
                        port2.LeftSide  = true;
                    }
                }
            }
            for (int num2 = 0; num2 < this.myRightPorts.Count; num2++)
            {
                GeneralNodePort port3 = (GeneralNodePort)this.myRightPorts[num2];
                if (port3 != null)
                {
                    GeneralNodePort port4 = (GeneralNodePort)env[port3];
                    if (port4 != null)
                    {
                        node1.myRightPorts.Add(port4);
                        port4.SideIndex = node1.myRightPorts.Count - 1;
                        port4.LeftSide  = false;
                    }
                }
            }
        }