Esempio n. 1
0
        public void Draw(CloneGenealogyViz cgv, XmlElement mapElement)
        {
            int flag = 0;

            foreach (XmlElement cfMap in mapElement.SelectNodes("CFMap"))
            {
                flag = 1;
                int   srccfid  = Int32.Parse(cfMap.GetAttribute("srcCFid"));
                int   destcfid = Int32.Parse(cfMap.GetAttribute("destCFid"));
                Point p1       = new Point(this.srcNode.cfNodes[srccfid - 1].center.X + (int)(0.5 * CFNode.width) + 1, this.srcNode.cfNodes[srccfid - 1].center.Y);
                Point p2       = new Point(this.destNode.cfNodes[destcfid - 1].center.X - (int)(0.5 * CFNode.width) - 1, this.destNode.cfNodes[destcfid - 1].center.Y);
                float textSim  = float.Parse(cfMap.GetAttribute("textSim"));
                if (textSim == 1.0)
                {
                    cgv.G.DrawLine(CloneGenealogyViz.pen2, p1, p2);
                }
                else
                {
                    cgv.G.DrawLine(CloneGenealogyViz.pen3, p1, p2);
                }
            }
            if (flag == 0)
            {
                Point p1 = new Point(this.srcNode.center.X + (int)(0.5 * CFNode.width) + 1, this.srcNode.center.Y);
                Point p2 = new Point(this.destNode.center.X - (int)(0.5 * CFNode.width) - 1, this.destNode.center.Y);
                cgv.G.DrawLine(CloneGenealogyViz.pen3, p1, p2);
            }
        }
Esempio n. 2
0
 public void Draw2(CloneGenealogyViz cgv, char tag)
 {
     outerRect = new Rectangle(center.X - (int)(0.5 * width), center.Y - (int)(0.5 * height), width, height);
     cgv.G.DrawRectangle(CloneGenealogyViz.pen4, outerRect);
     cgv.G.FillRectangle(CloneGenealogyViz.brush2, outerRect);
     //添加克隆代码标签
     cgv.G.DrawString(tag.ToString(), CloneGenealogyViz.font1, CloneGenealogyViz.brush5, center.X - 8, center.Y - 8);
     this.tag = tag;
 }
Esempio n. 3
0
        public void Draw2(CloneGenealogyViz cgv, string tags)
        {
            cgv.G.DrawRectangle(CloneGenealogyViz.pen4, this.rect);
            int i = 0;

            foreach (CFNode cfNode in cfNodes)
            {
                cfNode.Draw2(cgv, tags[i++]);
            }                                    //标签作为参数传递
        }