Example #1
0
        public void DrawPointer(NodeBean nodebean)
        {
            List<PointDrawer> lpd_temp = new List<PointDrawer>();
            List<RouteDrawer> lrd_temp = new List<RouteDrawer>();

            foreach(RouteDrawer rd in lrd)
            {
                if (rd.spoint.id.Equals(nodebean.id))
                {
                    lpd_temp.Add(rd.epoint);
                    lrd_temp.Add(rd);
                }
                if (rd.epoint.id.Equals(nodebean.id))
                {
                    lpd_temp.Add(rd.spoint);
                    lrd_temp.Add(rd);
                }
            }

            PointDrawer p = findPointerById(nodebean.id);
            PointDrawer p_new = new PointDrawer(p.id, p.name, p.Longtitude * width, p.Latitude * height);
            Draw(DrawItem.POINT, PointType.CENTER, p_new);

            List<PointDrawer> lpp = convertToTrueListPoints(lpd_temp);
            Draw(DrawItem.POINT, PointType.EDAGE, lpp.ToArray());

            List<RouteDrawer> ll = convertToTrueListRoutes(lrd_temp, lpp, p_new);
            Draw(DrawItem.ROUTE, RouteType.EDAGE, ll.ToArray());
            graph.Flush();
        }
Example #2
0
        public static NodeBean findNodeById(string j)
        {
            NodeBean nbean = null;

            foreach (GroupBean gbean in groups)
            {
                nbean = XmlMapping.findNodeBeanById(j, gbean);
                if (nbean != null)
                {
                    break;
                }
            }
            return(nbean);
        }
Example #3
0
        private void getNodes(GroupBean gb, XmlNode nodeclass)
        {
            XmlNodeList xmlNodeList = getChildern(nodeclass);

            foreach (XmlNode node in xmlNodeList)
            {
                NodeBean nodebean = new NodeBean();

                nodebean.id    = getNodeAttrValue(node, AttrType.Id);
                nodebean.group = gb;

                XmlAttributeCollection collection = getNodeAttrs(node);
                foreach (XmlAttribute atrr in collection)
                {
                    nodebean.AddAttribute(atrr.Name, atrr.Value);
                }

                gb.lchildern.Add(nodebean);
            }
        }
Example #4
0
        private void getNodes(GroupBean gb, XmlNode nodeclass)
        {
            XmlNodeList xmlNodeList = getChildern(nodeclass);
            foreach(XmlNode node in xmlNodeList)
            {
                NodeBean nodebean = new NodeBean();

                nodebean.id = getNodeAttrValue(node, AttrType.Id);
                nodebean.group = gb;

                XmlAttributeCollection collection = getNodeAttrs(node);
                foreach(XmlAttribute atrr in collection)
                {
                    nodebean.AddAttribute(atrr.Name, atrr.Value);
                }

                gb.lchildern.Add(nodebean);
            }
        }
Example #5
0
 public LinkBean(NodeBean src, NodeBean tag)
 {
     this.source = src;
     this.target = tag;
 }
Example #6
0
 private PointDrawer DrawConverter(NodeBean nodebean)
 {
     return new PointDrawer(nodebean.id,
         nodebean.attributes["name"].ToString(),
         RandomShuffle.RandDouble(),
         RandomShuffle.RandDouble());
 }
Example #7
0
 public bool Equals(NodeBean bean)
 {
     return (this == null || bean == null) ? ((this == null) ? (bean == null) : false) : (this.id.Equals(bean.id));
 }
Example #8
0
 public static bool Equals(NodeBean bean1, NodeBean bean2)
 {
     return (bean1 == null || bean2 == null) ? ((bean1 == null) ? (bean2 == null) : false) : (bean1.id.Equals(bean2.id));
 }
Example #9
0
 public bool Equals(NodeBean bean)
 {
     return((this == null || bean == null) ? ((this == null) ? (bean == null) : false) : (this.id.Equals(bean.id)));
 }
Example #10
0
 public static bool Equals(NodeBean bean1, NodeBean bean2)
 {
     return((bean1 == null || bean2 == null) ? ((bean1 == null) ? (bean2 == null) : false) : (bean1.id.Equals(bean2.id)));
 }
Example #11
0
 public LinkBean(NodeBean src, NodeBean tag)
 {
     this.source = src;
     this.target = tag;
 }
Example #12
0
        private List<NodeBean> getStOfNode(NodeBean node)
        {
            List<NodeBean> lres = new List<NodeBean>();

            int r = int.Parse(node.id);
            // 找邻居节点
            for (int j = 0; j < graph.Cols; j++)
            {
                if (!graph.getMNode(r, j).Value.Equals(0)) // 当A(r, j) != 0
                    lres.Add(MyXml.findNodeById(j.ToString()));
            }

            return lres;
        }
Example #13
0
 /// <summary>
 ///   ?? 包含本身嘛?
 /// </summary>
 /// <param name="node"></param>
 /// <returns></returns>
 private int getEdgesCount(NodeBean node)
 {
     int r = int.Parse(node.id);
     int count = 0;
     for (int j = 0; j < graph.Cols; j++ )
     {
         if (!graph.getMNode(r, j).Value.Equals(0))
             count++;
     }
     return count;
 }