private static void DrawText(PointType type, TextDrawer p , Graphics g) { Font myFont = null; SolidBrush blackBrush = null; switch(type) { case PointType.CENTER: myFont = new Font("Verdana", 14); blackBrush = new SolidBrush(Color.Red); g.DrawString(p.text, myFont, blackBrush, p.x, p.y); break; case PointType.EDAGE: myFont = new Font("Verdana", 12); blackBrush = new SolidBrush(Color.Red); g.DrawString(p.text, myFont, blackBrush, p.x, p.y); break; case PointType.NORMAL: myFont = new Font("Courier New", 8); blackBrush = new SolidBrush(Color.Green); g.DrawString(p.text, myFont, blackBrush, p.x, p.y); break; case PointType.GROUP: myFont = new Font("Verdana", 12); blackBrush = new SolidBrush(Color.RoyalBlue); g.DrawString(p.text, myFont, blackBrush, p.x, p.y); break; } }
private static void DrawText(PointType type, TextDrawer p, Graphics g) { Font myFont = null; SolidBrush blackBrush = null; switch (type) { case PointType.CENTER: myFont = new Font("Verdana", 14); blackBrush = new SolidBrush(Color.Red); g.DrawString(p.text, myFont, blackBrush, p.x, p.y); break; case PointType.EDAGE: myFont = new Font("Verdana", 12); blackBrush = new SolidBrush(Color.Red); g.DrawString(p.text, myFont, blackBrush, p.x, p.y); break; case PointType.NORMAL: myFont = new Font("Courier New", 8); blackBrush = new SolidBrush(Color.Green); g.DrawString(p.text, myFont, blackBrush, p.x, p.y); break; case PointType.GROUP: myFont = new Font("Verdana", 12); blackBrush = new SolidBrush(Color.RoyalBlue); g.DrawString(p.text, myFont, blackBrush, p.x, p.y); break; } }
/// <summary> /// 绘制初始画板 /// </summary> public void DrawSimuMap(List <NodeBean> lnb, List <LinkBean> lnr) { if (pl == null) { pl = (DrawConverter(lnb)); } // 将pl转化为实际值 List <PointDrawer> lpd = convertToTrueListPoints(pl); PointDrawer.Draw(PointType.NORMAL, lpd.ToArray(), this.graph); // List <TextDrawer> tl = new List <TextDrawer>(); foreach (PointDrawer p in lpd) { tl.Add(new TextDrawer(p.name, (int)(p.Longtitude + 10), (int)(p.Latitude - 5))); } TextDrawer.Draw(TextType.NORMAL, tl.ToArray(), this.graph); // 将lrd转化为实际值 if (lrd == null) { lrd = DrawConverter(lnr); } List <RouteDrawer> lld = convertToTrueListRoutes(lrd, lpd); RouteDrawer.Draw(RouteType.NORMAL, lld.ToArray(), this.graph); }
private static void DrawTexts(PointType type, TextDrawer[] t , Graphics g) { for (int i = 0; i < t.GetLength(0); i++) { DrawText(type, t[i], g); } }
public TextDrawer(TextDrawer p) { this.text = p.text; this.x = p.x; this.y = p.y; }